---
title: "Create a Devbox."
method: POST
path: "/v1/devboxes"
tags: ["Devbox", "Devbox-Lifecycle"]
---

# Create a Devbox.

`POST /v1/devboxes`

Create a Devbox and begin the boot process. The Devbox will initially launch in the 'provisioning' state while Runloop allocates the necessary infrastructure. It will transition to the 'initializing' state while the booted Devbox runs any Runloop or user defined set up scripts. Finally, the Devbox will transition to the 'running' state when it is ready for use.

## Request body

- DevboxCreateParameters
  - `name` string, nullable — (Optional) A user specified name to give the Devbox.
  - `environment_variables` object, nullable — (Optional) Environment variables used to configure your Devbox.
  - `secrets` object, nullable — (Optional) Map of environment variable names to secret names. The secret values will be securely injected as environment variables in the Devbox. Example: {"DB_PASS": "DATABASE_PASSWORD"} sets environment variable 'DB_PASS' to the value of secret 'DATABASE_PASSWORD'.
  - `file_mounts` object, nullable — (Optional) Map of paths and file contents to write before setup..
  - `entrypoint` string, nullable — (Optional) When specified, the Devbox will run this script as its main executable. The devbox lifecycle will be bound to entrypoint, shutting down when the process is complete.
  - `blueprint_id` string, nullable — Blueprint ID to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified.
  - `blueprint_name` string, nullable — Name of Blueprint to use for the Devbox. When set, this will load the latest successfully built Blueprint with the given name. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified.
  - `repo_connection_id` string, nullable — Repository connection id the devbox should source its base image from.
  - `launch_parameters` LaunchParameters — LaunchParameters enable you to customize the resources available to your Devbox as well as the environment set up that should be completed before the Devbox is marked as 'running'.
    - `launch_commands` string[], nullable — Set of commands to be run at launch time, before the entrypoint process is run.
    - `resource_size_request` 'X_SMALL' | 'SMALL' | 'MEDIUM' | 'LARGE' | 'X_LARGE' | 'XX_LARGE' | 'CUSTOM_SIZE' — The size of the Devbox resources for Runloop to allocate. X_SMALL: 0.5 cpu x 1GiB memory x 4GiB disk SMALL: 1 cpu x 2GiB memory x 4GiB disk MEDIUM: 2 cpu x 4GiB memory x 8GiB disk LARGE: 2 cpu x 8GiB memory x 16GiB disk X_LARGE: 4 cpu x 16GiB memory x 16GiB disk XX_LARGE: 8 cpu x 32GiB memory x 16GiB disk CUSTOM_SIZE: To choose a custom size, set this enum and also the custom_cpu_cores, custom_gb_memory, and optionally custom_disk_size in launch parameters. These must be int values that are a multiple of 2 with a cpu:memory ratio between 2 and 8 inclusive. Min/Max permitted cpu cores, memory, and disk size are 1/16, 2/64, and 2/64 respectively.
    - `keep_alive_time_seconds` integer, nullable — Time in seconds after which Devbox will automatically shutdown. Default is 1 hour.
    - `available_ports` integer[], nullable — A list of ports to make available on the Devbox. Only ports made available will be surfaced to create tunnels via the 'createTunnel' API.
    - `after_idle` IdleConfigurationParameters
      - `idle_time_seconds` integer, required — After idle_time_seconds, on_idle action will be taken.
      - `on_idle` 'shutdown' | 'suspend', required — Action to take after Devbox idle timer is triggered. shutdown: Shutdown the Devbox. suspend: Suspend the Devbox.
    - `custom_cpu_cores` integer, nullable — custom resource size, number of cpu cores, must be multiple of 2. Min is 1, max is 16.
    - `custom_gb_memory` integer, nullable — custom memory size, number in GiB, must be a multiple of 2. Min is 2GiB, max is 64GiB.
    - `custom_disk_size` integer, nullable — custom disk size, number in GiB, must be a multiple of 2. Min is 2GiB, max is 64GiB.
    - `architecture` 'x86_64' | 'arm64'
    - `user_parameters` UserParameters — Configuration for the Linux user in the Devbox environment.
      - `username` string, required — Username for the Linux user.
      - `uid` integer, required — User ID (UID) for the Linux user. Must be a positive integer.
    - `required_services` string[], nullable — A list of ContainerizedService names to be started when a Devbox is created. A valid ContainerizedService must be specified in Blueprint to be started.
  - `snapshot_id` string, nullable — Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified.
  - `metadata` object, nullable — User defined metadata to attach to the devbox for organization.
  - `code_mounts` CodeMountParameters[], nullable — A list of code mounts to be included in the Devbox.
    - `repo_name` string, required — The name of the repo to mount. By default, code will be mounted at /home/user/{repo_name}s.
    - `repo_owner` string, required — The owner of the repo.
    - `install_command` string, nullable — Installation command to install and setup repository.
    - `token` string, nullable — The authentication token necessary to pull repo.
  - `mounts` Mount[], nullable — A list of file system mounts to be included in the Devbox.
    - union
      - ObjectMountParameters
        - `object_id` string, required — The ID of the object to write.
        - `object_path` string, required — The path to write the object on the Devbox. Use absolute path of object (ie /home/user/object.txt, or directory if archive /home/user/archive_dir)
        - `type` 'object_mount', required
      - AgentMountParameters
        - `agent_id` string, required — The ID of the agent to mount.
        - `agent_path` string, nullable — Optional path to mount the agent on the Devbox. Required for git and object agents. Use absolute path (e.g., /home/user/agent)
        - `type` 'agent_mount', required

