DeepInfra Sandboxes API

Create and manage isolated sandbox environments.

Operations 10

POST /v1/sandboxes Create Sandbox #
GET /v1/sandboxes List Sandboxes #
GET /v1/sandboxes/catalog List Sandbox Plans #
GET /v1/sandboxes/{sandbox_id} Get Sandbox #
DELETE /v1/sandboxes/{sandbox_id} Delete Sandbox #
POST /v1/sandboxes/{sandbox_id}/stop Stop Sandbox #
POST /v1/sandboxes/{sandbox_id}/start Start Sandbox #
POST /v1/sandboxes/{sandbox_id}/exec Exec Command #
PUT /v1/sandboxes/{sandbox_id}/fs/content Write File #
GET /v1/sandboxes/{sandbox_id}/fs/content Read File #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/deepinfra:deepinfra-sandboxes-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

deepinfra-sandboxes-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: DeepInfra Sandboxes API
  description: The DeepInfra API provides serverless AI inference, custom model deployments, and GPU rentals.
  version: 1.0.0
servers:
- url: https://api.deepinfra.com
tags:
- name: Sandboxes
  description: Create and manage isolated sandbox environments.
paths:
  /v1/sandboxes:
    post:
      tags:
      - Sandboxes
      summary: Create Sandbox
      description: Create a new sandbox instance with the given plan and settings. The sandbox starts in CREATING state and transitions to RUNNING asynchronously.
      operationId: sandbox_create_v1_sandboxes_post
      security:
      - HTTPBearer: []
      parameters:
      - name: xi-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Xi-Api-Key
      - name: x-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SandboxCreateIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SandboxCreateOut'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Not Found
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Too Many Requests
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Service Unavailable
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Sandboxes
      summary: List Sandboxes
      operationId: sandbox_list_v1_sandboxes_get
      security:
      - HTTPBearer: []
      parameters:
      - name: xi-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Xi-Api-Key
      - name: x-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SandboxOut'
                title: Response Sandbox List V1 Sandboxes Get
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/sandboxes/catalog:
    get:
      tags:
      - Sandboxes
      summary: List Sandbox Plans
      description: Returns all available sandbox plans with their resource specs and pricing.
      operationId: sandbox_catalog_v1_sandboxes_catalog_get
      security:
      - HTTPBearer: []
      parameters:
      - name: xi-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Xi-Api-Key
      - name: x-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SandboxPlanOut'
                title: Response Sandbox Catalog V1 Sandboxes Catalog Get
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/sandboxes/{sandbox_id}:
    get:
      tags:
      - Sandboxes
      summary: Get Sandbox
      operationId: sandbox_get_v1_sandboxes__sandbox_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: sandbox_id
        in: path
        required: true
        schema:
          type: string
          title: Sandbox Id
      - name: xi-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Xi-Api-Key
      - name: x-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SandboxOut'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Sandboxes
      summary: Delete Sandbox
      operationId: sandbox_delete_v1_sandboxes__sandbox_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: sandbox_id
        in: path
        required: true
        schema:
          type: string
          title: Sandbox Id
      - name: xi-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Xi-Api-Key
      - name: x-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/sandboxes/{sandbox_id}/stop:
    post:
      tags:
      - Sandboxes
      summary: Stop Sandbox
      operationId: sandbox_stop_v1_sandboxes__sandbox_id__stop_post
      security:
      - HTTPBearer: []
      parameters:
      - name: sandbox_id
        in: path
        required: true
        schema:
          type: string
          title: Sandbox Id
      - name: xi-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Xi-Api-Key
      - name: x-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Conflict
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/sandboxes/{sandbox_id}/start:
    post:
      tags:
      - Sandboxes
      summary: Start Sandbox
      operationId: sandbox_start_v1_sandboxes__sandbox_id__start_post
      security:
      - HTTPBearer: []
      parameters:
      - name: sandbox_id
        in: path
        required: true
        schema:
          type: string
          title: Sandbox Id
      - name: xi-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Xi-Api-Key
      - name: x-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Conflict
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Too Many Requests
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Service Unavailable
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/sandboxes/{sandbox_id}/exec:
    post:
      tags:
      - Sandboxes
      summary: Exec Command
      description: 'Run a command in the sandbox. Streams NDJSON lines (application/x-ndjson): {"stdout": ...}/{"stderr": ...} chunks followed by exactly one terminal {"returncode": N} or {"error": msg} line.'
      operationId: sandbox_exec_v1_sandboxes__sandbox_id__exec_post
      security:
      - HTTPBearer: []
      parameters:
      - name: sandbox_id
        in: path
        required: true
        schema:
          type: string
          title: Sandbox Id
      - name: xi-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Xi-Api-Key
      - name: x-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SandboxExecIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Conflict
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/sandboxes/{sandbox_id}/fs/content:
    put:
      tags:
      - Sandboxes
      summary: Write File
      description: Write the raw request body (application/octet-stream, max 100 MiB) to an absolute path inside the sandbox.
      operationId: sandbox_fs_write_v1_sandboxes__sandbox_id__fs_content_put
      security:
      - HTTPBearer: []
      parameters:
      - name: sandbox_id
        in: path
        required: true
        schema:
          type: string
          title: Sandbox Id
      - name: path
        in: query
        required: true
        schema:
          type: string
          title: Path
      - name: xi-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Xi-Api-Key
      - name: x-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Conflict
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Request Entity Too Large
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Sandboxes
      summary: Read File
      description: Read a file from an absolute path inside the sandbox; returns raw bytes (application/octet-stream).
      operationId: sandbox_fs_read_v1_sandboxes__sandbox_id__fs_content_get
      security:
      - HTTPBearer: []
      parameters:
      - name: sandbox_id
        in: path
        required: true
        schema:
          type: string
          title: Sandbox Id
      - name: path
        in: query
        required: true
        schema:
          type: string
          title: Path
      - name: xi-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Xi-Api-Key
      - name: x-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepError'
          description: Conflict
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    SandboxOut:
      properties:
        sandbox_id:
          type: string
          title: Sandbox Id
        plan:
          type: string
          title: Plan
        image:
          type: string
          title: Image
        state:
          type: string
          title: State
        tags:
          additionalProperties:
            type: string
          type: object
          title: Tags
        created_at:
          type: integer
          title: Created At
        provider:
          type: string
          title: Provider
        fail_reason:
          type: string
          title: Fail Reason
          default: ''
      type: object
      required:
      - sandbox_id
      - plan
      - image
      - state
      - tags
      - created_at
      - provider
      title: SandboxOut
    SandboxCreateIn:
      properties:
        plan:
          type: string
          title: Plan
          default: ''
        tags:
          additionalProperties:
            type: string
          type: object
          title: Tags
        timeout_seconds:
          type: integer
          title: Timeout Seconds
          default: 0
      type: object
      title: SandboxCreateIn
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DeepError:
      properties:
        error:
          type: string
          title: Error
          description: Error
          examples:
          - Model not found
      type: object
      required:
      - error
      title: DeepError
    SandboxCreateOut:
      properties:
        sandbox_id:
          type: string
          title: Sandbox Id
      type: object
      required:
      - sandbox_id
      title: SandboxCreateOut
    SandboxExecIn:
      properties:
        command:
          items:
            type: string
          type: array
          title: Command
        timeout_seconds:
          type: integer
          title: Timeout Seconds
          description: Seconds to allow the command to run before it's killed. 0 uses the server default (60s). Capped at 1800s (30 minutes).
          default: 0
      type: object
      required:
      - command
      title: SandboxExecIn
    SandboxPlanOut:
      properties:
        id:
          type: string
          title: Id
        vcpu:
          type: integer
          title: Vcpu
        ram_gb:
          type: integer
          title: Ram Gb
        disk_gb:
          type: integer
          title: Disk Gb
        price_per_hour:
          type: number
          title: Price Per Hour
      type: object
      required:
      - id
      - vcpu
      - ram_gb
      - disk_gb
      - price_per_hour
      title: SandboxPlanOut
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer