{"openapi":"3.1.0","info":{"title":"Coasty Public API","version":"1.0.0","summary":"Computer Use Agents, scheduled automation, and managed VMs.","description":"# Coasty Public API\n\nCoasty is a Computer Use Agent (CUA) platform: predict actions from screenshots,\nprovision managed VMs, and run scheduled automation against them.\n\n## Authentication\n\nAll endpoints (except `/v1/triggers/webhook/{webhook_id}` and health checks) require an API key.\nPass it as either:\n\n- `X-API-Key: sk-coasty-live-...` (or `sk-coasty-test-...` for sandbox)\n- `Authorization: Bearer sk-coasty-live-...`\n\nThe external webhook endpoint does not use an API key, but it is authenticated:\nsend the HMAC-SHA256 `Coasty-Signature` credential documented on that operation.\n\nTest-mode keys (`sk-coasty-test-*`) hit the same validation paths as live keys but\nreturn mock VMs / mock action results and never bill credits — ideal for CI.\n\n## Pricing & budgeting\n\nPer-call rates (subject to change — see `lib/pricing/tiers.ts METERED_RATES`):\n\n| Endpoint | Credits |\n|---|---|\n| `POST /v1/predict` | ~5 |\n| `POST /v1/sessions` | 10 |\n| `POST /v1/sessions/{id}/predict` | ~4 |\n| `POST /v1/ground` | ~3 |\n| `POST /v1/parse` | 0 (free) |\n\nLong-running CUA jobs orchestrated through the dashboard (not this API) bill at\n10 credits/minute with a 20-credit minimum. Subscription tiers (`free | starter |\nprofessional | enterprise`) gate feature availability (e.g. custom system prompts),\nschedule counts, and the maximum trajectory length.\n\n## Errors\n\nEvery error response uses the same envelope:\n\n```json\n{\n \"error\": {\n \"code\": \"INSUFFICIENT_CREDITS\",\n \"message\": \"Need 5, have 2.\",\n \"type\": \"billing_error\",\n \"request_id\": \"req_a1b2c3d4e5f6\",\n \"retryable\": false,\n \"retry_with_same_idempotency_key\": false\n }\n}\n```\n\nInclude the `request_id` in support requests.\n\n## Idempotency\n\nOperations marked `x-idempotency: reserve-and-replay` accept `Idempotency-Key:\n<≤128 chars of [A-Za-z0-9_-:]>`. Replays\nof the same key + identical body return the original response (with\n`X-Coasty-Idempotent-Replay: true`) for 24 h. Reusing the key with a different body\nis a 422 `IDEMPOTENCY_KEY_REUSED`.\nOperations marked `x-idempotency: webhook-payload-dedup` instead deduplicate the\nsame webhook id + identical raw body for 60 seconds; they do not accept an\nIdempotency-Key.\n\n## Clients & MCP\n\nUse the HTTP API directly from any language. Official TypeScript and Python SDKs\nare not currently published; generate a client from this OpenAPI document if needed.\n- MCP server: `npx -y @coasty/mcp` (see `x-mcp-server`)\n\n## Reference\n\nComplete (machine-readable) spec is hosted at `/.well-known/openapi.json` and\n`/openapi.json` (Stripe / Vercel conventions).","contact":{"name":"Coasty Developer Support","url":"https://coasty.ai/support","email":"founders@coasty.ai"},"license":{"name":"MIT","identifier":"MIT"},"termsOfService":"https://coasty.ai/terms"},"servers":[{"url":"https://coasty.ai","description":"Production"},{"url":"https://coasty.ai","description":"Sandbox — use sk-coasty-test-* keys against the same host. No billing, mock VMs."}],"security":[{"apiKey":[]},{"bearerAuth":[]}],"tags":[{"name":"predict","description":"Stateless CUA action prediction and grounding."},{"name":"sessions","description":"Stateful CUA sessions with persistent trajectory."},{"name":"machines","description":"Provision and control managed VMs."},{"name":"schedules","description":"Cron and one-shot scheduled CUA jobs."},{"name":"triggers","description":"Webhook and chain triggers for schedules."},{"name":"keys","description":"API key management and usage reporting."},{"name":"runs","description":"Autonomous task runs — the agent drives a task to completion on a machine."},{"name":"workflows","description":"Versioned, branching multi-step automations (DSL) and their runs."}],"paths":{"/v1/predict":{"post":{"tags":["predict"],"operationId":"predict","summary":"Stateless action prediction","description":"Send a screenshot + instruction; receive a list of structured actions to execute on the target machine. Costs ~5 credits/call (varies by CUA version, screenshot size, trajectory length). See lib/pricing/tiers.ts METERED_RATES for budgeting.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/XLLMProvider"},{"$ref":"#/components/parameters/XLLMApiKey"},{"$ref":"#/components/parameters/XLLMModel"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictRequest"},"example":{"screenshot":"","instruction":"Click the Sign In button","cua_version":"v5"}}}},"responses":{"200":{"description":"Predicted actions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictResponse"}},"text/event-stream":{"schema":{"type":"string"},"description":"SSE keepalive stream ending with a JSON result event. Request with Accept: text/event-stream."}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Remaining":{"$ref":"#/components/headers/CreditsRemaining"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"Idempotency-Replayed":{"$ref":"#/components/headers/IdempotencyReplayed"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"predict","x-required-scopes":["predict"],"x-scope-policy":"required","x-billing-code":"predict","x-offering":"cua","x-feature-flag":"PUBLIC_CUA_API_ENABLED","x-idempotency":"reserve-and-replay"}},"/v1/sessions":{"post":{"tags":["sessions"],"operationId":"createSession","summary":"Create a stateful CUA session","description":"Persistent session with a 2-hour (7200s) idle TTL, reset on each predict/reset; expires_at is returned. A predict/reset against an expired or unknown session is a 404 SESSION_NOT_FOUND. Maintains trajectory across predictions. Concurrent-session limits are tier- and deployment-configured; clients must handle 429 responses instead of hardcoding a tier limit.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/XLLMProvider"},{"$ref":"#/components/parameters/XLLMApiKey"},{"$ref":"#/components/parameters/XLLMModel"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionRequest"}}}},"responses":{"200":{"description":"Session created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Remaining":{"$ref":"#/components/headers/CreditsRemaining"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"Idempotency-Replayed":{"$ref":"#/components/headers/IdempotencyReplayed"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"session","x-required-scopes":["session"],"x-scope-policy":"required","x-billing-code":"session_create","x-offering":"cua","x-feature-flag":"PUBLIC_CUA_API_ENABLED","x-idempotency":"reserve-and-replay"},"get":{"tags":["sessions"],"operationId":"listSessions","summary":"List active sessions","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Active sessions for this key.","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/SessionInfoResponse"}}}}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Remaining":{"$ref":"#/components/headers/CreditsRemaining"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"Idempotency-Replayed":{"$ref":"#/components/headers/IdempotencyReplayed"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"session","x-required-scopes":["session"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"cua","x-feature-flag":"PUBLIC_CUA_API_ENABLED","x-idempotency":"none"}},"/v1/sessions/{session_id}":{"parameters":[{"$ref":"#/components/parameters/SessionId"}],"get":{"tags":["sessions"],"operationId":"getSession","summary":"Get session info","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Session info.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionInfoResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Remaining":{"$ref":"#/components/headers/CreditsRemaining"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"Idempotency-Replayed":{"$ref":"#/components/headers/IdempotencyReplayed"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"session","x-required-scopes":["session"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"cua","x-feature-flag":"PUBLIC_CUA_API_ENABLED","x-idempotency":"none"},"delete":{"tags":["sessions"],"operationId":"deleteSession","summary":"Delete a session","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionMutationResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Remaining":{"$ref":"#/components/headers/CreditsRemaining"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"Idempotency-Replayed":{"$ref":"#/components/headers/IdempotencyReplayed"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"session","x-required-scopes":["session"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"cua","x-feature-flag":"PUBLIC_CUA_API_ENABLED","x-idempotency":"none"}},"/v1/sessions/{session_id}/predict":{"parameters":[{"$ref":"#/components/parameters/SessionId"}],"post":{"tags":["sessions"],"operationId":"sessionPredict","summary":"Predict within an existing session","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionPredictRequest"}}}},"responses":{"200":{"description":"Predicted actions for the next step.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionPredictResponse"}},"text/event-stream":{"schema":{"type":"string"},"description":"SSE keepalive stream ending with a JSON result event. Request with Accept: text/event-stream."}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Remaining":{"$ref":"#/components/headers/CreditsRemaining"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"Idempotency-Replayed":{"$ref":"#/components/headers/IdempotencyReplayed"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"session","x-required-scopes":["session"],"x-scope-policy":"required","x-billing-code":"session_predict","x-offering":"cua","x-feature-flag":"PUBLIC_CUA_API_ENABLED","x-idempotency":"reserve-and-replay"}},"/v1/sessions/{session_id}/reset":{"parameters":[{"$ref":"#/components/parameters/SessionId"}],"post":{"tags":["sessions"],"operationId":"resetSession","summary":"Reset session state","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Reset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionMutationResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Remaining":{"$ref":"#/components/headers/CreditsRemaining"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"Idempotency-Replayed":{"$ref":"#/components/headers/IdempotencyReplayed"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"session","x-required-scopes":["session"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"cua","x-feature-flag":"PUBLIC_CUA_API_ENABLED","x-idempotency":"none"}},"/v1/ground":{"post":{"tags":["predict"],"operationId":"ground","summary":"Coordinate grounding","description":"Find (x, y) for a described UI element. ~3 credits/call.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroundRequest"}}}},"responses":{"200":{"description":"Grounded coordinates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroundResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Remaining":{"$ref":"#/components/headers/CreditsRemaining"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"Idempotency-Replayed":{"$ref":"#/components/headers/IdempotencyReplayed"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"ground","x-required-scopes":["ground"],"x-scope-policy":"required","x-billing-code":"ground","x-offering":"cua","x-feature-flag":"PUBLIC_CUA_API_ENABLED","x-idempotency":"reserve-and-replay"}},"/v1/parse":{"post":{"tags":["predict"],"operationId":"parse","summary":"Parse pyautogui code into structured actions","description":"Free, no LLM call. Returns structured Action objects.","security":[{"apiKey":[]},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParseRequest"}}}},"responses":{"200":{"description":"Parsed actions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParseResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Remaining":{"$ref":"#/components/headers/CreditsRemaining"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"Idempotency-Replayed":{"$ref":"#/components/headers/IdempotencyReplayed"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"parse","x-required-scopes":["parse"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"cua","x-feature-flag":"PUBLIC_CUA_API_ENABLED","x-idempotency":"none"}},"/v1/models":{"get":{"tags":["predict"],"operationId":"listModels","summary":"List available models, CUA versions, and action types","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Model catalog.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Remaining":{"$ref":"#/components/headers/CreditsRemaining"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"Idempotency-Replayed":{"$ref":"#/components/headers/IdempotencyReplayed"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":null,"x-required-scopes":[],"x-scope-policy":"none","x-billing-code":null,"x-offering":"cua","x-feature-flag":"PUBLIC_CUA_API_ENABLED","x-idempotency":"none"}},"/v1/usage":{"get":{"tags":["keys"],"operationId":"getUsage","summary":"Usage summary for a billing period","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","description":"ISO YYYY-MM with a real month 01..12 (defaults to current month)."}}],"responses":{"200":{"description":"Usage summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummaryResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Remaining":{"$ref":"#/components/headers/CreditsRemaining"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"Idempotency-Replayed":{"$ref":"#/components/headers/IdempotencyReplayed"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"usage","x-required-scopes":["usage"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"cua","x-feature-flag":"PUBLIC_CUA_API_ENABLED","x-idempotency":"none"}},"/v1/idempotency/{key}":{"parameters":[{"$ref":"#/components/parameters/IdempotencyKeyPath"}],"get":{"tags":["keys"],"operationId":"getIdempotencyResult","summary":"Fetch a result by Idempotency-Key","description":"Collect a prior mutating call's result by its Idempotency-Key alone (for clients that lost the original response). 'completed' returns the original body + original_status; 'processing' means it is still running; unknown/expired is 404.","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"The cached result (completed) or its in-flight status (processing).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdempotencyLookupResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"x-auth-mode":"api_key","x-required-scope":null,"x-required-scopes":[],"x-scope-policy":"none","x-billing-code":null,"x-offering":"idempotency","x-feature-flag":"PUBLIC_IDEMPOTENCY_API_ENABLED","x-idempotency":"none"}},"/v1/keys":{"post":{"tags":["keys"],"operationId":"createApiKey","summary":"Create an API key","description":"Returns the raw key ONCE. Subsequent reads only return the prefix.","security":[{"apiKey":[]},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAPIKeyRequest"}}}},"responses":{"200":{"description":"Key created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Remaining":{"$ref":"#/components/headers/CreditsRemaining"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"Idempotency-Replayed":{"$ref":"#/components/headers/IdempotencyReplayed"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"keys","x-required-scopes":["keys"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"cua","x-feature-flag":"PUBLIC_CUA_API_ENABLED","x-idempotency":"none"},"get":{"tags":["keys"],"operationId":"listApiKeys","summary":"List API keys","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Keys.","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/APIKeyListItem"}}}}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Remaining":{"$ref":"#/components/headers/CreditsRemaining"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"Idempotency-Replayed":{"$ref":"#/components/headers/IdempotencyReplayed"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"keys","x-required-scopes":["keys"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"cua","x-feature-flag":"PUBLIC_CUA_API_ENABLED","x-idempotency":"none"}},"/v1/keys/{key_id}":{"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}],"delete":{"tags":["keys"],"operationId":"revokeApiKey","summary":"Revoke an API key","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeAPIKeyResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Remaining":{"$ref":"#/components/headers/CreditsRemaining"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateReset"},"Idempotency-Replayed":{"$ref":"#/components/headers/IdempotencyReplayed"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"keys","x-required-scopes":["keys"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"cua","x-feature-flag":"PUBLIC_CUA_API_ENABLED","x-idempotency":"none"}},"/v1/llm/keys":{"get":{"tags":["keys"],"operationId":"listLlmKeys","summary":"List stored BYOK LLM keys","description":"Scope: `llm_keys` (granted to new live keys by default). Requires a live API key; sandbox keys cannot inspect the production credential store. Returns non-secret metadata only — provider, sha256-prefix fingerprint, timestamps. The key itself is never returned.","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Stored keys (non-secret metadata).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListLlmKeysResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"llm_keys","x-required-scopes":["llm_keys"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"llm_keys","x-feature-flag":"PUBLIC_LLM_KEYS_API_ENABLED","x-idempotency":"none"}},"/v1/llm/keys/{provider}":{"parameters":[{"name":"provider","in":"path","required":true,"description":"The BYOK provider: anthropic or openai. 'managed' has no storable key and any other value is 422 LLM_PROVIDER_UNSUPPORTED.","schema":{"type":"string","enum":["anthropic","openai"]}}],"put":{"tags":["keys"],"operationId":"storeLlmKey","summary":"Store (upsert) your own provider LLM key","description":"Scope: `llm_keys`. Requires a live API key; sandbox keys cannot modify the production credential store. Stores the caller's own Anthropic/OpenAI API key for BYOK, AES-256-GCM encrypted at rest. The plaintext key exists only in this request body; every response carries only the non-secret sha256-prefix `key_fingerprint` — the key is never returned, logged, or echoed again. Naturally idempotent (an upsert), so no Idempotency-Key is needed.","security":[{"apiKey":[]},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreLlmKeyRequest"},"example":{"api_key":"sk-ant-your_key_here"}}}},"responses":{"200":{"description":"Key stored (fingerprint only; the key is never returned again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreLlmKeyResponse"},"example":{"provider":"anthropic","key_fingerprint":"a1b2c3d4","stored":true}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"llm_keys","x-required-scopes":["llm_keys"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"llm_keys","x-feature-flag":"PUBLIC_LLM_KEYS_API_ENABLED","x-idempotency":"none"},"delete":{"tags":["keys"],"operationId":"deleteLlmKey","summary":"Delete your stored BYOK LLM key","description":"Scope: `llm_keys`. Requires a live API key; sandbox keys cannot modify the production credential store. Deletes the stored key for the provider — 404 LLM_KEY_NOT_FOUND when none exists. Schedules that opted into this provider then fail loudly at fire time with LLM_KEY_NOT_CONFIGURED; they never silently run on Coasty's platform keys.","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteLlmKeyResponse"},"example":{"deleted":true}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"llm_keys","x-required-scopes":["llm_keys"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"llm_keys","x-feature-flag":"PUBLIC_LLM_KEYS_API_ENABLED","x-idempotency":"none"}},"/v1/health":{"get":{"tags":["predict"],"operationId":"health","summary":"Public CUA API health check","description":"No authentication required.","security":[],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}},"x-auth-mode":"public","x-required-scope":null,"x-required-scopes":[],"x-scope-policy":"none","x-billing-code":null,"x-offering":"cua","x-feature-flag":null,"x-idempotency":"none"}},"/v1/machines":{"post":{"tags":["machines"],"operationId":"provisionMachine","summary":"Provision a new VM","description":"Managed VM provisioning. Linux defaults are cheap (1 cpu / 2 GB / 10 GB) and bill at agent-minute rates. Test keys (sk-coasty-test-*) return mock VMs with no cloud calls.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionRequest"}}}},"responses":{"200":{"description":"Machine provisioned (or in-progress).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"machines:write","x-required-scopes":["machines:write"],"x-scope-policy":"required","x-billing-code":"machine_runtime","x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"reserve-and-replay"},"get":{"tags":["machines"],"operationId":"listMachines","summary":"List machines","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Machines list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMachinesResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"machines:read","x-required-scopes":["machines:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"none"}},"/v1/machines/health":{"get":{"tags":["machines"],"operationId":"machinesHealth","summary":"Machines API health check","security":[],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}},"x-auth-mode":"public","x-required-scope":null,"x-required-scopes":[],"x-scope-policy":"none","x-billing-code":null,"x-offering":"machines","x-feature-flag":null,"x-idempotency":"none"}},"/v1/machines/pricing":{"get":{"tags":["machines"],"operationId":"getMachinePricing","summary":"Get the live machine runtime rate card","description":"Scope: `machines:read`. Returns runtime rates, one-time charges, billing granularity, insufficient-funds behavior, and TTL bounds.","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Current machine pricing and lease policy.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MachinePricingResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"machines:read","x-required-scopes":["machines:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"none"}},"/v1/billing/active":{"get":{"tags":["machines"],"operationId":"getActiveBilling","summary":"What is billing me right now","description":"Lists every API-billed machine currently metering your wallet (running OR stopped — stopped bills at the storage-only rate). current_run_rate_cents_per_hour is the summed instantaneous burn rate. Test-mode keys return an empty fleet (active: [], rate 0). 1 credit = 1 cent.","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Currently-metering fleet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingActiveResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"machines:read","x-required-scopes":["machines:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"billing","x-feature-flag":"PUBLIC_BILLING_API_ENABLED","x-idempotency":"none"}},"/v1/machines/{machine_id}":{"parameters":[{"$ref":"#/components/parameters/MachineId"}],"get":{"tags":["machines"],"operationId":"getMachine","summary":"Get machine details","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Machine.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMachineResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"machines:read","x-required-scopes":["machines:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"none"},"delete":{"tags":["machines"],"operationId":"terminateMachine","summary":"Terminate a machine","description":"Irreversible. Stops billing the agent-minute rate.","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Termination requested.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"machines:write","x-required-scopes":["machines:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"none"},"patch":{"tags":["machines"],"operationId":"updateMachine","summary":"Set, extend, or clear a machine auto-destroy lease","description":"Scope: `machines:write`. `ttl_minutes=0` clears auto-destroy; values 5..10080 schedule termination from now.","security":[{"apiKey":[]},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMachineRequest"}}}},"responses":{"200":{"description":"Updated lease.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMachineResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"machines:write","x-required-scopes":["machines:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"none"}},"/v1/machines/{machine_id}/start":{"parameters":[{"$ref":"#/components/parameters/MachineId"}],"post":{"tags":["machines"],"operationId":"startMachine","summary":"Start a stopped machine","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Started.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"machines:write","x-required-scopes":["machines:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"none"}},"/v1/machines/{machine_id}/stop":{"parameters":[{"$ref":"#/components/parameters/MachineId"}],"post":{"tags":["machines"],"operationId":"stopMachine","summary":"Stop a running machine","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Stopped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"machines:write","x-required-scopes":["machines:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"none"}},"/v1/machines/{machine_id}/restart":{"parameters":[{"$ref":"#/components/parameters/MachineId"}],"post":{"tags":["machines"],"operationId":"restartMachine","summary":"Restart a running machine","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Restart requested.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"machines:write","x-required-scopes":["machines:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"none"}},"/v1/machines/{machine_id}/snapshot":{"parameters":[{"$ref":"#/components/parameters/MachineId"}],"post":{"tags":["machines"],"operationId":"snapshotMachine","summary":"Snapshot a machine","description":"Captures a restorable machine image. Requires `snapshots:write`. The configured one-time fee is charged before dispatch. A conclusive pre-creation rejection is refunded; a timeout, 5xx, or malformed post-dispatch result may already have created the image and returns terminal 503 SNAPSHOT_OUTCOME_UNKNOWN without a blind refund/re-execution.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Snapshot created.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SnapshotResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"snapshots:write","x-required-scopes":["snapshots:write"],"x-scope-policy":"required","x-billing-code":"snapshot","x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"reserve-and-replay"}},"/v1/machines/{machine_id}/screenshot":{"parameters":[{"$ref":"#/components/parameters/MachineId"}],"get":{"tags":["machines"],"operationId":"getScreenshot","summary":"Capture a screenshot of the machine","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Screenshot.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreenshotResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"machines:read","x-required-scopes":["machines:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"none"}},"/v1/machines/{machine_id}/connection":{"parameters":[{"$ref":"#/components/parameters/MachineId"}],"get":{"tags":["machines"],"operationId":"getConnectionDetails","summary":"Get SSH key + VNC password (HIGH-RISK)","description":"Returns plaintext credentials. Gated by `connection:read` scope. Response is `Cache-Control: no-store`. Store credentials in a secrets manager — Coasty cannot re-issue them; rotate by terminating + reprovisioning.","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Connection details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionDetailsFull"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"connection:read","x-required-scopes":["connection:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"none"}},"/v1/machines/{machine_id}/actions":{"parameters":[{"$ref":"#/components/parameters/MachineId"}],"post":{"tags":["machines"],"operationId":"executeAction","summary":"Execute a single action on the machine","description":"Required scope varies by command: terminal_* → `terminal:exec`; file_* → `files:read|write`; browser_execute → `browser:execute`; everything else → `actions:exec`. See the ActionRequest command enum and /v1/models for current capabilities.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionRequest"}}}},"responses":{"200":{"description":"Action result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionResultResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"per-command","x-required-scopes":["actions:exec","terminal:exec","files:read","files:write","browser:execute"],"x-scope-policy":"dynamic","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"reserve-and-replay"}},"/v1/machines/{machine_id}/actions/batch":{"parameters":[{"$ref":"#/components/parameters/MachineId"}],"post":{"tags":["machines"],"operationId":"executeBatch","summary":"Execute up to 50 sequential actions","description":"Shell `&&`-style semantics: aborts on first failure when `stop_on_error=true` (default).","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchActionRequest"}}}},"responses":{"200":{"description":"Per-step results.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchActionResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"union-of-command-scopes","x-required-scopes":["actions:exec","terminal:exec","files:read","files:write","browser:execute"],"x-scope-policy":"dynamic","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"reserve-and-replay"}},"/v1/machines/{machine_id}/browser/{op}":{"parameters":[{"$ref":"#/components/parameters/MachineId"},{"name":"op","in":"path","required":true,"description":"Browser sub-op. One of: open, navigate, click, type, dom, clickables, state, info, scroll, close, screenshot, wait, list-tabs, open-tab, close-tab, switch-tab.","schema":{"type":"string","enum":["open","navigate","click","type","dom","clickables","state","info","scroll","close","screenshot","wait","list-tabs","open-tab","close-tab","switch-tab"]}}],"post":{"tags":["machines"],"operationId":"browserOp","summary":"Browser convenience sub-API","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrowserOpRequest"}}}},"responses":{"200":{"description":"Browser action result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionResultResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"actions:exec","x-required-scopes":["actions:exec"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"reserve-and-replay"}},"/v1/machines/{machine_id}/terminal":{"parameters":[{"$ref":"#/components/parameters/MachineId"}],"post":{"tags":["machines"],"operationId":"terminalExec","summary":"Execute a shell command","description":"Output truncated VM-side to 5000 chars. Hard cap 120s (Cloudflare edge timeout). Requires `terminal:exec` scope.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TerminalRequest"}}}},"responses":{"200":{"description":"Terminal output.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionResultResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"terminal:exec","x-required-scopes":["terminal:exec"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"reserve-and-replay"}},"/v1/machines/{machine_id}/files/{op}":{"parameters":[{"$ref":"#/components/parameters/MachineId"},{"name":"op","in":"path","required":true,"description":"File sub-op. Read scope: read, exists, list, list-directory, download, list-downloads. Write scope: write, edit, append, delete, delete-directory.","schema":{"type":"string","enum":["read","exists","list","list-directory","download","list-downloads","write","edit","append","delete","delete-directory"]}}],"post":{"tags":["machines"],"operationId":"filesOp","summary":"File operations sub-API","description":"Read ops require `files:read`; mutating ops require `files:write`. Body capped at 50 MB.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilesOpRequest"}}}},"responses":{"200":{"description":"File op result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionResultResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"files:read-or-files:write","x-required-scopes":["files:read","files:write"],"x-scope-policy":"dynamic","x-billing-code":null,"x-offering":"machines","x-feature-flag":"PUBLIC_MACHINES_API_ENABLED","x-idempotency":"reserve-and-replay"}},"/v1/schedules":{"post":{"tags":["schedules"],"operationId":"createSchedule","summary":"Create a schedule","description":"Cron-based or one-shot (run_at) scheduled task. Schedule-count limits are tier- and deployment-configured; clients must handle the structured limit response rather than hardcoding plan values. BYOK: schedules store only the non-secret llm preference; at fire time the CURRENT stored key is used — if it was deleted, firings fail loudly with LLM_KEY_NOT_CONFIGURED instead of silently running on platform keys.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/XLLMProvider"},{"$ref":"#/components/parameters/XLLMApiKey"},{"$ref":"#/components/parameters/XLLMModel"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleCreateRequest"}}}},"responses":{"200":{"description":"Schedule created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"schedules:write","x-required-scopes":["schedules:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"schedules","x-feature-flag":"PUBLIC_SCHEDULES_API_ENABLED","x-idempotency":"reserve-and-replay"},"get":{"tags":["schedules"],"operationId":"listSchedules","summary":"List schedules","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Schedules.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSchedulesResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"schedules:read","x-required-scopes":["schedules:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"schedules","x-feature-flag":"PUBLIC_SCHEDULES_API_ENABLED","x-idempotency":"none"}},"/v1/schedules/health":{"get":{"tags":["schedules"],"operationId":"schedulesHealth","summary":"Schedules API health check","security":[],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}},"x-auth-mode":"public","x-required-scope":null,"x-required-scopes":[],"x-scope-policy":"none","x-billing-code":null,"x-offering":"schedules","x-feature-flag":null,"x-idempotency":"none"}},"/v1/schedules/{schedule_id}":{"parameters":[{"$ref":"#/components/parameters/ScheduleId"}],"get":{"tags":["schedules"],"operationId":"getSchedule","summary":"Get schedule details","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Schedule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"schedules:read","x-required-scopes":["schedules:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"schedules","x-feature-flag":"PUBLIC_SCHEDULES_API_ENABLED","x-idempotency":"none"},"patch":{"tags":["schedules"],"operationId":"updateSchedule","summary":"Update a schedule","security":[{"apiKey":[]},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleUpdateRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"schedules:write","x-required-scopes":["schedules:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"schedules","x-feature-flag":"PUBLIC_SCHEDULES_API_ENABLED","x-idempotency":"none"},"delete":{"tags":["schedules"],"operationId":"deleteSchedule","summary":"Delete a schedule","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteScheduleResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"schedules:write","x-required-scopes":["schedules:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"schedules","x-feature-flag":"PUBLIC_SCHEDULES_API_ENABLED","x-idempotency":"none"}},"/v1/schedules/{schedule_id}/pause":{"parameters":[{"$ref":"#/components/parameters/ScheduleId"}],"post":{"tags":["schedules"],"operationId":"pauseSchedule","summary":"Pause a schedule","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Paused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"schedules:write","x-required-scopes":["schedules:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"schedules","x-feature-flag":"PUBLIC_SCHEDULES_API_ENABLED","x-idempotency":"none"}},"/v1/schedules/{schedule_id}/resume":{"parameters":[{"$ref":"#/components/parameters/ScheduleId"}],"post":{"tags":["schedules"],"operationId":"resumeSchedule","summary":"Resume a paused schedule","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Resumed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"schedules:write","x-required-scopes":["schedules:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"schedules","x-feature-flag":"PUBLIC_SCHEDULES_API_ENABLED","x-idempotency":"none"}},"/v1/schedules/{schedule_id}/run":{"parameters":[{"$ref":"#/components/parameters/ScheduleId"}],"post":{"tags":["schedules"],"operationId":"runScheduleNow","summary":"Trigger a schedule run immediately","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunScheduleRequest"}}}},"responses":{"200":{"description":"Run queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunScheduleResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"schedules:write","x-required-scopes":["schedules:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"schedules","x-feature-flag":"PUBLIC_SCHEDULES_API_ENABLED","x-idempotency":"reserve-and-replay"}},"/v1/schedules/{schedule_id}/runs":{"parameters":[{"$ref":"#/components/parameters/ScheduleId"}],"get":{"tags":["schedules"],"operationId":"listScheduleRuns","summary":"List historical runs of a schedule","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["running","completed","failed","skipped","cancelled","insufficient_credits"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Runs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListScheduleRunsResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"schedules:read","x-required-scopes":["schedules:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"schedules","x-feature-flag":"PUBLIC_SCHEDULES_API_ENABLED","x-idempotency":"none"}},"/v1/schedules/{schedule_id}/runs/{run_id}":{"parameters":[{"$ref":"#/components/parameters/ScheduleId"},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_\\-]+$"}}],"get":{"tags":["schedules"],"operationId":"getScheduleRun","summary":"Get a single run","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleRunRecord"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"schedules:read","x-required-scopes":["schedules:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"schedules","x-feature-flag":"PUBLIC_SCHEDULES_API_ENABLED","x-idempotency":"none"}},"/v1/schedules/{schedule_id}/triggers":{"parameters":[{"$ref":"#/components/parameters/ScheduleId"}],"get":{"tags":["triggers"],"operationId":"listTriggers","summary":"List triggers attached to a schedule","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Triggers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTriggersResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"schedules:read","x-required-scopes":["schedules:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"schedules","x-feature-flag":"PUBLIC_SCHEDULES_API_ENABLED","x-idempotency":"none"},"post":{"tags":["triggers"],"operationId":"addTrigger","summary":"Add a trigger (webhook | chain)","description":"For `webhook`, the response includes a one-time HMAC `webhook_secret` — store it now or rotate the trigger. Chain triggers support a max depth of 5.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerCreateRequest"}}}},"responses":{"200":{"description":"Trigger created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"triggers:write","x-required-scopes":["triggers:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"schedules","x-feature-flag":"PUBLIC_SCHEDULES_API_ENABLED","x-idempotency":"reserve-and-replay"}},"/v1/schedules/{schedule_id}/triggers/{trigger_id}":{"parameters":[{"$ref":"#/components/parameters/ScheduleId"},{"$ref":"#/components/parameters/TriggerId"}],"delete":{"tags":["triggers"],"operationId":"removeTrigger","summary":"Remove a trigger","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Removed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteTriggerResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"triggers:write","x-required-scopes":["triggers:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"schedules","x-feature-flag":"PUBLIC_SCHEDULES_API_ENABLED","x-idempotency":"none"}},"/v1/triggers/webhook/{webhook_id}":{"parameters":[{"$ref":"#/components/parameters/WebhookId"}],"post":{"tags":["triggers"],"operationId":"fireWebhook","summary":"Fire a schedule from an HMAC-authenticated external webhook","description":"No Coasty API key is used. The request is authenticated with HMAC-SHA256 over `.` using the secret from trigger creation. Send either `Coasty-Signature: t=,v1=` or its `X-Coasty-Signature` compatibility alias. Replay window 5 minutes. Body capped at 1 MB. Repeated identical (webhook_id, body) within 60s are deduped.","security":[{"webhookHmac":[]},{"webhookHmacLegacy":[]}],"parameters":[{"name":"Coasty-Signature","in":"header","required":false,"description":"Primary HMAC credential. Exactly one supported signature header is required.","schema":{"type":"string","examples":["t=1714900000,v1=4d2f...e7"]}},{"name":"X-Coasty-Signature","in":"header","required":false,"description":"Compatibility alias for Coasty-Signature. Send one signature header, not both.","schema":{"type":"string","examples":["t=1714900000,v1=4d2f...e7"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}},"text/plain":{"schema":{"type":"string"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"Webhook accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookFireResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"description":"Body exceeds 1 MB.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}},"429":{"description":"Webhook per-minute rate limit exceeded. Honor Retry-After.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"RATE_LIMITED","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth-mode":"hmac_sha256","x-required-scope":null,"x-required-scopes":[],"x-scope-policy":"none","x-billing-code":null,"x-offering":"triggers","x-feature-flag":"PUBLIC_TRIGGERS_API_ENABLED","x-idempotency":"webhook-payload-dedup"}},"/v1/triggers/health":{"get":{"tags":["triggers"],"operationId":"triggersHealth","summary":"Triggers API health check","security":[],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}},"x-auth-mode":"public","x-required-scope":null,"x-required-scopes":[],"x-scope-policy":"none","x-billing-code":null,"x-offering":"triggers","x-feature-flag":null,"x-idempotency":"none"}},"/v1/runs":{"post":{"tags":["runs"],"operationId":"createRun","summary":"Start an autonomous run","description":"Scope: `runs:write`. Drives `task` to completion on `machine_id`, running the screenshot→act→verify loop server-side. Each agent step bills at the /v1/predict rate (~5 credits/step, scales with cua_version); a 402 is returned up front if the wallet cannot afford one step. Test keys (sk-coasty-test-*) never bill. `webhook_secret` is returned ONCE. BYOK: opt in via the body `llm` block or the X-LLM-* headers and every LLM call runs on YOUR provider key; the key is snapshotted encrypted for crash-recovery and scrubbed at terminal state.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/XLLMProvider"},{"$ref":"#/components/parameters/XLLMApiKey"},{"$ref":"#/components/parameters/XLLMModel"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunRequest"}}}},"responses":{"200":{"description":"Run created (status \"queued\").","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"runs:write","x-required-scopes":["runs:write"],"x-scope-policy":"required","x-billing-code":"run_step","x-offering":"runs","x-feature-flag":"RUNS_API_ENABLED","x-idempotency":"reserve-and-replay"},"get":{"tags":["runs"],"operationId":"listRuns","summary":"List runs","description":"Scope: `runs:read`. Free. Optional `status` filter and `limit` (1-200, default 20).","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["queued","running","awaiting_human","succeeded","failed","cancelled","timed_out"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":20}}],"responses":{"200":{"description":"A list of runs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRunsResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"runs:read","x-required-scopes":["runs:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"runs","x-feature-flag":"RUNS_API_ENABLED","x-idempotency":"none"}},"/v1/runs/{run_id}":{"parameters":[{"$ref":"#/components/parameters/RunId"}],"get":{"tags":["runs"],"operationId":"getRun","summary":"Get a run","description":"Scope: `runs:read`. Free. Returns status, result, and credits charged.","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"The run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"runs:read","x-required-scopes":["runs:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"runs","x-feature-flag":"RUNS_API_ENABLED","x-idempotency":"none"}},"/v1/runs/{run_id}/events":{"parameters":[{"$ref":"#/components/parameters/RunId"}],"get":{"tags":["runs"],"operationId":"streamRunEvents","summary":"Stream run events (SSE)","description":"Scope: `runs:read`. Free. A durable Server-Sent Events stream. Resume with the `Last-Event-ID` header or `?after=`. The edge may rotate a connection after 300 seconds, so reconnect with the last sequence until a terminal `done` event arrives.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/LastEventId"},{"name":"after","in":"query","required":false,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"SSE stream (text/event-stream).","content":{"text/event-stream":{"schema":{"type":"string"},"description":"A Server-Sent Events byte stream. Each frame carries an event name/id and JSON in its data field; reconnect with Last-Event-ID."}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"runs:read","x-required-scopes":["runs:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"runs","x-feature-flag":"RUNS_API_ENABLED","x-idempotency":"none"}},"/v1/runs/{run_id}/cancel":{"parameters":[{"$ref":"#/components/parameters/RunId"}],"post":{"tags":["runs"],"operationId":"cancelRun","summary":"Cancel a run","description":"Scope: `runs:write`. Free. Cancels an in-flight run.","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"The cancelled run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"runs:write","x-required-scopes":["runs:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"runs","x-feature-flag":"RUNS_API_ENABLED","x-idempotency":"none"}},"/v1/runs/{run_id}/resume":{"parameters":[{"$ref":"#/components/parameters/RunId"}],"post":{"tags":["runs"],"operationId":"resumeRun","summary":"Resume a run after human takeover","description":"Scope: `runs:write`. Free. Resumes a run paused in `awaiting_human`. Body is optional.","security":[{"apiKey":[]},{"bearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeRunRequest"}}}},"responses":{"200":{"description":"The resumed run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"runs:write","x-required-scopes":["runs:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"runs","x-feature-flag":"RUNS_API_ENABLED","x-idempotency":"none"}},"/v1/workflows":{"post":{"tags":["workflows"],"operationId":"createWorkflow","summary":"Create a workflow","description":"Scope: `workflows:write`. Free (definition only). Creates a versioned workflow from a DSL `definition`.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCreateRequest"}}}},"responses":{"200":{"description":"The created workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"workflows:write","x-required-scopes":["workflows:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"workflows","x-feature-flag":"WORKFLOWS_API_ENABLED","x-idempotency":"reserve-and-replay"},"get":{"tags":["workflows"],"operationId":"listWorkflows","summary":"List workflows","description":"Scope: `workflows:read`. Free. `limit` 1-200 (default 20).","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":20}}],"responses":{"200":{"description":"A list of workflows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWorkflowsResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"workflows:read","x-required-scopes":["workflows:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"workflows","x-feature-flag":"WORKFLOWS_API_ENABLED","x-idempotency":"none"}},"/v1/workflows/runs":{"post":{"tags":["workflows"],"operationId":"startAdhocWorkflowRun","summary":"Start an ad-hoc workflow run","description":"Scope: `workflows:write`. Runs an inline `definition` without saving it. Each `task` step bills at the /v1/predict rate under the optional `budget_cents` cap; other step types are free. Test keys never bill. `webhook_secret` is returned ONCE.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartWorkflowRunRequest"}}}},"responses":{"200":{"description":"The started workflow run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"workflows:write","x-required-scopes":["workflows:write"],"x-scope-policy":"required","x-billing-code":"run_step","x-offering":"workflows","x-feature-flag":"WORKFLOWS_API_ENABLED","x-idempotency":"reserve-and-replay"},"get":{"tags":["workflows"],"operationId":"listWorkflowRuns","summary":"List workflow runs","description":"Scope: `workflows:read`. Free. Optional `workflow_id` filter and `limit` (1-200, default 20).","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"name":"workflow_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":20}}],"responses":{"200":{"description":"A list of workflow runs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWorkflowRunsResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"workflows:read","x-required-scopes":["workflows:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"workflows","x-feature-flag":"WORKFLOWS_API_ENABLED","x-idempotency":"none"}},"/v1/workflows/runs/{run_id}":{"parameters":[{"$ref":"#/components/parameters/RunId"}],"get":{"tags":["workflows"],"operationId":"getWorkflowRun","summary":"Get a workflow run","description":"Scope: `workflows:read`. Free.","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"The workflow run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"workflows:read","x-required-scopes":["workflows:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"workflows","x-feature-flag":"WORKFLOWS_API_ENABLED","x-idempotency":"none"}},"/v1/workflows/runs/{run_id}/events":{"parameters":[{"$ref":"#/components/parameters/RunId"}],"get":{"tags":["workflows"],"operationId":"streamWorkflowRunEvents","summary":"Stream workflow run events (SSE)","description":"Scope: `workflows:read`. Free. Durable SSE stream; resume with `Last-Event-ID` or `?after=`. The edge may rotate a connection after 300 seconds, so reconnect with the last sequence until the terminal event arrives.","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/LastEventId"},{"name":"after","in":"query","required":false,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"SSE stream (text/event-stream).","content":{"text/event-stream":{"schema":{"type":"string"},"description":"A Server-Sent Events byte stream. Each frame carries an event name/id and JSON in its data field; reconnect with Last-Event-ID."}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"workflows:read","x-required-scopes":["workflows:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"workflows","x-feature-flag":"WORKFLOWS_API_ENABLED","x-idempotency":"none"}},"/v1/workflows/runs/{run_id}/cancel":{"parameters":[{"$ref":"#/components/parameters/RunId"}],"post":{"tags":["workflows"],"operationId":"cancelWorkflowRun","summary":"Cancel a workflow run","description":"Scope: `workflows:write`. Free.","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"The cancelled workflow run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"workflows:write","x-required-scopes":["workflows:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"workflows","x-feature-flag":"WORKFLOWS_API_ENABLED","x-idempotency":"none"}},"/v1/workflows/runs/{run_id}/resume":{"parameters":[{"$ref":"#/components/parameters/RunId"}],"post":{"tags":["workflows"],"operationId":"resumeWorkflowRun","summary":"Approve or reject a paused workflow run","description":"Scope: `workflows:write`. Free. Approves (continues) or rejects (fails) a run paused on a `human_approval` step.","security":[{"apiKey":[]},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeWorkflowRunRequest"}}}},"responses":{"200":{"description":"The resumed workflow run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"workflows:write","x-required-scopes":["workflows:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"workflows","x-feature-flag":"WORKFLOWS_API_ENABLED","x-idempotency":"none"}},"/v1/workflows/{workflow_id}":{"parameters":[{"$ref":"#/components/parameters/WorkflowId"}],"get":{"tags":["workflows"],"operationId":"getWorkflow","summary":"Get a workflow","description":"Scope: `workflows:read`. Free.","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"The workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"workflows:read","x-required-scopes":["workflows:read"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"workflows","x-feature-flag":"WORKFLOWS_API_ENABLED","x-idempotency":"none"},"put":{"tags":["workflows"],"operationId":"updateWorkflow","summary":"Update a workflow","description":"Scope: `workflows:write`. Free. Bumps the workflow `version`.","security":[{"apiKey":[]},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowUpdateRequest"}}}},"responses":{"200":{"description":"The updated workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"workflows:write","x-required-scopes":["workflows:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"workflows","x-feature-flag":"WORKFLOWS_API_ENABLED","x-idempotency":"none"},"delete":{"tags":["workflows"],"operationId":"deleteWorkflow","summary":"Archive a workflow","description":"Scope: `workflows:write`. Free. Archives the workflow.","security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Deletion acknowledged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowDeleteResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"workflows:write","x-required-scopes":["workflows:write"],"x-scope-policy":"required","x-billing-code":null,"x-offering":"workflows","x-feature-flag":"WORKFLOWS_API_ENABLED","x-idempotency":"none"}},"/v1/workflows/{workflow_id}/runs":{"parameters":[{"$ref":"#/components/parameters/WorkflowId"}],"post":{"tags":["workflows"],"operationId":"startWorkflowRun","summary":"Start a run of a saved workflow","description":"Scope: `workflows:write`. Runs the saved workflow. Each `task` step bills at the /v1/predict rate under the optional `budget_cents` cap; other steps are free. Test keys never bill. `webhook_secret` is returned ONCE. BYOK: opt in via the body `llm` block or the X-LLM-* headers to run every task step's LLM calls on YOUR provider key (no silent fallback).","security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/XLLMProvider"},{"$ref":"#/components/parameters/XLLMApiKey"},{"$ref":"#/components/parameters/XLLMModel"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartWorkflowRunRequest"}}}},"responses":{"200":{"description":"The started workflow run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunResponse"}}},"headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"X-Coasty-Key-Kind":{"$ref":"#/components/headers/KeyKind"},"X-Coasty-Test-Mode":{"$ref":"#/components/headers/TestMode"},"X-Coasty-Idempotent-Replay":{"$ref":"#/components/headers/IdempotentReplay"},"Idempotency-Status":{"$ref":"#/components/headers/IdempotencyStatus"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}},"x-auth-mode":"api_key","x-required-scope":"workflows:write","x-required-scopes":["workflows:write"],"x-scope-policy":"required","x-billing-code":"run_step","x-offering":"workflows","x-feature-flag":"WORKFLOWS_API_ENABLED","x-idempotency":"reserve-and-replay"}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"X-API-Key","in":"header","description":"Coasty API key. Live: `sk-coasty-live-...`. Sandbox: `sk-coasty-test-...`."},"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Coasty API key (sk-coasty-{live,test}-...)","description":"Equivalent to X-API-Key. Use whichever your client supports."},"webhookHmac":{"type":"apiKey","name":"Coasty-Signature","in":"header","description":"HMAC-SHA256 credential for external schedule webhooks: t=,v1=."},"webhookHmacLegacy":{"type":"apiKey","name":"X-Coasty-Signature","in":"header","description":"Compatibility alias for the Coasty-Signature HMAC credential."}},"schemas":{"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","type","retryable","retry_with_same_idempotency_key","request_id"],"properties":{"code":{"type":"string","description":"Stable machine-readable error code (e.g. INVALID_API_KEY, INSUFFICIENT_CREDITS).","examples":["INVALID_API_KEY"]},"message":{"type":"string","description":"Human-readable explanation. May include suggestions or examples."},"type":{"type":"string","enum":["auth_error","validation_error","rate_limit_error","billing_error","not_found_error","state_error","server_error","client_error"]},"request_id":{"type":"string","description":"Server-assigned correlation ID. Include in support requests.","examples":["req_a1b2c3d4e5f6"]},"suggestion":{"type":"string","description":"A concrete next step, auto-filled per code. LLM agents can act on it to self-recover."},"retryable":{"type":"boolean","description":"true when retrying the same call may succeed (transient server failures + back-pressure: INTERNAL_ERROR, DB_UNAVAILABLE, SERVICE_UNAVAILABLE, UPSTREAM_*, PREDICTION_FAILED, *_FAILED, RATE_LIMITED, TOO_MANY_RUNS, IDEMPOTENCY_IN_FLIGHT, ...). false for deterministic client errors. A CUA BILLING_UNAVAILABLE caused by refund uncertainty is false unless the server confirmed a shared recovery checkpoint. Present on EVERY error envelope, including gateway/5xx/timeout paths."},"retry_with_same_idempotency_key":{"type":"boolean","description":"true only when the concrete response permits replay, the original operation is one of the exact 18 reserve-and-replay operations, and that original request already carried the key. Reuse that SAME key and identical body. A retryable error alone does not make an operation idempotent, and a key cannot be added retroactively. For CUA refund uncertainty this is true only after an exact shared checkpoint was confirmed; unkeyed or uncheckpointed responses are false and must not be retried automatically. A confirmed refunded failure sets this false even when retryable remains true: use a new key, because the old debit is compensated and wallet-guarded by IDEMPOTENCY_ALREADY_REFUNDED. false for deterministic errors."},"retry_after":{"type":["integer","null"],"description":"Seconds to wait before retrying (accompanies retryable:true back-pressure codes; mirrors the Retry-After header)."},"examples":{"type":"object","additionalProperties":true,"description":"Machine-readable limits for self-correction. On PAYLOAD_TOO_LARGE / INVALID_SCREENSHOT: { max_base64_bytes: 10485760, max_mb: 10, min_base64_chars: 100, formats: [\"png\",\"jpeg\"] }."}}}}},"IdempotencyLookupResponse":{"type":"object","required":["status","request_id"],"description":"Result of GET /v1/idempotency/{key}. 'completed' returns the original response body + original_status; 'processing' means the original is still running; an unknown/expired key is a 404 NOT_FOUND.","properties":{"status":{"type":"string","enum":["completed","processing"],"description":"completed = a cached result is included; processing = the original is still executing."},"request_id":{"type":"string"},"result":{"anyOf":[{"description":"The original response body, verbatim. Present only when status is 'completed'."},{"type":"null"}]},"original_status":{"type":["integer","null"],"description":"The HTTP status the original response returned (e.g. 200). Present only when status is 'completed'."}}},"ActionResponse":{"type":"object","required":["action_type"],"additionalProperties":false,"properties":{"action_type":{"type":"string","enum":["click","type_text","key_press","key_combo","scroll","drag","move","wait","done","fail"]},"params":{"type":"object","additionalProperties":true},"description":{"type":"string"},"raw_code":{"type":"string"}}},"UsageInfo":{"type":"object","properties":{"input_tokens":{"type":"integer","default":0},"output_tokens":{"type":"integer","default":0},"credits_charged":{"type":"integer","default":0},"cost_cents":{"type":"integer","default":0,"description":"USD cost in cents (credits_charged * $0.01)."},"breakdown":{"type":["array","null"],"description":"Self-auditable per-call cost breakdown; line credits sum to credits_charged. null on free/test/no-charge calls and /v1/parse.","items":{"type":"object","required":["item","credits"],"properties":{"item":{"type":"string","enum":["base","trajectory","hd_images","engine","custom_prompt"]},"credits":{"type":"integer"},"count":{"type":["integer","null"],"description":"Optional multiplier (e.g. number of HD screenshots billed); omitted where it adds nothing."}}}},"billed":{"type":"boolean","description":"true on a real billed call; false on test keys (sk-coasty-test-*) and on idempotent replays (which return credits_charged: 0)."}}},"TrajectoryStep":{"type":"object","required":["screenshot"],"additionalProperties":false,"properties":{"screenshot":{"type":"string","minLength":100,"maxLength":10485760,"pattern":"^[A-Za-z0-9+/=]+$","description":"Base64-encoded PNG/JPEG screenshot."},"actions":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/ActionResponse"}},"reasoning":{"type":"string","maxLength":16000}}},"PredictRequest":{"type":"object","required":["screenshot","instruction"],"additionalProperties":false,"properties":{"screenshot":{"type":"string","minLength":100,"maxLength":10485760,"pattern":"^[A-Za-z0-9+/=]+$","description":"Base64-encoded PNG/JPEG screenshot. Min 100 chars."},"instruction":{"type":"string","minLength":1,"maxLength":32000,"description":"Natural-language task instruction."},"cua_version":{"type":"string","enum":["v1","v3","v4","v5"],"default":"v5","description":"v1 = baseline (single action, reflection, 8-step trajectory, 9-10s). v3 = lean (multi-action, no reflection, 3.5-4s). v4 = autonomous + verifier. v5 = latest (default): autonomous + verifier with improved grounding and recovery."},"model":{"type":["string","null"],"minLength":1,"maxLength":512},"system_prompt":{"type":["string","null"],"maxLength":16000},"instructions":{"type":["string","null"],"maxLength":16000},"screen_width":{"type":["integer","null"],"minimum":320,"maximum":3840,"description":"Omit to use the screenshot's true size (measured server-side); no longer defaults to 1920."},"screen_height":{"type":["integer","null"],"minimum":240,"maximum":2160,"description":"Omit to use the screenshot's true size (measured server-side); no longer defaults to 1080."},"trajectory":{"type":"array","maxItems":20,"items":{"$ref":"#/components/schemas/TrajectoryStep"}},"max_actions":{"type":"integer","minimum":1,"maximum":10,"default":5},"tools":{"type":["array","null"],"minItems":1,"maxItems":8,"uniqueItems":true,"items":{"type":"string","enum":["click","type_text","key_press","key_combo","scroll","drag","move","wait"]}},"include_reasoning":{"type":"boolean","default":true},"include_raw_code":{"type":"boolean","default":true},"llm":{"$ref":"#/components/schemas/LlmConfig"}}},"PredictResponse":{"type":"object","required":["request_id","actions","status","usage"],"properties":{"request_id":{"type":"string"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/ActionResponse"}},"raw_code":{"type":"array","items":{"type":"string"}},"reasoning":{"type":"string"},"status":{"type":"string","enum":["continue","done","fail"]},"cua_version":{"type":["string","null"],"description":"Echo: the CUA engine version that actually served this call (e.g. \"v5\")."},"screen_width":{"type":"integer","description":"Echo: the width the server actually used — the coordinate space the returned (x, y) are in."},"screen_height":{"type":"integer","description":"Echo: the height the server actually used — the coordinate space the returned (x, y) are in."},"usage":{"$ref":"#/components/schemas/UsageInfo"}}},"CreateSessionRequest":{"type":"object","additionalProperties":false,"properties":{"cua_version":{"type":"string","enum":["v1","v3","v4","v5"],"default":"v5"},"model":{"type":["string","null"],"minLength":1,"maxLength":512},"screen_width":{"type":"integer","minimum":320,"maximum":3840,"default":1920},"screen_height":{"type":"integer","minimum":240,"maximum":2160,"default":1080},"max_trajectory_length":{"type":"integer","minimum":1,"maximum":20,"default":3},"system_prompt":{"type":["string","null"],"maxLength":16000},"instructions":{"type":["string","null"],"maxLength":16000},"tools":{"type":["array","null"],"minItems":1,"maxItems":8,"uniqueItems":true,"items":{"type":"string","enum":["click","type_text","key_press","key_combo","scroll","drag","move","wait"]}},"metadata":{"type":["object","null"],"maxProperties":32,"additionalProperties":true,"description":"JSON object capped at 16,384 UTF-8 bytes by the server."},"llm":{"$ref":"#/components/schemas/LlmConfig"}}},"CreateSessionResponse":{"type":"object","required":["request_id","session_id","cua_version","screen_size","created_at","expires_at","usage"],"properties":{"request_id":{"type":"string"},"session_id":{"type":"string"},"cua_version":{"type":"string"},"screen_size":{"type":"string","examples":["1920x1080"]},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"usage":{"$ref":"#/components/schemas/UsageInfo"}}},"SessionPredictRequest":{"type":"object","required":["screenshot","instruction"],"additionalProperties":false,"properties":{"screenshot":{"type":"string","minLength":100,"maxLength":10485760,"pattern":"^[A-Za-z0-9+/=]+$"},"instruction":{"type":"string","minLength":1,"maxLength":32000},"include_reasoning":{"type":"boolean","default":true},"include_raw_code":{"type":"boolean","default":true}}},"SessionPredictResponse":{"type":"object","required":["request_id","session_id","step","actions","status","usage"],"properties":{"request_id":{"type":"string"},"session_id":{"type":"string"},"step":{"type":"integer"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/ActionResponse"}},"raw_code":{"type":"array","items":{"type":"string"}},"reasoning":{"type":"string"},"status":{"type":"string","enum":["continue","done","fail"]},"cua_version":{"type":["string","null"],"description":"Echo: the CUA engine version that actually served this step (e.g. \"v5\")."},"usage":{"$ref":"#/components/schemas/UsageInfo"}}},"SessionInfoResponse":{"type":"object","required":["session_id","cua_version","screen_size","created_at","expires_at"],"properties":{"session_id":{"type":"string"},"cua_version":{"type":"string"},"screen_size":{"type":"string"},"step_count":{"type":"integer","default":0},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"total_credits_used":{"type":"integer","default":0}}},"GroundRequest":{"type":"object","required":["screenshot","element"],"additionalProperties":false,"properties":{"screenshot":{"type":"string","minLength":100,"maxLength":10485760,"pattern":"^[A-Za-z0-9+/=]+$"},"element":{"type":"string","minLength":1,"maxLength":32000,"description":"Natural-language description of the UI element."},"screen_width":{"type":["integer","null"],"minimum":320,"maximum":3840,"description":"Omit to use the screenshot's true size (measured server-side); no longer defaults to 1920."},"screen_height":{"type":["integer","null"],"minimum":240,"maximum":2160,"description":"Omit to use the screenshot's true size (measured server-side); no longer defaults to 1080."}}},"GroundResponse":{"type":"object","required":["request_id","x","y","screen_width","screen_height","usage"],"properties":{"request_id":{"type":"string"},"x":{"type":"integer"},"y":{"type":"integer"},"screen_width":{"type":"integer","description":"Echo: the width the server actually used — the coordinate space the returned (x, y) are in."},"screen_height":{"type":"integer","description":"Echo: the height the server actually used — the coordinate space the returned (x, y) are in."},"usage":{"$ref":"#/components/schemas/UsageInfo"}}},"ParseRequest":{"type":"object","required":["code"],"additionalProperties":false,"properties":{"code":{"type":"string","minLength":1,"maxLength":50000,"description":"Raw pyautogui code."}}},"ParseResponse":{"type":"object","required":["actions"],"properties":{"actions":{"type":"array","items":{"$ref":"#/components/schemas/ActionResponse"}}}},"ModelInfo":{"type":"object","required":["id","description"],"properties":{"id":{"type":"string"},"description":{"type":"string"}}},"CUAVersionInfo":{"type":"object","required":["id","description","avg_step_time","features","latest"],"properties":{"id":{"type":"string"},"description":{"type":"string"},"avg_step_time":{"type":"string"},"features":{"type":"array","items":{"type":"string"}},"latest":{"type":"boolean","default":false}}},"ModelsResponse":{"type":"object","required":["models","cua_versions","action_types"],"properties":{"models":{"type":"array","items":{"$ref":"#/components/schemas/ModelInfo"}},"cua_versions":{"type":"array","items":{"$ref":"#/components/schemas/CUAVersionInfo"}},"action_types":{"type":"array","items":{"type":"string"}}}},"EndpointUsage":{"type":"object","properties":{"requests":{"type":"integer","default":0},"credits":{"type":"integer","default":0}}},"UsageSummaryResponse":{"type":"object","required":["period"],"properties":{"period":{"type":"string"},"total_requests":{"type":"integer","default":0},"total_credits":{"type":"integer","default":0},"total_cost_cents":{"type":"integer","default":0},"breakdown":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/EndpointUsage"}},"balance":{"type":"integer","default":0},"wallet_balance_cents":{"type":"integer","default":0},"wallet_balance_usd":{"type":"number","default":0}}},"CreateAPIKeyRequest":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":100,"pattern":".*\\S.*"},"scopes":{"type":"array","maxItems":23,"uniqueItems":true,"items":{"type":"string","enum":["predict","session","ground","parse","keys","usage","machines:read","machines:write","actions:exec","terminal:exec","files:read","files:write","browser:execute","snapshots:write","connection:read","schedules:read","schedules:write","triggers:write","runs:read","runs:write","workflows:read","workflows:write","llm_keys"]},"default":["predict","session","ground","parse","machines:read","machines:write","actions:exec","terminal:exec","files:read","files:write","snapshots:write","runs:read","runs:write","workflows:read","workflows:write","llm_keys"],"description":"Omit or send [] for the server default shown here. connection:read and browser:execute are always opt-in high-risk scopes."}}},"APIKeyResponse":{"type":"object","required":["key","key_id","name","tier","scopes","created_at"],"properties":{"key":{"type":"string","description":"The raw API key. Returned ONCE only."},"key_id":{"type":"string"},"name":{"type":"string"},"tier":{"type":"string","enum":["free","starter","professional","enterprise"]},"scopes":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"date-time"}}},"APIKeyListItem":{"type":"object","required":["key_id","name","tier","scopes","created_at","key_prefix"],"properties":{"key_id":{"type":"string"},"name":{"type":"string"},"tier":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"date-time"},"last_used_at":{"type":["string","null"],"format":"date-time"},"key_prefix":{"type":"string","description":"Stored 16-character identification prefix; never the full secret."}}},"SessionMutationResponse":{"type":"object","required":["status","session_id"],"properties":{"status":{"type":"string","enum":["ok"]},"session_id":{"type":"string"}}},"RevokeAPIKeyResponse":{"type":"object","required":["status","key_id"],"properties":{"status":{"type":"string","enum":["ok"]},"key_id":{"type":"string"}}},"MachineRecord":{"type":"object","required":["id","display_name","status"],"properties":{"id":{"type":"string"},"display_name":{"type":"string"},"status":{"type":"string","enum":["creating","provisioning","starting","running","stopping","stopped","restarting","suspended","deleting","terminated","error"]},"os_type":{"type":"string","enum":["linux","windows"],"default":"linux"},"desktop_enabled":{"type":"boolean","default":false},"cpu_cores":{"type":"integer","default":1},"memory_gb":{"type":"number","default":2},"storage_gb":{"type":"integer","default":10},"public_ip":{"type":["string","null"]},"is_test":{"type":"boolean","default":false},"created_at":{"type":["string","null"],"format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"auto_destroy_at":{"type":["string","null"],"format":"date-time"},"ttl_minutes":{"type":["integer","null"]},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"billing":{"$ref":"#/components/schemas/MachineBilling","description":"How this API-provisioned machine is metered (omitted for non-API machines)."}}},"MachineBilling":{"type":"object","description":"Per-machine runtime billing state. 1 credit = 1 cent.","properties":{"billed_to":{"type":"string","enum":["api_wallet"],"default":"api_wallet"},"running_credits_per_hour":{"type":"integer","description":"Rate while running (5 Linux / 9 Windows)."},"stopped_credits_per_hour":{"type":"integer","description":"Rate while stopped/suspended (storage only, 1)."},"accrued_cents":{"type":"integer","description":"Credits owed for the current metering segment so far."},"projected_daily_cents":{"type":"integer","description":"rate_cents_per_hour * 24 — a full day at the current rate."},"since":{"type":["string","null"],"format":"date-time","description":"When the current metering segment started."},"total_credits_billed":{"type":"integer","description":"Lifetime credits this machine has billed."},"suspended_for_billing":{"type":"boolean","description":"true if stopped because the wallet ran dry."},"auto_destroy_at":{"type":["string","null"],"format":"date-time"},"ttl_minutes":{"type":["integer","null"]}}},"BillingActiveItem":{"type":"object","required":["machine_id","display_name","status","os_type","rate_cents_per_hour","running_credits_per_hour","stopped_credits_per_hour","accrued_cents","total_credits_billed","suspended_for_billing"],"properties":{"machine_id":{"type":"string"},"display_name":{"type":"string"},"status":{"type":"string","enum":["running","starting","stopping","restarting","stopped","suspended"]},"os_type":{"type":"string","enum":["linux","windows"]},"rate_cents_per_hour":{"type":"integer","description":"Hourly rate in this machine's current state."},"running_credits_per_hour":{"type":"integer"},"stopped_credits_per_hour":{"type":"integer"},"accrued_cents":{"type":"integer","description":"Cost of the current metering segment so far."},"since":{"type":["string","null"],"format":"date-time","description":"When the current segment started."},"total_credits_billed":{"type":"integer"},"suspended_for_billing":{"type":"boolean"},"auto_destroy_at":{"type":["string","null"],"format":"date-time"},"ttl_minutes":{"type":["integer","null"]}}},"BillingActiveResponse":{"type":"object","required":["active","current_run_rate_cents_per_hour","request_id"],"properties":{"active":{"type":"array","items":{"$ref":"#/components/schemas/BillingActiveItem"},"description":"Every API-billed machine currently metering (running OR stopped). Empty for test-mode keys."},"current_run_rate_cents_per_hour":{"type":"integer","description":"Summed instantaneous burn rate across the active list — total cents/hour right now."},"request_id":{"type":"string"}}},"ConnectionDetailsRedacted":{"type":"object","properties":{"public_ip":{"type":["string","null"]},"ssh_port":{"type":["integer","null"]},"ssh_username":{"type":["string","null"]},"vnc_port":{"type":["integer","null"]},"websocket_port":{"type":["integer","null"]},"has_ssh_key":{"type":"boolean","default":false},"has_vnc_password":{"type":"boolean","default":false}}},"ConnectionDetailsFull":{"type":"object","required":["machine_id","request_id"],"properties":{"machine_id":{"type":"string"},"public_ip":{"type":["string","null"]},"ssh_port":{"type":["integer","null"]},"ssh_username":{"type":["string","null"]},"ssh_private_key_pem":{"type":["string","null"],"description":"ED25519 (Linux) or RSA (Windows) private key. HIGHLY SENSITIVE — store in a secrets manager."},"vnc_port":{"type":["integer","null"]},"vnc_password":{"type":["string","null"]},"websocket_port":{"type":["integer","null"]},"websocket_url":{"type":["string","null"]},"devtools_url":{"type":["string","null"]},"vnc_url":{"type":["string","null"],"description":"When available, a signed, short-lived, INTERACTIVE noVNC desktop URL (targets /vnc.html?autoconnect=1). Open directly in a browser or iframe to view AND control the desktop — no IP/port/password needed. Null when not available for this machine (use public_ip + vnc_port + vnc_password instead). Expires (~1h); re-fetch from this endpoint to refresh."},"screen_width":{"type":["integer","null"],"description":"Actual desktop width, when reported by the machine."},"screen_height":{"type":["integer","null"],"description":"Actual desktop height, when reported by the machine."},"request_id":{"type":"string"}}},"ProvisionRequest":{"type":"object","required":["display_name"],"additionalProperties":false,"properties":{"display_name":{"type":"string","minLength":1,"maxLength":64},"os_type":{"type":"string","enum":["linux","windows"],"default":"linux"},"desktop_enabled":{"type":"boolean","default":false},"cpu_cores":{"type":["integer","null"],"minimum":1,"maximum":16},"memory_gb":{"type":["integer","null"],"minimum":1,"maximum":64},"storage_gb":{"type":["integer","null"],"minimum":8,"maximum":500},"restore_from_snapshot":{"type":["boolean","null"],"default":false},"ttl_minutes":{"type":["integer","null"],"minimum":5,"maximum":10080,"description":"Optional auto-destroy lease, measured from creation (5 minutes to 7 days)."},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Max 16 entries; keys ≤64 chars, values ≤256 chars."}}},"ProvisionResponse":{"type":"object","required":["machine","connection","request_id"],"properties":{"machine":{"$ref":"#/components/schemas/MachineRecord"},"connection":{"$ref":"#/components/schemas/ConnectionDetailsRedacted"},"request_id":{"type":"string"}}},"ListMachinesResponse":{"type":"object","required":["data","request_id"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MachineRecord"}},"has_more":{"type":"boolean","default":false},"request_id":{"type":"string"}}},"GetMachineResponse":{"type":"object","required":["machine","request_id"],"properties":{"machine":{"$ref":"#/components/schemas/MachineRecord"},"request_id":{"type":"string"}}},"LifecycleResponse":{"type":"object","required":["machine_id","status","message","request_id"],"properties":{"machine_id":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"}}},"UpdateMachineRequest":{"type":"object","required":["ttl_minutes"],"additionalProperties":false,"properties":{"ttl_minutes":{"type":"integer","minimum":0,"maximum":10080,"description":"0 clears auto-destroy; otherwise the value must be between 5 and 10080.","oneOf":[{"const":0},{"minimum":5,"maximum":10080}]}}},"UpdateMachineResponse":{"type":"object","required":["machine_id","ttl_minutes","auto_destroy_at","request_id"],"properties":{"machine_id":{"type":"string"},"ttl_minutes":{"type":["integer","null"]},"auto_destroy_at":{"type":["string","null"],"format":"date-time"},"request_id":{"type":"string"}}},"MachinePricingResponse":{"type":"object","required":["pricing","request_id"],"properties":{"pricing":{"type":"object","additionalProperties":true,"description":"The live machine runtime, one-time, billing granularity, and TTL rate card."},"request_id":{"type":"string"}}},"SnapshotResponse":{"type":"object","required":["machine_id","snapshot_id","name","created_at","credits_charged","request_id"],"properties":{"machine_id":{"type":"string"},"snapshot_id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"credits_charged":{"type":"integer"},"request_id":{"type":"string"}}},"ScreenshotResponse":{"type":"object","required":["machine_id","image_b64","mime_type","width","height","captured_at","request_id"],"properties":{"machine_id":{"type":"string"},"image_b64":{"type":"string","description":"Base64-encoded screenshot (no data: prefix)."},"mime_type":{"type":"string","default":"image/jpeg"},"width":{"type":"integer"},"height":{"type":"integer"},"captured_at":{"type":"string","format":"date-time"},"request_id":{"type":"string"}}},"ActionRequest":{"type":"object","required":["command"],"additionalProperties":false,"properties":{"command":{"type":"string","enum":["screenshot","click","double_click","click_with_modifiers","type","key_press","key_combo","scroll","drag","list_windows","switch_to_window","close_window","minimize_window","maximize_window","restore_window","arrange_windows","move_window","terminal_connect","terminal_execute","terminal_read","terminal_clear","terminal_close","file_read","file_exists","directory_list","file_write","file_edit","file_append","file_delete","directory_delete","file_download","file_list_downloads","browser_open","browser_navigate","browser_click","browser_type","browser_get_dom","browser_get_clickables","browser_state","browser_info","browser_scroll","browser_close","browser_screenshot","browser_wait","browser_list_tabs","browser_open_tab","browser_close_tab","browser_switch_tab","browser_execute"],"description":"Canonical command name. See /v1/models for the current model and action capabilities."},"parameters":{"type":"object","additionalProperties":true,"description":"Command-specific params (e.g. {x, y} for click). Max 1 MB serialized."},"timeout_ms":{"type":["integer","null"],"minimum":1000,"maximum":120000}}},"ActionResultResponse":{"type":"object","required":["machine_id","command","success","duration_ms","request_id"],"properties":{"machine_id":{"type":"string"},"command":{"type":"string"},"success":{"type":"boolean"},"result":{"type":["object","null"],"additionalProperties":true},"error":{"type":["string","null"]},"duration_ms":{"type":"integer"},"screenshot":{"type":["string","null"],"description":"Auto-captured post-action screenshot for browser_* commands. Data URI base64."},"request_id":{"type":"string"}}},"BatchActionRequest":{"type":"object","required":["steps"],"additionalProperties":false,"properties":{"steps":{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"#/components/schemas/ActionRequest"}},"stop_on_error":{"type":"boolean","default":true}}},"BatchActionResponse":{"type":"object","required":["machine_id","results","completed_count","failed_count","request_id"],"properties":{"machine_id":{"type":"string"},"results":{"type":"array","items":{"$ref":"#/components/schemas/ActionResultResponse"}},"completed_count":{"type":"integer"},"failed_count":{"type":"integer"},"aborted":{"type":"boolean","default":false},"request_id":{"type":"string"}}},"BrowserOpRequest":{"type":"object","additionalProperties":false,"properties":{"parameters":{"type":"object","additionalProperties":true},"timeout_ms":{"type":["integer","null"],"minimum":1000,"maximum":120000}}},"TerminalRequest":{"type":"object","required":["command"],"additionalProperties":false,"properties":{"command":{"type":"string","minLength":1,"maxLength":8192},"timeout_ms":{"type":"integer","minimum":1000,"maximum":120000,"default":30000},"session_id":{"type":["string","null"],"maxLength":128},"cwd":{"type":["string","null"],"maxLength":512}}},"FilesOpRequest":{"type":"object","additionalProperties":false,"properties":{"parameters":{"type":"object","additionalProperties":true,"description":"Op-specific params: {path} for read; {path, content} for write; etc."}}},"ScheduleResponse":{"type":"object","required":["id","name","machine_id","task_prompt","enabled","frequency","cron","timezone","request_id"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"machine_id":{"type":"string"},"task_prompt":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string"},"cron":{"type":"string"},"timezone":{"type":"string"},"next_run_at":{"type":["string","null"],"format":"date-time"},"last_run_at":{"type":["string","null"],"format":"date-time"},"run_count":{"type":"integer","default":0},"consecutive_failures":{"type":"integer","default":0},"paused_reason":{"type":["string","null"]},"is_test":{"type":"boolean","default":false},"created_at":{"type":["string","null"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"request_id":{"type":"string"}}},"ScheduleCreateRequest":{"type":"object","required":["name","machine_id","task_prompt"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"machine_id":{"type":"string","minLength":1,"maxLength":64},"task_prompt":{"type":"string","minLength":1,"maxLength":8000},"frequency":{"type":["string","null"],"enum":["every_15_minutes","every_30_minutes","hourly","every_6_hours","every_12_hours","daily","weekly","monthly","custom"]},"cron":{"type":["string","null"],"maxLength":128,"description":"Required when frequency='custom'. 5- or 6-field cron expression."},"timezone":{"type":"string","maxLength":64,"default":"UTC"},"time":{"type":["string","null"],"maxLength":5,"description":"HH:MM 24-hour. Used by daily/weekly/monthly presets."},"day_of_week":{"type":["integer","null"],"minimum":0,"maximum":6},"day_of_month":{"type":["integer","null"],"minimum":1,"maximum":28},"run_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601 UTC timestamp for a one-shot schedule. Mutually exclusive with frequency."},"max_consecutive_failures":{"type":"integer","minimum":1,"maximum":50,"default":5},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"llm":{"$ref":"#/components/schemas/LlmConfig"}}},"ScheduleUpdateRequest":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"task_prompt":{"type":"string","minLength":1,"maxLength":8000},"frequency":{"type":"string"},"cron":{"type":"string","maxLength":128},"timezone":{"type":"string","maxLength":64},"time":{"type":"string","maxLength":5},"day_of_week":{"type":"integer","minimum":0,"maximum":6},"day_of_month":{"type":"integer","minimum":1,"maximum":28},"max_consecutive_failures":{"type":"integer","minimum":1,"maximum":50},"enabled":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{"type":"string"}}}},"ListSchedulesResponse":{"type":"object","required":["data","request_id"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleResponse"}},"has_more":{"type":"boolean","default":false},"request_id":{"type":"string"}}},"ScheduleRunRecord":{"type":"object","required":["id","schedule_id","status","trigger","executed_at"],"properties":{"id":{"type":"string"},"schedule_id":{"type":"string"},"status":{"type":"string","enum":["queued","running","completed","failed","skipped","cancelled","insufficient_credits"]},"trigger":{"type":"string","enum":["cron","manual","triggered","webhook","email","run_at"]},"duration_seconds":{"type":["integer","null"]},"credits_charged":{"type":["integer","null"]},"error":{"type":["string","null"]},"executed_at":{"type":"string","format":"date-time"}}},"ListScheduleRunsResponse":{"type":"object","required":["data","request_id"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleRunRecord"}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean","default":false},"request_id":{"type":"string"}}},"RunScheduleRequest":{"type":"object","additionalProperties":false,"properties":{"task_prompt_override":{"type":["string","null"],"maxLength":8000},"triggered_context":{"type":["object","null"],"additionalProperties":true,"description":"Free-form context injected into the agent's prompt. Max 1 MB serialized."}}},"RunScheduleResponse":{"type":"object","required":["schedule_id","run_id","status","message","request_id"],"properties":{"schedule_id":{"type":"string"},"run_id":{"type":"string"},"status":{"type":"string","enum":["running","queued","skipped","completed"]},"message":{"type":"string"},"request_id":{"type":"string"}}},"TriggerCreateRequest":{"type":"object","required":["kind"],"additionalProperties":false,"properties":{"kind":{"type":"string","enum":["webhook","chain"]},"source_schedule_id":{"type":["string","null"],"maxLength":64},"event":{"type":"string","enum":["on_complete","on_failure","on_any"],"default":"on_complete"},"pass_output":{"type":"boolean","default":true},"rate_limit_per_minute":{"type":"integer","minimum":1,"maximum":600,"default":60},"enabled":{"type":"boolean","default":true}}},"TriggerResponse":{"type":"object","required":["id","schedule_id","kind","enabled","created_at"],"properties":{"id":{"type":"string"},"schedule_id":{"type":"string"},"kind":{"type":"string"},"enabled":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"webhook_url":{"type":["string","null"]},"webhook_secret":{"type":["string","null"],"description":"HMAC secret. Returned on creation and identical idempotent replays. Stored only as versioned AES-GCM ciphertext."},"email_address":{"type":["string","null"]},"source_schedule_id":{"type":["string","null"]},"event":{"type":["string","null"]}}},"TriggerListItem":{"type":"object","required":["id","schedule_id","kind","enabled","created_at"],"description":"Persisted trigger view. The one-time webhook_secret returned during creation is deliberately absent.","properties":{"id":{"type":"string"},"schedule_id":{"type":"string"},"kind":{"type":"string"},"enabled":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"webhook_url":{"type":["string","null"]},"email_address":{"type":["string","null"]},"source_schedule_id":{"type":["string","null"]},"event":{"type":["string","null"]}}},"ListTriggersResponse":{"type":"object","required":["data","request_id"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TriggerListItem"}},"request_id":{"type":"string"}}},"WebhookFireResponse":{"type":"object","required":["received","schedule_id","message","request_id"],"properties":{"received":{"type":"boolean"},"schedule_id":{"type":"string"},"run_id":{"type":["string","null"]},"deduplicated":{"type":"boolean","default":false},"message":{"type":"string"},"request_id":{"type":"string"}}},"HealthResponse":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ok"]},"api_version":{"type":"string"},"service":{"type":"string"}}},"RunRequest":{"type":"object","required":["machine_id","task"],"additionalProperties":false,"properties":{"machine_id":{"type":"string","minLength":1,"maxLength":128,"description":"Target VM id (must be owned by the key's user)."},"task":{"type":"string","minLength":1,"maxLength":16000,"description":"Natural-language task to drive to completion."},"cua_version":{"type":"string","enum":["v1","v3","v4","v5"],"default":"v5","description":"CUA engine version. Defaults to the latest (v5); available on all tiers."},"instructions":{"type":["string","null"],"maxLength":16000,"description":"Appended to the base agent prompt."},"system_prompt":{"type":["string","null"],"maxLength":32000,"description":"Replaces the base agent prompt (shares the tier custom-prompt budget with instructions)."},"model":{"type":["string","null"],"description":"Model selection (resolved server-side)."},"max_steps":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":"Hard cap on agent steps (clamped to the server ceiling)."},"deadline_seconds":{"type":["integer","null"],"minimum":1,"maximum":86400,"description":"Wall-clock budget in seconds (clamped)."},"on_awaiting_human":{"type":"string","enum":["pause","fail","cancel"],"default":"pause","description":"Behaviour when the agent needs a human."},"awaiting_human_timeout_seconds":{"type":["integer","null"],"minimum":1,"maximum":86400},"webhook_url":{"type":["string","null"],"maxLength":2048,"description":"HTTPS URL for HMAC-signed run-event deliveries."},"metadata":{"type":["object","null"],"additionalProperties":true,"description":"Opaque key/value map echoed back (≤50 keys)."},"llm":{"$ref":"#/components/schemas/LlmConfig"}}},"RunResponse":{"type":"object","required":["id","object","status"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["agent.run"]},"status":{"type":"string","enum":["queued","running","awaiting_human","succeeded","failed","cancelled","timed_out"]},"machine_id":{"type":"string"},"task":{"type":"string"},"cua_version":{"type":"string"},"instructions":{"type":["string","null"]},"max_steps":{"type":"integer"},"on_awaiting_human":{"type":"string"},"steps_completed":{"type":"integer"},"credits_charged":{"type":"integer"},"cost_cents":{"type":"integer"},"result":{"type":["object","null"],"additionalProperties":true},"error":{"type":["object","null"],"additionalProperties":true},"awaiting_human_reason":{"type":["string","null"]},"metadata":{"type":["object","null"],"additionalProperties":true},"llm":{"type":["object","null"],"additionalProperties":true,"description":"Non-secret BYOK echo when the run opted into the caller's own key: {provider, model, key_fingerprint, key_source, key_scrubbed}. key_source is 'stored' or 'header'; key_scrubbed flips to true when the encrypted snapshot is destroyed at terminal state. Never contains the key."},"webhook_url":{"type":["string","null"]},"webhook_secret":{"type":["string","null"],"description":"Returned ONCE on create; null on get/list. Verify deliveries with HMAC-SHA256."},"created_at":{"type":["string","null"]},"started_at":{"type":["string","null"]},"awaiting_human_since":{"type":["string","null"]},"finished_at":{"type":["string","null"]},"request_id":{"type":["string","null"]}}},"ListRunsResponse":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/RunResponse"}},"has_more":{"type":"boolean","default":false},"request_id":{"type":"string"}}},"ResumeRunRequest":{"type":"object","additionalProperties":false,"properties":{"note":{"type":["string","null"],"maxLength":2000,"description":"Recorded on the run timeline."}}},"RunEvent":{"type":"object","description":"One Server-Sent Event in a run stream. The SSE `data:` field carries this JSON; `id:` carries the resumable `seq` cursor.","properties":{"seq":{"type":"integer","description":"Monotonic cursor; pass via Last-Event-ID or ?after= to resume."},"type":{"type":"string","description":"Event type (e.g. status, step, awaiting_human, done)."},"data":{"type":"object","additionalProperties":true}}},"WorkflowCreateRequest":{"type":"object","required":["name","slug","definition"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"slug":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9_-]{0,62}$","description":"Stable handle."},"definition":{"type":"object","additionalProperties":true,"description":"Workflow DSL, validated server-side."},"inputs_schema":{"type":["object","null"],"additionalProperties":true},"description":{"type":["string","null"],"maxLength":2000},"metadata":{"type":["object","null"],"additionalProperties":true}}},"WorkflowUpdateRequest":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"definition":{"type":"object","additionalProperties":true},"inputs_schema":{"type":["object","null"],"additionalProperties":true},"description":{"type":["string","null"],"maxLength":2000},"status":{"type":["string","null"],"enum":["active","archived",null]},"metadata":{"type":["object","null"],"additionalProperties":true}}},"DeleteTriggerResponse":{"type":"object","required":["deleted","trigger_id","request_id"],"properties":{"deleted":{"type":"boolean"},"trigger_id":{"type":"string"},"request_id":{"type":"string"}}},"DeleteScheduleResponse":{"type":"object","required":["deleted","schedule_id","request_id"],"properties":{"deleted":{"type":"boolean"},"schedule_id":{"type":"string"},"request_id":{"type":"string"}}},"WorkflowResponse":{"type":"object","required":["id","object","name","slug","version"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["workflow"]},"name":{"type":"string"},"slug":{"type":"string"},"version":{"type":"integer"},"dsl_version":{"type":"string","default":"2026-06-01"},"definition":{"type":"object","additionalProperties":true},"inputs_schema":{"type":["object","null"],"additionalProperties":true},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived"],"default":"active"},"metadata":{"type":["object","null"],"additionalProperties":true},"created_at":{"type":["string","null"]},"updated_at":{"type":["string","null"]},"request_id":{"type":["string","null"]}}},"ListWorkflowsResponse":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowResponse"}},"has_more":{"type":"boolean","default":false},"request_id":{"type":"string"}}},"StartWorkflowRunRequest":{"type":"object","additionalProperties":false,"properties":{"inputs":{"type":["object","null"],"additionalProperties":true,"description":"Bound input values."},"machine_id":{"type":["string","null"],"maxLength":128,"description":"Default machine for task steps."},"budget_cents":{"type":["integer","null"],"minimum":0,"maximum":10000000,"description":"Hard spend cap across all task steps; 0 or null = unlimited."},"max_iterations":{"type":["integer","null"],"minimum":1,"maximum":100000},"deadline_seconds":{"type":["integer","null"],"minimum":1,"maximum":86400},"webhook_url":{"type":["string","null"],"maxLength":2048},"metadata":{"type":["object","null"],"additionalProperties":true},"definition":{"type":["object","null"],"additionalProperties":true,"description":"Inline DSL for an ad-hoc run (POST /v1/workflows/runs). Omit when running a saved workflow."},"inputs_schema":{"type":["object","null"],"additionalProperties":true,"description":"Ad-hoc runs only."},"llm":{"$ref":"#/components/schemas/LlmConfig"}}},"WorkflowRunResponse":{"type":"object","required":["id","object","status"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["workflow.run"]},"status":{"type":"string","enum":["queued","running","awaiting_human","succeeded","failed","cancelled","timed_out"]},"workflow_id":{"type":["string","null"]},"workflow_version":{"type":["integer","null"]},"machine_id":{"type":["string","null"]},"inputs":{"type":"object","additionalProperties":true},"output":{"type":["object","null"],"additionalProperties":true},"error":{"type":["object","null"],"additionalProperties":true},"awaiting_human_reason":{"type":["string","null"]},"awaiting_step_id":{"type":["string","null"]},"iterations_used":{"type":"integer"},"spent_cents":{"type":"integer"},"budget_cents":{"type":["integer","null"]},"webhook_url":{"type":["string","null"]},"webhook_secret":{"type":["string","null"],"description":"Returned ONCE on create."},"metadata":{"type":["object","null"],"additionalProperties":true},"created_at":{"type":["string","null"]},"started_at":{"type":["string","null"]},"finished_at":{"type":["string","null"]},"request_id":{"type":["string","null"]}}},"ListWorkflowRunsResponse":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRunResponse"}},"has_more":{"type":"boolean","default":false},"request_id":{"type":"string"}}},"ResumeWorkflowRunRequest":{"type":"object","additionalProperties":false,"properties":{"approved":{"type":"boolean","default":true,"description":"Approve (continue) or reject (fail) the pending human_approval step."},"note":{"type":["string","null"],"maxLength":2000}}},"WorkflowDeleteResponse":{"type":"object","required":["id","object","deleted"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["workflow"]},"deleted":{"type":"boolean","enum":[true]},"request_id":{"type":"string"}}},"LlmConfig":{"type":"object","additionalProperties":false,"description":"Opt-in BYOK model selection. provider 'managed' (or omitting llm) keeps the platform default. There is deliberately no api_key field (422 if attempted): keys ride the X-LLM-Api-Key header or the encrypted /v1/llm/keys store only. Once BYOK is requested there is NO silent fallback to Coasty's platform LLM keys.","properties":{"provider":{"type":"string","enum":["managed","anthropic","openai"],"default":"managed","description":"Whose LLM account runs the harness. Anything else is 422 LLM_PROVIDER_UNSUPPORTED."},"model":{"type":["string","null"],"minLength":1,"maxLength":512,"description":"Main worker model. Defaults: claude-sonnet-4-6 (anthropic), gpt-4o (openai). Any model string your account can access; must be vision-capable."},"grounding_model":{"type":["string","null"],"minLength":1,"maxLength":512,"description":"Override for pixel-coordinate grounding. Defaults to model. Grounding quality is tuned on the platform model; expect best results with the defaults."},"compaction_model":{"type":["string","null"],"minLength":1,"maxLength":512,"description":"Override for trajectory compaction. Defaults to model. A cheaper model here is the classic cost tune."},"code_agent_model":{"type":["string","null"],"minLength":1,"maxLength":512,"description":"Override for the code agent. Defaults to model."}}},"StoreLlmKeyRequest":{"type":"object","required":["api_key"],"additionalProperties":false,"properties":{"api_key":{"type":"string","minLength":16,"maxLength":512,"description":"Your own provider API key (sk-ant-... for anthropic, sk-... for openai). AES-256-GCM encrypted at rest; never returned or logged."}}},"StoreLlmKeyResponse":{"type":"object","required":["provider","key_fingerprint","stored"],"properties":{"provider":{"type":"string","enum":["anthropic","openai"]},"key_fingerprint":{"type":"string","description":"Non-secret sha256-prefix fingerprint of the stored key. The key itself is never returned again."},"stored":{"type":"boolean","enum":[true]}}},"LlmKeyListItem":{"type":"object","required":["provider","key_fingerprint"],"properties":{"provider":{"type":"string","enum":["anthropic","openai"]},"key_fingerprint":{"type":"string"},"created_at":{"type":["string","null"]},"updated_at":{"type":["string","null"]}}},"ListLlmKeysResponse":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/LlmKeyListItem"}}}},"DeleteLlmKeyResponse":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}},"responses":{"BadRequest":{"description":"Invalid request body or parameters.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"VALIDATION_ERROR","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}},"Unauthorized":{"description":"Missing, invalid, or revoked API key. Pass `X-API-Key: sk-coasty-live-...` (or test).","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"INVALID_API_KEY","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}},"Forbidden":{"description":"API key lacks the required scope or tier-feature is unavailable on the caller's plan.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"INSUFFICIENT_SCOPE","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}},"NotFound":{"description":"Resource not found in this key's namespace.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"NOT_FOUND","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}},"PaymentRequired":{"description":"Insufficient credits to perform the operation. Top up via /credits or upgrade subscription.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"INSUFFICIENT_CREDITS","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}},"Conflict":{"description":"The resource state conflicts with this operation.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"CONFLICT","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}},"PayloadTooLarge":{"description":"The request body exceeds the endpoint limit.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}},"UnprocessableEntity":{"description":"The JSON shape is valid but one or more values violate the endpoint contract.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"VALIDATION_ERROR","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}},"RateLimited":{"description":"Rate or concurrency limit exceeded.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"RATE_LIMIT_EXCEEDED","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}},"BadGateway":{"description":"An upstream dependency returned an invalid response.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"UPSTREAM_ERROR","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}},"ServiceUnavailable":{"description":"A required service is temporarily unavailable.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"SERVICE_UNAVAILABLE","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}},"GatewayTimeout":{"description":"An upstream dependency timed out.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"UPSTREAM_TIMEOUT","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}},"ServerError":{"description":"Unexpected server error. Retry with exponential backoff.","headers":{"X-Coasty-Request-Id":{"$ref":"#/components/headers/CoastyRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-Credits-Charged":{"$ref":"#/components/headers/CreditsCharged"},"X-Credits-Refunded":{"$ref":"#/components/headers/CreditsRefunded"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"INTERNAL_ERROR","message":"An error occurred. See `code` for details.","type":"validation_error","request_id":"req_a1b2c3d4e5f6","retryable":false,"retry_with_same_idempotency_key":false}}}}}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional client-supplied key (≤128 chars, [A-Za-z0-9_-:]) for safe retries. 'Same request' = a SHA-256 of the canonical (sorted-key) JSON body (session_id is folded in for /sessions/{id}/predict). Replays the original response for 24 h when the body hash matches (X-Coasty-Idempotent-Replay: true and X-Credits-Charged: 0). Inference replays also set body usage.credits_charged=0 and usage.billed=false; machine-snapshot bodies retain the original gross charge for auditability. A retry while the original is still running waits up to ~25 s then returns the result, otherwise 409 IDEMPOTENCY_IN_FLIGHT (retry with the SAME key). Returns 422 IDEMPOTENCY_KEY_REUSED if the body differs. Collect a lost result via GET /v1/idempotency/{key}.","schema":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9_\\-:]+$"},"examples":{"uuid":{"value":"550e8400-e29b-41d4-a716-446655440000"}}},"XLLMProvider":{"name":"X-LLM-Provider","in":"header","required":false,"description":"BYOK: which provider the X-LLM-Api-Key belongs to (anthropic | openai). Required whenever X-LLM-Api-Key is sent — a key without a provider is a 422 LLM_PROVIDER_UNSUPPORTED. Selecting a BYOK provider (here or via the body llm.provider) runs the ENTIRE harness on your own account with no silent fallback to Coasty's platform LLM keys.","schema":{"type":"string","enum":["anthropic","openai"]}},"XLLMApiKey":{"name":"X-LLM-Api-Key","in":"header","required":false,"description":"BYOK: your own provider API key, used for this request only. Takes precedence over the key stored via PUT /v1/llm/keys/{provider}. Never logged, never echoed in any response, webhook, or idempotency replay.","schema":{"type":"string","minLength":16,"maxLength":512}},"XLLMModel":{"name":"X-LLM-Model","in":"header","required":false,"description":"BYOK: model override for this request (equivalent to body llm.model). Defaults: claude-sonnet-4-6 (anthropic), gpt-4o (openai). Any model string your account can access; must be vision-capable.","schema":{"type":"string","minLength":1,"maxLength":512}},"MachineId":{"name":"machine_id","in":"path","required":true,"description":"Machine UUID, or `mch_test_<8-32 lowercase hex>` for sandbox/test-mode keys.","schema":{"type":"string","pattern":"^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|mch_test_[0-9a-f]{8,32})$"}},"ScheduleId":{"name":"schedule_id","in":"path","required":true,"description":"Schedule UUID, or `sch_test_<8-32 lowercase hex>` for sandbox keys.","schema":{"type":"string","pattern":"^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|sch_test_[0-9a-f]{8,32})$"}},"TriggerId":{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","pattern":"^trg_[0-9a-f]{8,32}$"}},"WebhookId":{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","pattern":"^whk_[0-9a-f]{8,48}$"}},"SessionId":{"name":"session_id","in":"path","required":true,"description":"Stateful CUA session identifier (1-128 URL-safe characters).","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}},"IdempotencyKeyPath":{"name":"key","in":"path","required":true,"description":"The Idempotency-Key whose result you want to collect (≤128 chars, [A-Za-z0-9_-:]).","schema":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9_\\-:]+$"}},"RunId":{"name":"run_id","in":"path","required":true,"description":"Run UUID (also used for workflow runs).","schema":{"type":"string","format":"uuid"}},"LastEventId":{"name":"Last-Event-ID","in":"header","required":false,"description":"Last processed SSE sequence number. Reconnect with this value to resume without gaps.","schema":{"type":"integer","minimum":0}},"WorkflowId":{"name":"workflow_id","in":"path","required":true,"description":"Workflow UUID.","schema":{"type":"string","format":"uuid"}}},"headers":{"CoastyRequestId":{"description":"Coasty correlation identifier for this request.","schema":{"type":"string"}},"RetryAfter":{"description":"Seconds to wait before retrying. Present on retryable back-pressure and transient failures.","schema":{"type":"integer","minimum":0}},"KeyKind":{"description":"Whether the authenticated key is live or test.","schema":{"type":"string","enum":["live","test","legacy"]}},"TestMode":{"description":"true when the request executed against the sandbox namespace.","schema":{"type":"boolean"}},"IdempotentReplay":{"description":"true when this is a stored response replay rather than a new execution.","schema":{"type":"boolean"}},"IdempotencyReplayed":{"description":"true when this response replays a completed attempt; false for a fresh execution.","schema":{"type":"boolean"}},"IdempotencyStatus":{"description":"Lifecycle status of the canonical idempotent attempt when applicable.","schema":{"type":"string","enum":["processing","completed"]}},"CreditsCharged":{"description":"Credits charged by this response (zero for sandbox keys and stored replays).","schema":{"type":"integer","minimum":0}},"CreditsRemaining":{"description":"Authoritative post-charge API-wallet balance in USD cents, when available.","schema":{"type":"integer","minimum":0}},"CreditsRefunded":{"description":"Credits durably returned to the wallet after a failed billed operation.","schema":{"type":"integer","minimum":1}},"RateLimit":{"description":"Effective request limit for the current window.","schema":{"type":"integer","minimum":0}},"RateRemaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"RateReset":{"description":"Unix timestamp when the current rate window resets.","schema":{"type":"integer","minimum":0}}}},"x-logo":{"url":"https://coasty.ai/logo_dark.svg","altText":"Coasty","backgroundColor":"#FFFFFF"},"x-mcp-server":{"name":"@coasty/mcp","install":"npx -y @coasty/mcp","description":"Coasty's Model Context Protocol server. Wires the /v1/* surface plus pricing into any MCP-compatible client (Claude Desktop, Cursor, etc.).","homepage":"https://coasty.ai/mcp"}}