Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ceramic.ai/llms.txt

Use this file to discover all available pages before exploring further.

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

HTTP Status Codes

CodeMeaningCauseRetryAction
200SuccessRequest succeededProcess the response
400Invalid RequestMalformed or unparseable request bodyNoFix the request
401UnauthorizedInvalid or missing api keyNoCheck credentials
402Payment RequiredCredits exhaustedNoAdd credits or upgrade your plan
403ForbiddenPlan or account restrictionNoCheck plan or account status
404Not FoundPath does not existNoVerify the request path
405Method Not AllowedHTTP method not supportedNoUse POST for /search
408Request TimeoutRequest took too longYesRetry the request
413Payload Too LargeRequest body exceeds size limitNoReduce request size
415Unsupported MediaContent-Type is not application/json.NoSet Content-Type: application/json
422Unprocessable ContentParameter is unsupported, invalid, or wrong typeNoFix the parameter and retry
429Too Many RequestsRate limit exceededYesRetry after retry_after_seconds
500Internal ErrorUnexpected server errorYesRetry; contact support if it persists
502Bad GatewayUpstream service returned an errorYesRetry the request
503Service UnavailableService temporarily unavailableYesRetry with backoff
504Gateway TimeoutUpstream service timed outYesRetry the request

Error Response Format

All errors follow the following format. For example, using an unsupported parameter like prompt instead of query:
{
  "title": "Unprocessable Content",
  "status": 422,
  "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")