Start a sandbox handoff for the CLI
POST /v1/sandboxes/handoffs: Start a sandbox handoff for the CLI.
POST /v1/sandboxes/handoffs
The first step of ohauthcat init without credentials. The CLI sends the S256 challenge of a secret code verifier and opens browser_url; the browser page solves Turnstile and calls createSandbox with the handoff_id, which seals the new sandbox’s keys into the handoff instead of returning them; the CLI then redeems them once with redeemSandboxHandoff and the verifier. The handoff expires after expires_in seconds. Per-client rolling quotas (5 per hour and 20 per day per IPv4 address or IPv6 /64) and a global daily cap apply (rate_limited with Retry-After). Only a hash of the handoff ID is stored. Not served on the standby host (503).
- Scope
public- Auth
- None
- Since
- 1.0
Request body
Section titled “Request body”
BASE64URL(SHA-256(code_verifier)) without padding (RFC 7636 §4.2).code_challengestring Requiredmin length 43 · max length 43
code_challenge_methodstring Requiredone of
S256
Responses
Section titled “Responses”- 201 Created. The response must not be cached. SandboxHandoff
- 400 Invalid request. Codes: parameter_invalid, parameter_missing, version_unsupported and resource-specific codes from the catalogue. Error
- 429 Code: rate_limited. Retry-After is set. Error
- 503 Code: service_unavailable. Retry-After is set; writes are paused. Error
- default Any other error, including internal_error. Every code is in the error catalogue. Error
Errors share one shape; see the error code catalogue.
curl -X POST \ "https://api.ohauthcat.com/v1/sandboxes/handoffs" \ -H "Content-Type: application/json" \ -d '{ "code_challenge": "example_code_challenge", "code_challenge_method": "S256"}'const response = await fetch("https://api.ohauthcat.com/v1/sandboxes/handoffs", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ "code_challenge": "example_code_challenge", "code_challenge_method": "S256" }),});const data = await response.json();import osimport requests
response = requests.post( "https://api.ohauthcat.com/v1/sandboxes/handoffs", json={ "code_challenge": "example_code_challenge", "code_challenge_method": "S256", },)data = response.json(){ "handoff_id": "01J9Z3K5V7W8X9Y0Z1A2B3C4D5", "browser_url": "https://app.acme.com/callback", "expires_in": 1, "interval": 1}