On this page 3
Error body
Every error is JSON with one error object. details lists field problems when there are any.
422 Unprocessable Entity
{
"error": {
"type": "validation_error",
"message": "Some inputs are missing or invalid.",
"details": [
{
"field": "prompt",
"message": "is required"
},
{
"field": "num_images",
"message": "must be at most 4"
},
{
"field": "steps",
"message": "is not an input of this model"
}
]
}
}Status codes
- 400invalid_json
- The body is not valid JSON.
- 400bad_request
- The body is not a JSON object, a category or vendor filter is unknown, or limit or offset is invalid.
- 401unauthorized
- The Authorization header is not in the
Key ...form. - 404not_found
- Unknown model, unknown or expired request id, or no route at this path.
- 405method_not_allowed
- GET sent to a queue endpoint.
- 422validation_error
- Missing required input, wrong type, out of range, not an allowed value, or unknown field.
Handling errors
Check the status code first, then show the field messages next to the inputs they belong to.
curl -i -X POST "https://inferlane.net/api/v1/queue/black-forest-labs/flux-2-pro" \
-H "Authorization: Key $API_KEY" \
-H "Content-Type: application/json" \
-d '{"num_images": 9}'- Do not retry 4xx errors unchanged. Fix the request first.
- Retry network failures and 5xx responses with a growing delay.