---
title: "Start an isolated interpreter context with its own state, directory and environment."
method: POST
path: "/v1/sandboxes/{id}/interpreter/contexts"
tags: ["interpreter"]
---

# Start an isolated interpreter context with its own state, directory and environment.

`POST /v1/sandboxes/{id}/interpreter/contexts`

## Request

- Base URL: `https://api.withruntime.com`
- URL: `https://api.withruntime.com/v1/sandboxes/{id}/interpreter/contexts`
- Auth: HTTP bearer

At most 4 contexts run in one sandbox; each is a process of the sandbox's own user.

## Path parameters

- `id` string, required: Resource identifier (UUID).

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `id` string: A context's id; each language's name is its default context, started on first use.
  - `language` 'python' | 'javascript' | 'typescript' | 'r' | 'java' | 'bash' | 'go': python by default. R, Java and Go are installed on first use (tens of seconds, once) when the image lacks them.
  - `cwd` string
  - `env` object: Environment variables for the context's process.

## Response `200`

Success

- object
  - `id` string
  - `language` string
  - `processId` string
  - `cwd` string
  - `state` string
  - `startedAt` integer

## Other responses

- `default`: Error

---

[API](https://skmtc.dev/withruntime/apis/runtime-cloud-api.md) · [All operations](https://skmtc.dev/withruntime/apis/runtime-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/withruntime/apis/runtime-cloud-api/revisions/6f4012286988?raw)
