Using the API
Errors
Every error has one shape, a type and a message, under a status that says which kind of error it is.
#The shape
400 Bad Request400
{
"error": {
"type": "invalid_request",
"message": "Some of the input is not valid."
},
"issues": [
{
"path": "question",
"message": "Too small: expected string to have >=3 characters"
}
]
}#Statuses
400
invalid_requestThe input does not fit the endpoint. The issues list says which field and why.
401
missing_key · invalid_keyNo key, a malformed one, or one that was revoked.
402
plan_excluded · plan_limitThe API needs a paid plan, or the free plan’s credits are used up. The plan field says which.
403
read_only_keyA read-only key tried to start a run that spends credits.
404
not_foundNo such endpoint, app or job of yours.
409
not_cancellableThe run has started; only a waiting run can be cancelled.
422
idempotency_mismatchAn Idempotency-Key was used before for a different request.
429
rate_limited · quota · key_cap · plan_exhaustedToo many requests this minute, a daily cap, or this period’s credits are used up. Retry-After says how long to wait.
503
off · runs_not_open · not_set_upThe API is switched off, or runs are not open yet. Free reads may still work.