Errors
Error responses carry a message, a machine-readable code, and sometimes details:
json
{ "error": "Validation error", "code": "VALIDATION_ERROR", "details": {} }
| Status | Code | Meaning |
|---|---|---|
| 400 | BAD_REQUEST | The request is malformed or the state does not allow it. |
| 400 | VALIDATION_ERROR | The body failed schema validation. details carries the field errors. |
| 401 | UNAUTHORIZED | Missing, unknown, revoked or expired key. |
| 403 | FORBIDDEN | Authenticated but not allowed, including API keys on session-only endpoints. |
| 404 | NOT_FOUND | No such resource, or no access to it. Kosuke does not distinguish the two. |
| 402 | CREDIT_LIMIT_REACHED | Out of free credits. details carries usedUsd and limitUsd. |
| 409 | JOB_IN_PROGRESS | A job is already running in this session and could not be steered. |
| 409 | JOB_STOPPED | The run you targeted was stopped on purpose. |
| 429 | TOO_MANY_REQUESTS | Rate limited. |
| 503 | SERVICE_UNAVAILABLE | Transient. Retrying the same request is correct. |
| 500 | SERVER_ERROR | Unexpected. |
A presented but invalid key is terminal. It will not fall through to a session cookie that happens to be on the same request.