ClaudeCloudflare Developer PlatformApr 2, 2026, 12:00 AM

AI Gateway - Automatically retry on upstream provider failures on AI Gateway

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

claudeenmodel: claude-sonnet-4-20250514

AI Gateway Adds Automatic Retry Functionality for Upstream Provider Failures

Key Points

  • Automatic retry on upstream provider failures
  • Configurable retry policies with up to 5 attempts
  • No client-side code changes required

Summary

Cloudflare AI Gateway now includes automatic retry capabilities at the gateway level when upstream providers return errors. This feature eliminates the need for client-side retry logic implementation.

Key Points

  • Configurable retry parameters: Set retry count (up to 5 attempts), delay between retries (100ms to 5 seconds), and backoff strategy (Constant, Linear, or Exponential)
  • Gateway-level implementation: Retries happen automatically without requiring client-side code changes
  • Per-request overrides: Default retry policies can be overridden using request headers
  • Ideal for uncontrolled clients: Particularly useful when you cannot modify the client making the request
  • Complex failover support: For advanced scenarios like cross-provider failover, use Dynamic Routing feature

Full Translation

Translations

A translation section that keeps the flow of the original article.

claudejamodel: claude-sonnet-4-20250514

AI Gateway - AI Gatewayでアップストリームプロバイダーの障害時に自動リトライ

AI Gatewayでアップストリームプロバイダーの障害時に自動リトライ

公開日: 2026年4月2日

AI Gatewayがゲートウェイレベルでの自動リトライをサポートするようになりました。アップストリームプロバイダーがエラーを返した場合、クライアント側の変更を必要とせずに、設定したリトライポリシーに基づいてゲートウェイがリクエストを自動的にリトライします。

設定可能な項目

  • リトライ回数: 最大5回まで設定可能
  • リトライ間隔: 100msから5秒まで設定可能
  • バックオフ戦略: 以下から選択
    • Constant(一定間隔)
    • Linear(線形増加)
    • Exponential(指数的増加)

これらのデフォルト設定はゲートウェイを通るすべてのリクエストに適用され、リクエストごとのヘッダーでオーバーライドすることも可能です。

利用シーン

この機能は、リクエストを行うクライアントを制御できず、呼び出し側でリトライロジックを実装できない場合に特に有用です。

より複雑なフェイルオーバーシナリオ

異なるプロバイダー間でのフェイルオーバーなど、より複雑なシナリオについては、Dynamic Routingをご利用ください。

詳細については、ゲートウェイの管理を参照してください。