Create Container
Containers
Create Container
Create a new sandboxed Linux container
POST
Create Container
Endpoint
creating status, and the container becomes running once initialization completes.
Request Headers
Bearer token for authentication
Must be
application/jsonRequest Body
Base image to use for the container. Supported values:
ubuntu:24.04- Ubuntu 24.04 LTSdebian:bookworm- Debian 12alpine:latest- Alpine Linuxarchlinux:latest- Arch Linuxcustom- Use a custom Docker image (requirescustom_imagefield)
Container name (1-64 characters, alphanumeric and hyphens only). Auto-generated if not provided (e.g., “swift-lion-742”).
Required when
image is “custom”. Specify a valid Docker image reference (e.g., “node:20-alpine”, “python:3.11”).Pre-configured development environment. Options:
node- Node.js development (nvm, npm, yarn)python- Python development (pyenv, pip, poetry)go- Go development toolsrust- Rust toolchaindevops- Docker, kubectl, terraform, ansiblebarebone- Minimal setup, fastest startup
Shell customization options
Memory limit in MB (256-4096 for free tier, higher for paid tiers). Defaults to tier limit if not specified.
CPU allocation in millicores (250-4000, where 1000 = 1 CPU core). Defaults to tier limit if not specified.
Disk quota in MB (1024-16384 for free tier). Defaults to tier limit if not specified.
Response
Unique container identifier (database ID during creation, Docker ID once running)
Database record identifier
Owner user ID
Container name
Base image used
Development role (if specified)
Current status:
creating, running, stopped, or errorISO 8601 timestamp of creation
Always
true - indicates asynchronous creationHuman-readable status message
(Free/Guest users only) ISO 8601 timestamp when session expires
(Free/Guest users only) Remaining session time in seconds
Status Codes
- 202 Accepted - Container creation started successfully
- 400 Bad Request - Invalid parameters (e.g., invalid image, name format)
- 401 Unauthorized - Missing or invalid API token
- 403 Forbidden - Container limit reached or insufficient permissions
- 409 Conflict - Container name already exists
- 500 Internal Server Error - Server-side error
Error Responses
Error message describing what went wrong
(For limit errors) Current number of containers
(For limit errors) Maximum containers allowed
(For limit errors) Your current subscription tier
(For image errors) List of supported image names
Examples
Response Examples
Success Response (202 Accepted)
Container Limit Error (403)
Invalid Image Error (400)
WebSocket Progress Updates
For real-time creation progress, connect to the WebSocket events endpoint:validating → pulling → creating → starting → configuring → ready
Notes
Async Creation: Container creation is asynchronous to prevent timeout issues. The API returns immediately with
status: "creating". Use WebSocket events or poll the Get Container endpoint to monitor progress.Resource Limits: Requested resources are validated against your tier limits. Values exceeding limits are automatically clamped to the maximum allowed.
See Also
- List Containers - Check container status
- Container Management - Start, stop, and delete operations
- Terminal API - Connect to container terminals