> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GPU Sandboxes Overview

> Run a container image of your choice on a dedicated GPU node, exec into it, transfer files, stream its logs, and read its metrics through one REST API. Billed per second.

> [!WARNING]
>
> **Invite-only preview.** GPU Sandboxes is available only to accounts enabled for the preview. Check yours with [`GET /v2/ai/sandbox-access`](https://developers.telnyx.com/docs/gpu-sandboxes/api-conventions#check-access). Every other GPU Sandboxes endpoint answers `403 sandboxes_not_whitelisted` for an account that isn't enabled.

> [!NOTE]
>
> GPU Sandboxes rent a whole GPU node for a container image of your choice. For CPU-only sandboxes that run agent code, see [Agent Sandboxes](https://developers.telnyx.com/docs/edge-compute/sandboxes.md).

A sandbox runs one container image in its own virtual machine on Telnyx bare-metal hardware. Each sandbox currently rents a **whole GPU node**: it gets every GPU on the node, and no other sandbox shares it. Its CPU, memory, and disk are listed with the GPU type. A sandbox can run for a few seconds or indefinitely (`timeout: null`). It is billed per second while running.

Use GPU Sandboxes through the Telnyx CLI (`telnyx-edge sandbox-gpu`) or the REST API under `https://api.telnyx.com/v2/ai`, with your Telnyx API key. [Get Started](https://developers.telnyx.com/docs/gpu-sandboxes/quickstart.md) shows both.

## What You Can Do

| Capability | Endpoint | Guide |
| - | - | - |
| Check access | [`GET /v2/ai/sandbox-access`](https://developers.telnyx.com/api-reference/sandbox-access/check-sandboxes-access) | [API conventions](https://developers.telnyx.com/docs/gpu-sandboxes/api-conventions.md#check-access) |
| List GPU types and prices | [`GET /v2/ai/sandbox-gpu-types`](https://developers.telnyx.com/api-reference/sandbox-gpu-types/list-gpu-types) | [GPU types and billing](https://developers.telnyx.com/docs/gpu-sandboxes/resources.md) |
| Create a sandbox | [`POST /v2/ai/sandboxes`](https://developers.telnyx.com/api-reference/sandboxes/create-a-sandbox) | [Lifecycle](https://developers.telnyx.com/docs/gpu-sandboxes/lifecycle.md) |
| Find sandboxes | [`GET /v2/ai/sandboxes`](https://developers.telnyx.com/api-reference/sandboxes/list-sandboxes), [`GET …/{sandbox_id}`](https://developers.telnyx.com/api-reference/sandboxes/get-a-sandbox) | [Lifecycle](https://developers.telnyx.com/docs/gpu-sandboxes/lifecycle.md#listing-and-retention) |
| Wait for a sandbox to end | [`GET …/{sandbox_id}/wait`](https://developers.telnyx.com/api-reference/sandboxes/wait-for-a-sandbox-to-end) | [Lifecycle](https://developers.telnyx.com/docs/gpu-sandboxes/lifecycle.md#wait-for-a-sandbox-to-end) |
| Terminate a sandbox | [`POST …/{sandbox_id}/terminate`](https://developers.telnyx.com/api-reference/sandboxes/terminate-a-sandbox) | [Lifecycle](https://developers.telnyx.com/docs/gpu-sandboxes/lifecycle.md#stopping) |
| Run commands in a running sandbox | [`POST …/{sandbox_id}/execs`](https://developers.telnyx.com/api-reference/sandbox-execs/run-a-command-in-a-sandbox) | [Execs](https://developers.telnyx.com/docs/gpu-sandboxes/execs.md) |
| Stream a command's output and write its stdin | WebSocket `…/execs/{exec_id}/attach` | [WebSocket attach](https://developers.telnyx.com/docs/gpu-sandboxes/attach.md) |
| Read, write, list, and delete files | [`GET`](https://developers.telnyx.com/api-reference/sandbox-files/read-a-file-or-list-a-directory), [`PUT`](https://developers.telnyx.com/api-reference/sandbox-files/write-a-file-or-create-a-directory), [`DELETE …/files`](https://developers.telnyx.com/api-reference/sandbox-files/delete-a-file-or-directory) | [Files](https://developers.telnyx.com/docs/gpu-sandboxes/files.md) |
| Read or follow the main process's output | [`GET …/logs`](https://developers.telnyx.com/api-reference/sandbox-logs/read-or-follow-a-sandboxs-logs) | [Logs](https://developers.telnyx.com/docs/gpu-sandboxes/logs.md) |
| Read CPU, memory and network usage | [`GET …/metrics`](https://developers.telnyx.com/api-reference/sandbox-metrics/get-a-sandboxs-metrics) | [Metrics](https://developers.telnyx.com/docs/gpu-sandboxes/metrics.md) |

## Key Behavior

* **Asynchronous start.** `POST /v2/ai/sandboxes` returns at once with `state: queued`. The sandbox then goes through `preparing` (when its GPUs need preparing), `scheduled`, and `starting` (pulling the image) to `running`. When no node is free, it waits in the queue for up to `queue_timeout` seconds.
* **Whole-node GPU rental.** A sandbox names a GPU type and a count from the type's `allowed_counts`. Currently each type lists one count, its node's GPU count, so the sandbox gets the whole node. Its CPU, memory, and disk come from the type.
* **Processes outlive connections.** Execs keep running when a client disconnects. Reconnect from anywhere and replay output from a byte offset.
* **Logs in your own bucket.** The main process's stdout and stderr are stored in a Telnyx Cloud Storage bucket in your account, readable through the API or any S3 tool.
* **Restricted network.** A sandbox reaches the public internet only, never Telnyx internal addresses. Outbound access can be limited to a CIDR allowlist or turned off entirely. Sandboxes accept no inbound connections.
* **Retry-safe writes.** Every side-effecting endpoint accepts an `Idempotency-Key` header. A retried create returns the same sandbox instead of starting, and billing, a second one.

## Next Steps

> [card] [Get Started](https://developers.telnyx.com/docs/gpu-sandboxes/quickstart.md)
>
> Create a GPU sandbox, run a command, read a file, and terminate it.

> [card] [Lifecycle](https://developers.telnyx.com/docs/gpu-sandboxes/lifecycle.md)
>
> States, termination reasons, timeouts, and readiness.

> [card] [GPU Types and Billing](https://developers.telnyx.com/docs/gpu-sandboxes/resources.md)
>
> Node types, sizing, GPU limits, queueing, and per-second billing.

> [card] [Execs](https://developers.telnyx.com/docs/gpu-sandboxes/execs.md)
>
> Run commands, wait for exit codes, send signals.
