---
title: "Create a sandbox"
method: POST
path: "/api/v0beta1/rigs"
tags: ["Sandboxes"]
---

# Create a sandbox

`POST /api/v0beta1/rigs`

## Request

- Base URL: `https://app.amika.dev` (the document declares no server; this is the origin it was published from)
- URL: `https://app.amika.dev/api/v0beta1/rigs`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `wos-session`

## Request body

- CreateSandboxRequest
  - `name` string, required
  - `repo_url` string
  - `git_url` string
  - `github_url` string
  - `branch` string
  - `new_branch_name` string
  - `provider` 'daytona' | 'e2b' | 'freestyle' | 'vercel' | 'smol' | 'amika-hostd'
  - `host_id` string
  - `resources` object: With `host_id`, the rig's resources, in place of a named `size`: 1 to 16 vCPUs, at least 64 MiB of memory in whole MiB, and a disk of at least 1 GiB. Requires `host_id`, and cannot be combined with `size`.
    - `vcpus` integer, required
    - `memoryGib` number, required
    - `diskGib` integer, required
  - `auto_stop_interval` number
  - `auto_delete_interval` number
  - `amika_opencode_web` union
    - string
    - number
    - unknown
  - `env_vars` object
  - `secret_env_vars` object
  - `disabled_repo_env_var_names` string[]
  - `setup_script_text` string
  - `skip_setup_script` boolean
  - `agent_credentials` object[]
    - `kind` 'claude' | 'codex', required
    - `name` string
    - `type` 'oauth' | 'api_key'
    - `none` true
  - `preset` 'coder' | 'coder-plus-docker'
  - `size` string: Providerless sandbox size (for example `a0.m`). Legacy names such as `m` and `medium` are also accepted. The provider is inferred from `provider` or the server default; when omitted, the size defaults to that provider's medium tier. With `host_id`, names one of the host's own sizes instead; a host rig with neither `size` nor `resources` gets 4 vCPUs, 8 GiB of memory and a 20 GiB disk.
  - `snapshot` string, nullable
  - `integration_ids` string[]
  - `agent` 'claude' | 'codex'
  - `github_auth_mode` 'pat' | 'app_token'

## Response `202`

Sandbox created (provisioning continues in the background).

- Sandbox
  - `id` string, required
  - `user_id` string, nullable, required
  - `org_id` string, required
  - `name` string, required
  - `provider` string, nullable, required
  - `provider_sandbox_id` string, nullable, required
  - `amika_opencode_web` string, nullable, required
  - `repo_name` string, nullable, required
  - `repo_provider` string, nullable, required
  - `repo_id` string, nullable, required
  - `repo_url` string, nullable, required
  - `branch` string, nullable, required
  - `commit_hash` string, nullable, required
  - `snapshot` string, nullable, required
  - `snapshot_name` string, nullable
  - `sandbox_preset` string, nullable
  - `sandbox_size` string, nullable
  - `sandbox_size_config` object, nullable
    - `name` string, nullable, required
    - `vcpus` number, required
    - `memoryGib` number, required
    - `diskGib` number, required
    - `diskGrowOnly` boolean, required
  - `github_auth_mode` 'pat' | 'app_token' | 'null', nullable
  - `github_credential_provisioned` boolean, nullable
  - `error_message` string, nullable
  - `current_session_id` string, nullable, required
  - `services` object[], nullable, required
    - `name` string, required
    - `url` string, required
    - `hostPort` integer, required
    - `containerPort` integer, required
    - `protocol` string, required
    - `kind` 'system' | 'user'
  - `state` string
  - `status` 'creating' | 'starting' | 'running' | 'stopping' | 'stopped' | 'suspending' | 'suspended' | 'snapshotting' | 'failed' | 'unknown'
  - `setup_status` 'ok' | 'setup-running' | 'git-failed' | 'setup-failed' | 'sys-setup-failed' | 'null', nullable
  - `live_state_pending` boolean
  - `urls_expire_at` union
    - string
    - string, date-time
    - unknown
  - `secret_names` string[]
  - `mounted_secrets` object[]
    - `name` string, required
    - `scope` 'user' | 'org', required
    - `managed` boolean, required
    - `credential_type` 'api_key' | 'oauth' | 'null', nullable, required
    - `provider` string, nullable, required
  - `resolved_agent_credentials` union[]
    - union
      - object
        - `kind` string, required
        - `outcome` 'resolved', required
        - `name` string, required
        - `type` 'oauth' | 'api_key', required
        - `source` string, required
      - object
        - `kind` string, required
        - `outcome` 'skipped', required
        - `reason` 'request:none' | 'no_user_credential', required
  - `agent_credentials` object[]
    - `kind` string, required
    - `name` string, nullable, required
    - `scope` 'user' | 'org' | 'null', nullable, required
    - `credential_type` 'api_key' | 'oauth' | 'null', nullable, required
    - `inject_target` string, nullable, required
  - `created_by` object, nullable
    - `name` string, nullable, required
    - `email` string, nullable, required
  - `agent_cwd` string, nullable
  - `ssh_key_status` 'ready' | 'no-key' | 'stale-keys' | 'unknown'
  - `origin` string, nullable
  - `host_id` string, nullable
  - `created_at` union, required
    - string
    - string, date-time
  - `updated_at` union, required
    - string
    - string, date-time

## Other responses

- `400`: Error
- `401`: Error
- `403`: Error
- `404`: Error
- `409`: Error

## Changes

- **2026-10-29** `86f031a957c1`: 1 info
  - added the optional property `live_state_pending` to the response with the `202` status
- **2026-10-23** `c46868fd7b41`: 2 warning
  - removed the request property `initial_prompt`
  - removed the request property `workflow`
- **2026-10-03** `a122301d00e0`: 2 warning
  - removed the optional property `has_workflow` from the response with the `202` status
  - added the new `stopped` enum value to the `status` response property for the response status `202`
- **2026-09-30** `f9bd53246a8c`: 8 info
  - added the new optional request property `host_id`
  - added the new optional request property `resources`
  - added the new `amika-hostd` enum value to the request property `provider`
  - added the new `smol` enum value to the request property `provider`
  - …4 more
- **2026-09-21** `4d4f02352fdb`: 1 breaking, 3 info
  - removed the required property `provider_url` from the response with the `202` status
  - the `integration_ids` request property default value `` was removed
  - the `preset` request property default value `coder` was removed
  - added the optional property `services/items/kind` to the response with the `202` status

[Operation history](https://skmtc.dev/amika/apis/amika-api/changes/api/v0beta1/rigs/post.md)

---

[API](https://skmtc.dev/amika/apis/amika-api.md) - [All operations](https://skmtc.dev/amika/apis/amika-api/llms.txt) - [OpenAPI document](https://skmtc.dev/amika/apis/amika-api/revisions/86f031a957c1?raw)
