---
title: "Mint a sandbox key (no auth)"
method: POST
path: "/v1/sandbox/keys"
tags: ["Sandbox"]
---

# Mint a sandbox key (no auth)

`POST /v1/sandbox/keys`

## Request

- Base URL: `https://api.pyai.com`
- URL: `https://api.pyai.com/v1/sandbox/keys`
- Auth: none required

Create a free, instant `pyai_test_` sandbox key with **no human steps**, no email, no password, no card. Built for AI coding agents (Cursor, Lovable, Claude Code, Codex) and the PyAI MCP server's `create_sandbox_key` tool, so agent-generated code runs on its first execution instead of stalling at a credential wall. The key is a normal sandbox key: it **skips the credit gate (never returns 402)**, includes Hear/Speak/Omni/AMD/Recap starter scopes, enables Recap on the new org, expires automatically, and is bounded by a daily usage cap. Public and unauthenticated; rate-limited per source network. Treat the returned key as an opaque secret (read it from an env var). For production, create a live key in the console. May be disabled on some deployments (returns 404).

## Request body

- object
  - `label` string: Optional human label for the throwaway org/key, shown in your console (e.g. your app name). Sanitized; never used as an identifier.
  - `referral_token` string: Optional signed first-touch attribution token.

## Response `201`

A freshly minted sandbox key.

- object
  - `object` 'sandbox.key', required
  - `api_key` string, required: The plaintext `pyai_test_...` secret. Shown once, store it in an env var.
  - `key_id` string
  - `org_id` string
  - `project_id` string
  - `environment` 'test', required
  - `scopes` string[]: Starter scopes: Hear, Speak, Omni, AMD, Recap, and Cast.
  - `expires_at` integer, required: Key expiry, Unix epoch milliseconds.
  - `base_url` string, required: REST base URL to use with this key.
  - `docs` string
  - `note` string

## Other responses

- `404`: Sandbox-key minting is disabled on this deployment.
- `429`: Too many requests or too many concurrent realtime sessions; see Retry-After header (`code: rate_limit_exceeded | concurrency_limit_exceeded | daily_cap_exceeded`)

---

[API](https://skmtc.dev/pyai/apis/pyai-api.md) · [All operations](https://skmtc.dev/pyai/apis/pyai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pyai/apis/pyai-api/revisions/819d8e7c4d09?raw)
