Skip to main content
The SDK raises typed errors. All extend To11aiError; API errors extend To11aiApiError, which carries a status_code, an error_code, and details. Catch the specific class you care about and fall back to the base classes for the rest. The classes are grouped by where they come from. Common errors can surface on any call. Beyond those, a given operation only raises errors from its own surface — a prompt-management call never raises a prompt-resolution error like LabelNotFoundError, and vice versa.

Common errors

Any SDK call can raise these — they cover transport, authentication, and response validation regardless of the operation.

Prompt errors

Raised while rendering or resolving a prompt — including the environment resolution and policy checks that resolution runs through.
Every error class above is importable from the main to11ai_sdk entry. Two behaviors are worth noting: only idempotent requests (GET, PUT, DELETE) are retried, so POST and PATCH are never auto-retried and can’t double-submit; and 2xx responses are validated against their schema, raising To11aiResponseValidationError on drift.

Catching errors

Catch the specific class for the case you handle, and let the base classes cover the rest: