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

# Create a sandbox

`POST /api/v0beta1/sandboxes`

## Request body

- CreateSandboxRequest
  - `name` string, required
  - `repo_url` string
  - `git_url` string
  - `github_url` string
  - `branch` string
  - `new_branch_name` string
  - `provider` 'daytona' | 'freestyle' | 'vercel'
  - `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-dind'
  - `size` 'xs' | 'm' | 'l' | 'xl'
  - `snapshot` string, nullable
  - `integration_ids` string[]
  - `initial_prompt` string
  - `agent` 'claude' | 'codex'
  - `workflow` object
    - `enabled` boolean, required
  - `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
  - `provider_url` 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
  - `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
  - `state` string
  - `status` 'creating' | 'starting' | 'running' | 'stopping' | 'suspending' | 'suspended' | 'snapshotting' | 'failed' | 'unknown'
  - `setup_status` 'ok' | 'setup-running' | 'git-failed' | 'setup-failed' | 'sys-setup-failed' | 'null', nullable
  - `urls_expire_at` union
    - string
    - string, date-time
    - unknown
  - `secret_names` string[]
  - `has_workflow` boolean
  - `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
  - `created_by` object, nullable
    - `name` string, nullable, required
    - `email` string, nullable, required
  - `origin` 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
- `409` — Error

---

[API](https://skmtc.net/amika/apis/amika-api.md) · [All operations](https://skmtc.net/amika/apis/amika-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/amika/amika-api/revisions/664536fccd0e/schema)