## Response `200`

OK

- DevboxView — A Devbox represents a virtual development environment. It is an isolated sandbox that can be given to agents and used to run arbitrary code such as AI generated code.
  - `id` string, required — The ID of the Devbox.
  - `name` string, nullable — The name of the Devbox.
  - `status` 'provisioning' | 'initializing' | 'running' | 'suspending' | 'suspended' | 'resuming' | 'failure' | 'shutdown', required — The status of the Devbox. provisioning: Runloop is allocating and booting the necessary infrastructure resources. initializing: Runloop defined boot scripts are running to enable the environment for interaction. running: The Devbox is ready for interaction. suspending: The Devbox disk is being snaphsotted and as part of suspension. suspended: The Devbox disk is saved and no more active compute is being used for the Devbox. resuming: The Devbox disk is being loaded as part of booting a suspended Devbox. failure: The Devbox failed as part of booting or running user requested actions. shutdown: The Devbox was successfully shutdown and no more active compute is being used.
  - `create_time_ms` integer, required — Creation time of the Devbox (Unix timestamp milliseconds).
  - `end_time_ms` integer, nullable, required — The time the Devbox finished execution (Unix timestamp milliseconds). Present if the Devbox is in a terminal state.
  - `initiator_type` 'unknown' | 'api' | 'scenario'
  - `initiator_id` string, nullable — The ID of the initiator that created the Devbox.
  - `blueprint_id` string, nullable — The Blueprint ID used in creation of the Devbox, if the devbox was created from a Blueprint.
  - `snapshot_id` string, nullable — The Snapshot ID used in creation of the Devbox, if the devbox was created from a Snapshot.
  - `metadata` object, required — The user defined Devbox metadata.
  - `failure_reason` 'out_of_memory' | 'out_of_disk' | 'execution_failed' — The category of failure experienced by the Devbox. out_of_memory: The Devbox ran out of memory at runtime. Use launch parameters to request a larger resource size. out_of_disk: The Devbox ran out of disk at runtime. Please reach out to support for us to better support your use case. execution_failed: The Devbox failed at runtime. Please use the dashboard to look at the logs of the failure.
  - `shutdown_reason` 'api_shutdown' | 'keep_alive_timeout' | 'entrypoint_exit' | 'idle' — The reason that caused the transition of the Devbox to the shutown state. api_shutdown: The Devbox shutdown due to API request. entrypoint_exit: The Devbox entrypoint program completed. idle: The Devbox shutdown due to configured action on idle configuration.
  - `launch_parameters` LaunchParameters, required — LaunchParameters enable you to customize the resources available to your Devbox as well as the environment set up that should be completed before the Devbox is marked as 'running'.
    - `launch_commands` string[], nullable — Set of commands to be run at launch time, before the entrypoint process is run.
    - `resource_size_request` 'X_SMALL' | 'SMALL' | 'MEDIUM' | 'LARGE' | 'X_LARGE' | 'XX_LARGE' | 'CUSTOM_SIZE' — The size of the Devbox resources for Runloop to allocate. X_SMALL: 0.5 cpu x 1GiB memory x 4GiB disk SMALL: 1 cpu x 2GiB memory x 4GiB disk MEDIUM: 2 cpu x 4GiB memory x 8GiB disk LARGE: 2 cpu x 8GiB memory x 16GiB disk X_LARGE: 4 cpu x 16GiB memory x 16GiB disk XX_LARGE: 8 cpu x 32GiB memory x 16GiB disk CUSTOM_SIZE: To choose a custom size, set this enum and also the custom_cpu_cores, custom_gb_memory, and optionally custom_disk_size in launch parameters. These must be int values that are a multiple of 2 with a cpu:memory ratio between 2 and 8 inclusive. Min/Max permitted cpu cores, memory, and disk size are 1/16, 2/64, and 2/64 respectively.
    - `keep_alive_time_seconds` integer, nullable — Time in seconds after which Devbox will automatically shutdown. Default is 1 hour.
    - `available_ports` integer[], nullable — A list of ports to make available on the Devbox. Only ports made available will be surfaced to create tunnels via the 'createTunnel' API.
    - `after_idle` IdleConfigurationParameters
      - `idle_time_seconds` integer, required — After idle_time_seconds, on_idle action will be taken.
      - `on_idle` 'shutdown' | 'suspend', required — Action to take after Devbox idle timer is triggered. shutdown: Shutdown the Devbox. suspend: Suspend the Devbox.
    - `custom_cpu_cores` integer, nullable — custom resource size, number of cpu cores, must be multiple of 2. Min is 1, max is 16.
    - `custom_gb_memory` integer, nullable — custom memory size, number in GiB, must be a multiple of 2. Min is 2GiB, max is 64GiB.
    - `custom_disk_size` integer, nullable — custom disk size, number in GiB, must be a multiple of 2. Min is 2GiB, max is 64GiB.
    - `architecture` 'x86_64' | 'arm64'
    - `user_parameters` UserParameters — Configuration for the Linux user in the Devbox environment.
      - `username` string, required — Username for the Linux user.
      - `uid` integer, required — User ID (UID) for the Linux user. Must be a positive integer.
    - `required_services` string[], nullable — A list of ContainerizedService names to be started when a Devbox is created. A valid ContainerizedService must be specified in Blueprint to be started.
  - `capabilities` DevboxCapabilities[], required — A list of capability groups this devbox has access to. This allows devboxes to be compatible with certain tools sets like computer usage APIs.
  - `state_transitions` DevboxStateTransition[], required — A list of state transitions in order with durations
    - `status` 'provisioning' | 'initializing' | 'running' | 'suspending' | 'suspended' | 'resuming' | 'failure' | 'shutdown' — The status of the Devbox. provisioning: Runloop is allocating and booting the necessary infrastructure resources. initializing: Runloop defined boot scripts are running to enable the environment for interaction. running: The Devbox is ready for interaction. suspending: The Devbox disk is being snaphsotted and as part of suspension. suspended: The Devbox disk is saved and no more active compute is being used for the Devbox. resuming: The Devbox disk is being loaded as part of booting a suspended Devbox. failure: The Devbox failed as part of booting or running user requested actions. shutdown: The Devbox was successfully shutdown and no more active compute is being used.
    - `transition_time_ms` Number

## Changes

- **2025-10-02** `6b65a42b7440` — 1 info
  - added the new optional request property `mounts`
- **2025-09-30** `9b2e136aedff` — 3 info
  - added the optional property `initiator_id` to the response with the `200` status
  - added the optional property `initiator_type` to the response with the `200` status
  - the response property `end_time_ms` became required for the status `200`
- **2025-09-29** `1749c364b895` — 1 info
  - removed the `language_server` enum value from the `capabilities/items/` response property for the response status `200`

[Change history](https://skmtc.dev/runloopai/apis/runloop-api/changes/v1/devboxes/post.md)

---

[API](https://skmtc.dev/runloopai/apis/runloop-api.md) · [All operations](https://skmtc.dev/runloopai/apis/runloop-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runloopai/runloop-api/revisions/436b4f5c7426/schema)
