Skip to content
GasketDocs

Errors

Every error code, what it means and what to do.

json
{
  "error": { "code": "insufficient_scope", "message": "This key doesn't have the agents:run scope. Create a key with it under API keys." },
  "request_id": "req_..."
}
StatuscodeWhat to do
400invalid_request / invalid_jsonFix the body; the message names the field.
401unauthorizedSend a valid, unrevoked key as Authorization: Bearer gsk_…
402insufficient_creditAdd credit under Billing. Nothing was run or charged.
402spend_limit_reachedRaise the monthly limit under Billing, or wait for next month.
403insufficient_scopeUse a key with the endpoint's scope.
403environment_mismatchUse a key from the agent's environment.
404agent_not_found / run_not_found / action_not_foundCheck the id and that it's in this workspace.
409agent_not_activeResume the agent.
409action_not_authorizedOnly authorized actions can report a result.
429rate_limitedMore than 600 requests a minute for this key. Retry after retry-after seconds.
503model_not_configuredThe deployment has no model provider configured.
500internal_errorRetry. Quote the request id if it persists.

Run failures come back as a run with status failed and error.code (for example model_error or max_steps_reached), not as an HTTP error, so you still get the steps and usage.

Something wrong or missing? Tell us · Stuck? Help center