Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.karta.sh/llms.txt

Use this file to discover all available pages before exploring further.

Karta uses conventional HTTP status codes. The body is JSON with a detail or an error/reason pair.

Status codes

StatusMeaningBody
200Success — accumulated response, or the start of an SSE stream.response object / SSE
201Resource created (session, release).the resource
202Accepted — async work queued (e.g. a Managed Agents event).{ "accepted": true }
401Missing or invalid credential.{ "detail": "Unauthorized" }
402Budget exhausted — checked before running anything.{ "error": "budget_exhausted", "reason": "…" }
403Forbidden — e.g. a session token scoped to another project.{ "detail": "…" }
404Not found, or belongs to another org (default-deny).{ "detail": "…" }
409Conflict — e.g. no active/materialized release for a project.{ "detail": "…" }
422Validation failed, or a BYOK key was rejected by the provider.{ "error": "byok_key_rejected", "provider": "…", "message": "…" }
503Service unavailable — harness down or breaker open.{ "detail": "…" } + Retry-After

402 — budget exhausted

When an org hits a budget cap, the data plane returns 402 before running the turn:
{ "error": "budget_exhausted", "reason": "monthly token cap reached" }

Errors during a stream

Once an SSE stream has started (200 already sent), failures arrive as an error event rather than an HTTP status — because the status line is already on the wire:
event: error
data: {"type":"error","data":{"code":"byok_key_rejected","provider":"anthropic","message":"invalid api key"}}
So a client must handle two failure channels: the HTTP status for pre-stream problems (auth, budget, validation), and error events for mid-stream problems (provider rejection, harness failure).

503 and retries

A 503 carries a Retry-After header. The data plane’s control-plane key validation fails closed on outages — repeated failures open a short circuit breaker and return 503 rather than letting unvalidated requests through. Back off and retry.