---
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' | 'e2b' | '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` 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.
  - `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
  - `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
  - `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[]
  - `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
  - `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

## Changes

- **2026-08-29** `b63d287ac419` — 1 info
  - added the optional property `mounted_secrets` to the response with the `202` status
- **2026-08-26** `7356672619e1` — 3 breaking, 2 info
  - the `git_url` request property's minLength was increased from `0` to `1`
  - the `github_url` request property's minLength was increased from `0` to `1`
  - the `repo_url` request property's minLength was increased from `0` to `1`
  - added the optional property `github_auth_mode` to the response with the `202` status
  - …1 more
- **2026-08-24** `837bdd763a48` — 5 breaking, 2 info
  - removed the enum value `l` of the request property `size`
  - removed the enum value `m` of the request property `size`
  - removed the enum value `xl` of the request property `size`
  - removed the enum value `xs` of the request property `size`
  - …3 more

[Change history](https://skmtc.dev/amika/apis/amika-api/changes/api/v0beta1/sandboxes/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-service-production.skmtc.workers.dev/v1/apis/amika/amika-api/revisions/b63d287ac419/schema)
