Follow Discord
Sweep 10 Nov 2026 · 02:18Z Build v2.1.322 539 read Stable v2.1.311 Latest v2.1.322 Next v2.1.322 Feeds RSS JSON llms.txt llms-full.txt Unofficial
HomeDocsSearch
Search the documentation

145 pages for retries.

Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.

PDF Processing Claude Developer Platform · in the page agents-and-tools/agent-skills/best-practices …r timeout accounts for slow connections REQUEST_TIMEOUT = 30 # Three retries balances reliability versus speed # Most intermittent failures resolve by the second retry MAX_RETRIES = 3 ``` **Bad exam… computer-use-tool Claude Developer Platform · in the page agents-and-tools/tool-use/computer-use-tool …ut tokens than disabling thinking entirely (fewer mistakes mean fewer retries), making it a strong option for cost-sensitive loops. </Tip> ### Augmenting computer use with other tools To add other t… handle-tool-calls Claude Developer Platform · in the page agents-and-tools/tool-use/handle-tool-calls …"> Let the SDK manage the `tool_use` loop, result formatting, and retries for you. </Card> <Card title="Define tools" icon="hammer" href="https://platform.claude.com/docs/en/agents-and-tools/… Process results programmatically Claude Developer Platform · in the page agents-and-tools/tool-use/programmatic-tool-calling …e’s running code. Claude receives the error in `stderr` and typically retries the call: ```json { "type": "code_execution_tool_result", "tool_use_id": "srvtoolu_abc123", "content": { "type"… Log at info level Claude Developer Platform · in the page agents-and-tools/tool-use/tool-runner …the next request goes out with your state. The following example retries a truncated response with a larger `max_tokens` budget. ```typescript const runner = client.beta.messages.toolRun… Telemetry Destinations Claude Developer Platform · in the page api/beta/organization/telemetry_destinations …oud-metadata address. The API doesn't connect to such an address, and retries the delivery a bounded number of times as it does after a timeout. A timeout or a server failure of the DNS lookup is a te… Create a Telemetry Destination Claude Developer Platform · in the page api/beta/organization/telemetry_destinations/create …oud-metadata address. The API doesn't connect to such an address, and retries the delivery a bounded number of times as it does after a timeout. A timeout or a server failure of the DNS lookup is a te… List Telemetry Destinations Claude Developer Platform · in the page api/beta/organization/telemetry_destinations/list …oud-metadata address. The API doesn't connect to such an address, and retries the delivery a bounded number of times as it does after a timeout. A timeout or a server failure of the DNS lookup is a te… Retrieve a Telemetry Destination Claude Developer Platform · in the page api/beta/organization/telemetry_destinations/retrieve …oud-metadata address. The API doesn't connect to such an address, and retries the delivery a bounded number of times as it does after a timeout. A timeout or a server failure of the DNS lookup is a te… Test a Telemetry Destination Claude Developer Platform · in the page api/beta/organization/telemetry_destinations/test …st`, to the destination with its registered headers, once and without retries, and report the destination's answer. The response is 200 whether or not the destination answered with a 2xx status: its `… Update a Telemetry Destination Claude Developer Platform · in the page api/beta/organization/telemetry_destinations/update …oud-metadata address. The API doesn't connect to such an address, and retries the delivery a bounded number of times as it does after a timeout. A timeout or a server failure of the DNS lookup is a te… Events Claude Developer Platform · in the page api/beta/sessions/events …` The model is currently overloaded. Emitted after automatic retries are exhausted. - `type: "model_overloaded_error"` - `message: string` Human-readable error de… List Events Claude Developer Platform · in the page api/beta/sessions/events/list …` The model is currently overloaded. Emitted after automatic retries are exhausted. - `type: "model_overloaded_error"` - `message: string` Human-readable error de… Stream Events Claude Developer Platform · in the page api/beta/sessions/events/stream …` The model is currently overloaded. Emitted after automatic retries are exhausted. - `type: "model_overloaded_error"` - `message: string` Human-readable error de… Threads Claude Developer Platform · in the page api/beta/sessions/threads …` The model is currently overloaded. Emitted after automatic retries are exhausted. - `type: "model_overloaded_error"` - `message: string` Human-readable error de… Events Claude Developer Platform · in the page api/beta/sessions/threads/events …` The model is currently overloaded. Emitted after automatic retries are exhausted. - `type: "model_overloaded_error"` - `message: string` Human-readable error de… List Session Thread Events Claude Developer Platform · in the page api/beta/sessions/threads/events/list …` The model is currently overloaded. Emitted after automatic retries are exhausted. - `type: "model_overloaded_error"` - `message: string` Human-readable error de… Stream Session Thread Events Claude Developer Platform · in the page api/beta/sessions/threads/events/stream …` The model is currently overloaded. Emitted after automatic retries are exhausted. - `type: "model_overloaded_error"` - `message: string` Human-readable error de… routines-fire Claude Developer Platform · in the page api/claude-code/routines-fire …eates a new session. There is no idempotency key. If a webhook caller retries, the endpoint creates multiple sessions. ## Rate limits API fires are limited per hour: each routine accepts up to 30 fi… errors Claude Developer Platform · in the page api/errors …nsistent usage patterns. </Warning> The official SDK automatically retries transient failures (such as connection errors, rate limits, and 5xx server errors) with exponential backoff, twice by defa… Before Claude Developer Platform · in the page api/migration-2026-10-21 …the HTTP client. It runs on every request the client sends, including retries: ```python import httpx2 from anthropic import Anthropic, DefaultHttpxClient def send_x_api_key(request… spans Claude Developer Platform · in the page api/opentelemetry/spans …er page of a list has its own span. A span covers its whole request, retries included, and has each attribute of the same-named API span when the SDK has the value. The SDK sets `http.request.method`… rate-limits Claude Developer Platform · in the page api/rate-limits …has no `retry-after` header. Retrying, including the SDK’s automatic retries, fails until access resumes. * On the Messages API, `error.details.error_code` is `enforced_spend_limit_reached`. Use it t… Message Batches API Claude Developer Platform · in the page build-with-claude/batch-processing ….jsonl results, one result on each line. # For per-result handling (retries, validation errors), use the Anthropic SDK. curl "https://api.anthropic.com/v1/messages/batches/msgbatch_01HkcTjaV5uDC8j… fallback-credit Claude Developer Platform · in the page build-with-claude/fallback-credit …ry model’s cache was already warm. ## When a retry is rejected Most retries redeem on the first attempt. When one does not, the API returns a 400 error that tells you what to try next. <Steps> <S… fast-mode Claude Developer Platform · in the page build-with-claude/fast-mode …tform.claude.com/docs/en/manage-claude/usage-cost-analytics-api). ## Retries and fallbacks ### Automatic retries The SDK automatically retries fast mode `429` errors up to two times by default (con… handling-stop-reasons Claude Developer Platform · in the page build-with-claude/handling-stop-reasons …"> Let the SDK manage the `tool_use` loop, result formatting, and retries for you. </Card> <Card title="Streaming messages" icon="lightning" href="https://platform.claude.com/docs/en/build-wi… overview Claude Developer Platform · in the page build-with-claude/overview …| A middleware in the Anthropic SDKs that retries a refused request on the fallback models you list. | | ↳… preserved-thinking Claude Developer Platform · in the page build-with-claude/preserved-thinking …**Don’t hide the 400.** If your code catches it, strips thinking, and retries on the caller’s behalf, log that it did: their history is still edited, and the model loses its earlier reasoning on every… claude-prompting-best-practices Claude Developer Platform · in the page build-with-claude/prompt-engineering/claude-prompting-best-practices …ly match complex schemas when told to, especially if implemented with retries. For classification tasks, use either tools with an enum field containing your valid labels or structured outputs. </Accor… prompting-claude-sonnet-5-5 Claude Developer Platform · in the page build-with-claude/prompt-engineering/prompting-claude-sonnet-5-5 …with-claude/refusals-and-fallback#server-side-fallback) (in beta), it retries `cyber` and `frontier_llm` declines on Claude Sonnet 5. It doesn’t retry `bio`, `reasoning_extraction`, or `general_harms`… refusals-and-fallback Claude Developer Platform · in the page build-with-claude/refusals-and-fallback …cloud/anthropic-managed): set `fallbacks` to `"default"`, and the API retries a declined request on the fallback model Anthropic recommends for its refusal category. For categories with no recommended… skills-guide Claude Developer Platform · in the page build-with-claude/skills-guide …er", "content": "Generate and process a large sample dataset"}] max_retries = 10 response = client.messages.create( model="claude-opus-5-5", max_tokens=4096, container={… structured-outputs Claude Developer Platform · in the page build-with-claude/structured-outputs …onsistent data types * Schema violations requiring error handling and retries Structured outputs guarantee schema-compliant responses through constrained decoding: * **Always valid:** No more `JSON.… middleware Claude Developer Platform · in the page cli-sdks-libraries/middleware …se. Use middleware for cross-cutting concerns such as logging, custom retries, request annotation, and retrying a declined request on a [fallback model](https://platform.claude.com/docs/en/cli-sdks-li… overview Claude Developer Platform · in the page cli-sdks-libraries/overview …diomatic interfaces, type safety, and built-in support for streaming, retries, error handling, and [OpenTelemetry tracing](https://platform.claude.com/docs/en/manage-claude/opentelemetry/sdk). * **Lib… csharp Claude Developer Platform · in the page cli-sdks-libraries/sdks/csharp …response. * `AnthropicException`: Base class for all exceptions. ## Retries The SDK automatically retries 2 times by default, with a short exponential backoff between requests. Only the following… go Claude Developer Platform · in the page cli-sdks-libraries/sdks/go …rt fails, you might receive `*url.Error` wrapping `*net.OpError`. ## Retries Certain errors are automatically retried 2 times by default, with a short exponential backoff. The SDK retries by default… java Claude Developer Platform · in the page cli-sdks-libraries/sdks/java …optionsBuilder.baseUrl("https://example.com"); optionsBuilder.maxRetries(42); }); ``` The `withOptions()` method does not affect the original client or service. ## Async usage The default clie… php Claude Developer Platform · in the page cli-sdks-libraries/sdks/php …| | Network error | `APIConnectionException` | ## Retries Certain errors are automatically retried two times by default, with a short exponential backoff. Connection errors (for… For Amazon Bedrock support Claude Developer Platform · in the page cli-sdks-libraries/sdks/python …`_` prefix properties, methods, and modules are private. </Note> ## Retries By default, the SDK retries certain errors twice, with a short exponential backoff. It retries connection errors (for exa… Automatically handles tool execution loop Claude Developer Platform · in the page cli-sdks-libraries/sdks/ruby …ror` | | Network error | `APIConnectionError` | ## Retries Certain errors are automatically retried 2 times by default, with a short exponential backoff. Connection errors (for ex… typescript Claude Developer Platform · in the page cli-sdks-libraries/sdks/typescript …ole.log(message._request_id); // req_018EeWyXxfu5pfWkrYcMdjWG ``` ## Retries Certain errors are automatically retried 2 times by default, with a short exponential backoff. Connection errors (for exa… access-transparency-log Claude Developer Platform · in the page manage-claude/access-transparency-log …* Network errors, rate limiting, or server errors that outlasted the retries. * An unexpected response. * A state or `--save` file that could not be written. An exit status `3` with `404` resp… cmek Claude Developer Platform · in the page manage-claude/cmek …mek_key_unreachable`, and you can retry them. The Message Batches API retries them until your key is available or the batch expires. On Claude Enterprise, these requests include messages in chat and i… cmek-key-lifecycle Claude Developer Platform · in the page manage-claude/cmek-key-lifecycle …mek_key_unreachable`, and you can retry them. The Message Batches API retries them for you until your key is available or the batch expires. ## Change keys or stop using CMEK A workspace or organiza… compliance-errors Claude Developer Platform · in the page manage-claude/compliance-errors …is header automatically. If you use a generic HTTP retry library that retries on every 5xx, suppress retries when `x-should-retry` is `false`; retrying this error fails identically on every attempt.… check-events-against-results Claude Developer Platform · in the page manage-claude/compliance-security-posture/check-events-against-results …many-requests) describes; an organization whose calls fail after your retries is not read on this run, and a failed call is not a change. ## Match the fields Match an entry in the response to a stor… send-events Claude Developer Platform · in the page manage-claude/compliance-security-posture/send-events …runs overlap. * **Handle failed runs:** If a request fails after the retries in [Handle Compliance API errors](https://platform.claude.com/docs/en/manage-claude/compliance-errors), end the run. The n… inference-hooks-endpoint Claude Developer Platform · in the page manage-claude/inference-hooks-endpoint …nd response. The same timeout applies to tool call frames. Anthropic retries exactly once, after a 100ms delay, and only when the connection attempt fails. The retry shares the same timeout budget an…
Feedback