Skip to main content
All errors follow the Problem Details format (RFC 7807). The type field is a URI that links to a page describing the problem.

Error Format

{
  "type": "https://docs.bedrock.cv/errors/validation",
  "title": "Validation error",
  "status": 400,
  "detail": "One or more request fields are invalid.",
  "code": "VALIDATION_ERROR",
  "requestId": "req_01JABCD123",
  "errors": {
    "overlay_id": ["Required field"]
  }
}
FieldTypeDescription
typestringURI identifying the problem type
titlestringShort summary of the problem
statusintegerHTTP status code
detailstringHuman-readable explanation
codestringMachine-readable error code
requestIdstringUnique request identifier for support
errorsobjectField-level validation errors (when applicable)

Error Types

TypeStatusCodeDescription
/errors/validation400VALIDATION_ERRORInvalid request fields
/errors/authentication401UNAUTHORIZEDMissing or invalid API key
/errors/insufficient-credits402INSUFFICIENT_CREDITSNot enough credits
/errors/authorization403FORBIDDENKey lacks access to resource
/errors/not-found404NOT_FOUNDResource doesn’t exist
/errors/rate-limit429RATE_LIMITEDToo many requests

Handling Errors

Check the code field to determine how to respond:
response = requests.post(url, headers=headers, json=data)

if response.status_code >= 400:
    error = response.json()

    if error["code"] == "RATE_LIMITED":
        time.sleep(int(response.headers.get("Retry-After", 60)))
        retry()
    elif error["code"] == "VALIDATION_ERROR":
        fix_request(error["errors"])
    elif error["code"] == "INSUFFICIENT_CREDITS":
        top_up_credits()
    else:
        raise Exception(error["detail"])

Request ID

Every response includes a requestId. Include it when contacting support:
X-Request-Id: req_01JABCD123