Skip to main content
Import SDK exceptions from thinkplatform.sdk. If the CLI succeeds but Python or a managed workspace fails, use the shared troubleshooting workflow. The API reference and models reference document resource-specific inputs and results. ThinkPlatformApiError.response_body contains the parsed error response when available. It can include sensitive information; do not log it indiscriminately. An HTTP error’s message is derived from message, detail, or error, or the HTTP reason. Wrapped transport errors preserve the original httpx exception as __cause__; SDK API calls do not expose an httpx.HTTPStatusError for an unsuccessful status.

Handle a read failure

This example uses the explicit bearer-token and context environment settings from resource workflows. It avoids printing tokens or response bodies.

Retry behavior

For normal API requests, the SDK reacts to HTTP 401 by invalidating the credential cache, requesting a token with force_refresh=True, and sending the request once more. A second failure is raised. Static tokens are unchanged by refresh. This retry can replay a write request too. The SDK does not automatically retry transport failures, HTTP 429, or HTTP 5xx responses in this request path. Design any application retry policy around the operation’s safety. A timeout after a write does not prove the server rejected it; read the resource state before repeating a mutation. Handle authorization failures by checking permissions and context rather than repeatedly retrying.