Error categories
Octogen API errors fall into two categories:- HTTP errors (4xx/5xx) — The server returned a non-2xx response. The SDK raises a typed exception with a
status_code,detail, and the rawresponseattached. - Network errors — The request never reached the server (DNS failure, timeout, connection reset). The SDK raises
OctogenConnectionError.
If you are using the Catalog Partner MCP server instead of the REST API, tool-level errors are returned as HTTP 200 responses with an
error field in the payload rather than as HTTP error codes. This guide covers the REST API only.HTTP error reference
401 — Authentication error
401 — Authentication error
SDK exception:
OctogenAuthenticationErrorThe API key is missing, malformed, or has been revoked. Common causes:OCTO_API_KEYenvironment variable is not set- The key string was truncated or contains extra whitespace
- The key was deactivated in the partner portal
403 — Forbidden
403 — Forbidden
SDK exception:
OctogenForbiddenErrorThe API key is valid, but your organization is not allowed to perform this operation. Common causes:- Your organization does not have a Catalog Partner grant
- The API key belongs to the wrong organization
- The key’s org type does not have permission for the endpoint
404 — Not found
404 — Not found
SDK exception:
OctogenNotFoundErrorThe requested catalog or product is not visible to your API key. Common detail values:"catalog_not_found"— The catalog key you passed incatalogis not granted to your organization. UseGET /v1/catalogsto see available keys."product_not_found"— No active product in your granted catalogs matches the URL you passed to/products/lookup.
GET /v1/catalogs. For product lookup, confirm the URL is a canonical product page URL and that the catalog covering that domain is granted to your organization.422 — Validation error
422 — Validation error
SDK exception: Each entry has:
OctogenValidationErrorThe request body failed schema validation. The response body contains a detail array where each entry identifies the invalid field:loc— path to the invalid field (e.g.["body", "limit"])msg— human-readable error messagetype— machine-readable error type
429 — Rate limited
429 — Rate limited
SDK exception:
OctogenAPIError with status_code (Python) / statusCode (TypeScript) equal to 429Your organization exceeded its shared per-organization rate limit — one budget across all of your API keys and MCP sessions. The response carries detail: "rate_limit_exceeded" and a Retry-After header with the number of seconds to wait.Recovery: Unlike the other 4xx errors, 429 is transient. Wait the Retry-After interval, then retry with exponential backoff. See Rate Limits for the headers, the MCP equivalent, and bulk-job guidance.SDK exception hierarchy
All SDK exceptions inherit fromOctogenError. The full hierarchy:
OctogenAPIError and its subclasses expose:
.status_code(Python) /.statusCode(TypeScript) — the HTTP status code.detail— the parsed error body from thedetailfield, or the raw response text.response— the underlying HTTP response object
Handling errors in code
Retry guidance
| Error type | Retry? | Action |
|---|---|---|
OctogenAuthenticationError (401) | No | Replace the API key |
OctogenForbiddenError (403) | No | Check org catalog grants |
OctogenNotFoundError (404) | No | Verify catalog key or product URL |
OctogenValidationError (422) | No | Fix the request body |
OctogenAPIError with 429 | Yes, after delay | Honor Retry-After, then retry with backoff |
OctogenConnectionError | Yes | Retry with exponential backoff |
OctogenAPIError with 5xx | Yes | Retry with exponential backoff |
5xx responses, use an exponential backoff strategy with jitter. Start with a 1-second delay, double on each retry, and cap at 30 seconds. After three to five failed attempts, surface the error to the caller rather than retrying indefinitely.