Skip to main content
Ceramic uses standard HTTP status error codes to indicate the success or failure of API requests.

HTTP Status Codes

CodeMeaningAction
200SuccessProcess response
401Invalid api keyCheck your Authorization header
429Rate limit exceededRetry with backoff
500Internal server error

Error Response Format

All errors follow the following format. For example, using an unsupported parameter like prompt instead of query:
{
  "title": "Invalid request",
  "status": 400,
  "detail": "Unsupported parameter: prompt",
  "requestId": "5e2ef11d-f0e5-407b-ba29-d1b851ed1d65",
  "code": "unsupported_parameter"
}

Handling Errors

python
from ceramic_ai import Ceramic

client = Ceramic(api_key="YOUR_API_KEY")

try:
  client.search(query="California rental laws")
except ceramic_ai.APIStatusError as e:
  print(f"HTTP {e.status_code}")
  print("body:", e.body)
except ceramic_ai.APIConnectionError as e:
  print("Connection error:", str(e))

Retry Strategy

Both the Python and TypeScript SDKs automatically retry transient failures with a short exponential backoff. By default, the SDK retries 2 times on:
  • network/connection errors
  • 408 Request Timeout
  • 429 Rate Limit
  • 5xx server errors
You can disable or tune retries via the client option (max_retries in Python, maxRetries in TypeScript), or per-request.
python
from ceramic_ai import Ceramic

client = Ceramic(
    api_key="YOUR_API_KEY",
    max_retries=0,  # disable retries (default is 2)
)

# or per-request
client.with_options(max_retries=5).search(query="California rental laws")