Getting started
Errors
Conventional HTTP status codes with a machine-readable code on every failure.
Errors return a JSON body with a stable code. Match on code, never on message: messages are written for humans and change.
{
"error": {
"code": "insufficient_balance",
"message": "This request costs $0.05 and the balance is $0.02.",
"doc_url": "https://docs.journeyapi.dev/errors#insufficient_balance"
}
}Status codes
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request | A parameter is missing or malformed. |
| 401 | invalid_api_key | The key is unknown, revoked or malformed. |
| 402 | insufficient_balance | The balance will not cover the request. |
| 403 | insufficient_scope | The key lacks the scope this endpoint needs. |
| 404 | not_found | No job or image with that id on this account. |
| 409 | job_not_terminal | The action needs a finished job and this one is still running. |
| 422 | prompt_rejected | The prompt did not pass content screening. |
| 429 | rate_limited | Too many requests. Honour the Retry-After header. |
| 500 | internal_error | Our fault. Safe to retry with the same idempotency key. |
| 503 | capacity_unavailable | No capacity right now. Retry with backoff. |
Failed jobs
A request can be accepted and the job still fail. That surfaces on the job, not as an HTTP error.
| Job error code | Meaning |
|---|---|
| content_policy | The rendered output was rejected by content screening. |
| render_timeout | The render exceeded its ceiling. Refunded automatically. |
| source_unreadable | A supplied image URL could not be fetched or decoded. |
| internal_error | Unexpected failure. Refunded automatically. |