---
title: 高速モード
url: https://platform.claude.com/docs/ja/build-with-claude/fast-mode
description: 対応するClaudeモデルで、1秒あたりの出力トークン数を最大2.5倍に高めます。
---

「fast mode」（高速モード）は、Claude Opus 5.5、Claude Opus 5、およびClaude Opus 4.8において、プレミアム料金で1秒あたりの出力トークン数を最大2.5倍に高めます。利用するには、リクエストで`speed: "fast"`を設定してください。

<Note>
  Claude Opus 5.5の高速モードでは、`fast-mode-2026-02-01`ベータヘッダーやアクセスリクエストは不要です。引き続きヘッダーを送信するリクエストもそのまま動作します。Claude Opus 5およびClaude Opus 4.8の高速モードはリサーチプレビュー中です。アクセスをリクエストするには、アカウントマネージャーにお問い合わせいただくか、[ウェイトリストに登録](https://claude.com/fast-mode)してください。また、リクエストでは[ベータヘッダー](https://platform.claude.com/docs/ja/api/beta-headers)を送信してください。
</Note>

<Note>
  「zero data retention」（ゼロデータ保持）、すなわちZDRがこの機能にどのように適用されるかについては、[APIとデータ保持](https://platform.claude.com/docs/ja/manage-claude/api-and-data-retention)を参照してください。
</Note>

## サポートされているモデルとプラットフォーム

高速モードは以下のモデルとプラットフォームでサポートされています。

| サポートされているモデル                      | サポートされているプラットフォーム                                                                                                                                                                                                                                 |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Claude Opus 5.5 (claude-opus-5-5) | Claude API（[Claude Managed Agents](https://platform.claude.com/docs/ja/managed-agents/overview)を含む）<br />[Claude in Microsoft Foundry](https://platform.claude.com/docs/ja/build-with-claude/claude-in-microsoft-foundry)（Azureでホストされるデプロイメントの場合） |
| Claude Opus 5 (claude-opus-5)     | Claude API（[Claude Managed Agents](https://platform.claude.com/docs/ja/managed-agents/overview)を含む）                                                                                                                                               |
| Claude Opus 4.8 (claude-opus-4-8) | Claude API（[Claude Managed Agents](https://platform.claude.com/docs/ja/managed-agents/overview)を含む）                                                                                                                                               |

以前のモデルで高速モードを使用していた場合は、[高速モードをサポートするモデルに移行](https://platform.claude.com/docs/ja/models/opus-5-5/migration-guide)してください。

高速モードは、[Anthropicでホストされる](https://platform.claude.com/docs/ja/build-with-claude/claude-in-microsoft-foundry#hosting-options)Claude in Microsoft Foundryデプロイメントでは利用できません。

## 高速モードの仕組み

高速モードは、同じモデルをより高速な推論構成で実行します。知能や機能に変更はありません。

* 標準速度と比較して、1秒あたりの出力トークン数が最大2.5倍
* 速度のメリットは、「time to first token」（最初のトークンまでの時間）、すなわちTTFTではなく、「output tokens per second」（1秒あたりの出力トークン数）、すなわちOTPSに焦点を当てています
* 同じモデルの重みと動作（別のモデルではありません）
* [ストリーミング](https://platform.claude.com/docs/ja/build-with-claude/streaming)と互換性があり、OTPSの向上が最も顕著に現れます

## 基本的な使い方

リサーチプレビュー中のモデルでは、`fast-mode-2026-02-01`[ベータヘッダー](https://platform.claude.com/docs/ja/api/beta-headers)も必要です。

<CodeGroup>
  ```bash cURL
  curl https://api.anthropic.com/v1/messages \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01" \
    -H "content-type: application/json" \
    -d '{
      "model": "claude-opus-5-5",
      "max_tokens": 4096,
      "speed": "fast",
      "messages": [{
        "role": "user",
        "content": "Refactor this module to use dependency injection"
      }]
    }'
  ```

  ```bash CLI
  ant messages create <<'YAML'
  model: claude-opus-5-5
  max_tokens: 4096
  speed: fast
  messages:
    - role: user
      content: Refactor this module to use dependency injection
  YAML
  ```

  ```python Python
  client = anthropic.Anthropic()

  response = client.messages.create(
      model="claude-opus-5-5",
      max_tokens=4096,
      speed="fast",
      messages=[
          {"role": "user", "content": "Refactor this module to use dependency injection"}
      ],
  )

  for block in response.content:
      if block.type == "text":
          print(block.text)
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const response = await client.messages.create({
    model: "claude-opus-5-5",
    max_tokens: 4096,
    speed: "fast",
    messages: [
      {
        role: "user",
        content: "Refactor this module to use dependency injection"
      }
    ]
  });

  const textBlock = response.content.find(
    (block): block is Anthropic.TextBlock => block.type === "text"
  );
  console.log(textBlock?.text);
  ```

  ```csharp C#
  AnthropicClient client = new();

  var response = await client.Messages.Create(new MessageCreateParams
  {
      Model = Model.ClaudeOpus5_5,
      MaxTokens = 4096,
      Speed = Speed.Fast,
      Messages = [
          new() { Role = Role.User, Content = "Refactor this module to use dependency injection" }
      ],
  });

  foreach (var block in response.Content)
  {
      if (block.TryPickText(out var textBlock))
      {
          Console.WriteLine(textBlock.Text);
      }
  }
  ```

  ```go Go
  client := anthropic.NewClient()

  response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
  	Model:     anthropic.ModelClaudeOpus5_5,
  	MaxTokens: 4096,
  	Speed:     anthropic.MessageNewParamsSpeedFast,
  	Messages: []anthropic.MessageParam{
  		anthropic.NewUserMessage(anthropic.NewTextBlock("Refactor this module to use dependency injection")),
  	},
  })
  if err != nil {
  	log.Fatal(err)
  }
  for _, block := range response.Content {
  	if textBlock, ok := block.AsAny().(anthropic.TextBlock); ok {
  		fmt.Println(textBlock.Text)
  	}
  }
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  Message response = client.messages().create(
          MessageCreateParams.builder()
                  .model(Model.CLAUDE_OPUS_5_5)
                  .maxTokens(4096L)
                  .speed(MessageCreateParams.Speed.FAST)
                  .addUserMessage("Refactor this module to use dependency injection")
                  .build());

  response.content().stream()
          .flatMap(block -> block.text().stream())
          .forEach(textBlock -> IO.println(textBlock.text()));
  ```

  ```php PHP
  $client = new Client();

  $response = $client->messages->create(
      model: 'claude-opus-5-5',
      maxTokens: 4096,
      speed: 'fast',
      messages: [
          ['role' => 'user', 'content' => 'Refactor this module to use dependency injection'],
      ],
  );

  foreach ($response->content as $block) {
      if ($block instanceof \Anthropic\Messages\TextBlock) {
          echo $block->text, PHP_EOL;
      }
  }
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  response = client.messages.create(
    model: "claude-opus-5-5",
    max_tokens: 4096,
    speed: "fast",
    messages: [{role: "user", content: "Refactor this module to use dependency injection"}]
  )

  response.content.each do |block|
    puts block.text if block.type == :text
  end
  ```
</CodeGroup>

## 料金

高速モードは、200k入力トークンを超えるリクエストを含め、コンテキストウィンドウ全体にわたって標準料金に対する倍率で価格設定されています。以下の表は、対応モデルの高速モード料金を示しています。

| モデル                             | 入力             | 出力             |
| ------------------------------- | -------------- | -------------- |
| Claude Opus 5.5                 | $8 USD / MTok  | $40 USD / MTok |
| Claude Opus 5 / Claude Opus 4.8 | $10 USD / MTok | $50 USD / MTok |

高速モードの料金は、他の料金修飾子と重ねて適用されます。

* [プロンプトキャッシングの倍率](https://platform.claude.com/docs/ja/about-claude/pricing#prompt-caching)は高速モード料金に上乗せして適用されます
* [データレジデンシー](https://platform.claude.com/docs/ja/manage-claude/data-residency)の倍率は高速モード料金に上乗せして適用されます

料金の詳細については、[料金](https://platform.claude.com/docs/ja/about-claude/pricing#fast-mode-pricing)ページを参照してください。

## レート制限

高速モードには、標準のOpusのレート制限とは別の専用のレート制限があります。高速モードのレート制限を超えると、APIは容量が利用可能になる時期を示す`retry-after`ヘッダーとともに`429`エラーを返します。

Claude Opus 5.5にはStart、Build、Scaleの各[使用量ティア](https://platform.claude.com/docs/ja/api/rate-limits)でデフォルトの高速モードのレート制限があるため、Claude Opus 5.5で高速モードを使用するためにアクセスをリクエストする必要はありません。Evaluationティアの組織は、Start、Build、またはScaleティアに移行すると、Claude Opus 5.5で高速モードを使用できます。

レスポンスには、高速モードのレート制限の状態を示すヘッダーが含まれます。

| ヘッダー                                     | 説明                      |
| ---------------------------------------- | ----------------------- |
| `anthropic-fast-input-tokens-limit`      | 1分あたりの高速モード入力トークンの最大数   |
| `anthropic-fast-input-tokens-remaining`  | 残りの高速モード入力トークン数         |
| `anthropic-fast-input-tokens-reset`      | 高速モード入力トークン制限がリセットされる時刻 |
| `anthropic-fast-output-tokens-limit`     | 1分あたりの高速モード出力トークンの最大数   |
| `anthropic-fast-output-tokens-remaining` | 残りの高速モード出力トークン数         |
| `anthropic-fast-output-tokens-reset`     | 高速モード出力トークン制限がリセットされる時刻 |

高速モードのレート制限を確認するには、Claude Consoleの[Rate limits](https://platform.claude.com/usage/limits)ページにアクセスしてください。

## 使用された速度の確認

レスポンスの`usage`オブジェクトには、使用された速度（`"fast"`または`"standard"`のいずれか）を示す`speed`フィールドが含まれます。[高速モードをサポートしていないモデル](https://platform.claude.com/docs/ja/build-with-claude/fast-mode#supported-models-and-platforms)で`speed: "fast"`をリクエストするとエラーが返され、高速モードのレート制限または容量を超えた場合（`429`または`529`）も同様です。`speed: "fast"`を指定したリクエストが成功すると、`usage.speed`は`"fast"`になります。Claude Opus 4.6は例外です。エラーを返す代わりに、`speed: "fast"`と`fast-mode-2026-02-01`ベータヘッダーを指定したリクエストは成功しますが、標準速度で実行されます。この動作は`usage.speed`に正しく反映され、この場合は`"standard"`と表示されます。

<CodeGroup>
  ```bash cURL
  curl https://api.anthropic.com/v1/messages \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01" \
    -H "content-type: application/json" \
    -d '{
      "model": "claude-opus-5-5",
      "max_tokens": 1024,
      "speed": "fast",
      "messages": [{"role": "user", "content": "Hello"}]
    }'
  ```

  ```bash CLI
  ant messages create \
    --transform usage.speed \
    --raw-output <<'YAML'
  model: claude-opus-5-5
  max_tokens: 1024
  speed: fast
  messages:
    - role: user
      content: Hello
  YAML
  ```

  ```python Python
  client = anthropic.Anthropic()

  response = client.messages.create(
      model="claude-opus-5-5",
      max_tokens=1024,
      speed="fast",
      messages=[{"role": "user", "content": "Hello"}],
  )

  print(response.usage.speed)  # "fast" or "standard"
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const response = await client.messages.create({
    model: "claude-opus-5-5",
    max_tokens: 1024,
    speed: "fast",
    messages: [{ role: "user", content: "Hello" }]
  });

  console.log(response.usage.speed); // "fast" or "standard"
  ```

  ```csharp C#
  AnthropicClient client = new();

  var response = await client.Messages.Create(new MessageCreateParams
  {
      Model = Model.ClaudeOpus5_5,
      MaxTokens = 1024,
      Speed = Speed.Fast,
      Messages = [new() { Role = Role.User, Content = "Hello" }],
  });

  Console.WriteLine(response.Usage.Speed);  // "fast" or "standard"
  ```

  ```go Go
  client := anthropic.NewClient()

  response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
  	Model:     anthropic.ModelClaudeOpus5_5,
  	MaxTokens: 1024,
  	Speed:     anthropic.MessageNewParamsSpeedFast,
  	Messages: []anthropic.MessageParam{
  		anthropic.NewUserMessage(anthropic.NewTextBlock("Hello")),
  	},
  })
  if err != nil {
  	log.Fatal(err)
  }
  fmt.Println(response.Usage.Speed) // "fast" or "standard"
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  MessageCreateParams params = MessageCreateParams.builder()
          .model(Model.CLAUDE_OPUS_5_5)
          .maxTokens(1024L)
          .speed(MessageCreateParams.Speed.FAST)
          .addUserMessage("Hello")
          .build();

  Message response = client.messages().create(params);
  IO.println(response.usage().speed().orElseThrow());  // "fast" or "standard"
  ```

  ```php PHP
  $client = new Client();

  $response = $client->messages->create(
      model: 'claude-opus-5-5',
      maxTokens: 1024,
      speed: 'fast',
      messages: [['role' => 'user', 'content' => 'Hello']],
  );

  echo $response->usage->speed;  // "fast" or "standard"
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  response = client.messages.create(
    model: "claude-opus-5-5",
    max_tokens: 1024,
    speed: "fast",
    messages: [{ role: "user", content: "Hello" }]
  )

  puts(response.usage.speed)  # "fast" or "standard"
  ```
</CodeGroup>

```json Output
{
  "id": "msg_01XFDUDYJgAACzvnptvVoYEL",
  "type": "message",
  "role": "assistant",
// ...
  "usage": {
    "input_tokens": 8,
    "output_tokens": 12,
    "speed": "fast"
  }
}
```

組織全体の高速モードの使用量とコストを追跡するには、[Usage and Cost API](https://platform.claude.com/docs/ja/manage-claude/usage-cost-api)を参照してください。

## リトライとフォールバック

### 自動リトライ

高速モードのレート制限を超えると、APIは`retry-after`ヘッダーとともに`429`エラーを返します。SDKはデフォルトでこれらのリクエストを最大2回自動的にリトライし（`max_retries` (typescript, java, php: `maxRetries`; csharp: `MaxRetries`; go: `option.WithMaxRetries`)で設定可能）、各リトライの前にサーバーが指定した遅延時間だけ待機します。高速モードは継続的なトークン補充を使用するため、`retry-after`の遅延は通常短く、容量が利用可能になるとリクエストは成功します。

### 標準速度へのフォールバック

高速モードの容量を待つよりも標準速度にフォールバックしたい場合は、レート制限エラーをキャッチし、`speed: "fast"`を指定せずにリトライしてください。最初の高速リクエストで`max_retries` (typescript, java, php: `maxRetries`; csharp: `MaxRetries`; go: `option.WithMaxRetries`)を`0`に設定すると、自動リトライをスキップし、レート制限エラー時に即座に失敗させることができます。

<Note>
  高速から標準速度にフォールバックすると、[プロンプトキャッシュ](https://platform.claude.com/docs/ja/build-with-claude/prompt-caching)のミスが発生します。異なる速度のリクエストはキャッシュされたプレフィックスを共有しません。
</Note>

`max_retries` (typescript, java, php: `maxRetries`; csharp: `MaxRetries`; go: `option.WithMaxRetries`)を`0`に設定すると、他の一時的なエラー（過負荷、内部サーバーエラー）に対するリトライも無効になるため、以下の例ではそれらのケースに対してデフォルトのリトライ設定で元のリクエストを再発行しています。

<CodeGroup exclude="shell:cURL">
  ```bash CLI
  # `ant` は 429/5xx を自動的にリトライし、リクエスト単位の max_retries の
  # オーバーライドはありません。そのため fast-mode で 429 が返った場合、組み込みの
  # リトライが尽きた後にフォールバックが実行されます。--transform-error は分岐用に error.type を出力します。
  create_message_with_fast_fallback() {
    local speed="$1" max_attempts="${2:-3}" body out
    body=${3:-$(cat)}
    out=$(
      ant messages create \
        ${speed:+--speed "$speed"} \
        --transform-error error.type --format-error yaml <<<"$body" 2>/dev/null
    ) && { printf '%s\n' "$out"; return; }
    case "$out" in
      rate_limit_error)
        if [[ -n "$speed" ]]; then
          create_message_with_fast_fallback "" "$max_attempts" "$body"
          return
        fi ;;
      overloaded_error | api_error | "")
        if (( max_attempts > 1 )); then
          create_message_with_fast_fallback "$speed" $((max_attempts - 1)) "$body"
          return
        fi ;;
    esac
    printf '%s\n' "${out:-connection_error}" >&2
    return 1
  }

  MESSAGE=$(
    create_message_with_fast_fallback fast <<'YAML'
  model: claude-opus-5-5
  max_tokens: 1024
  messages:
    - role: user
      content: Hello
  YAML
  )
  ```

  ```python Python
  client = anthropic.Anthropic()


  def create_message_with_fast_fallback(max_retries=0, max_attempts=3, **params):
      try:
          return client.with_options(max_retries=max_retries).messages.create(**params)
      except anthropic.RateLimitError:
          if params.get("speed") == "fast":
              del params["speed"]
              return create_message_with_fast_fallback(max_retries=max_retries, **params)
          raise
      except (
          anthropic.APIStatusError,
          anthropic.APIConnectionError,
      ) as error:
          if isinstance(error, anthropic.APIStatusError) and error.status_code < 500:
              raise
          if max_attempts > 1:
              return create_message_with_fast_fallback(
                  max_retries=max_retries, max_attempts=max_attempts - 1, **params
              )
          raise


  message = create_message_with_fast_fallback(
      model="claude-opus-5-5",
      max_tokens=1024,
      messages=[{"role": "user", "content": "Hello"}],
      speed="fast",
      max_retries=0,
  )
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  async function createMessageWithFastFallback(
    params: Anthropic.MessageCreateParamsNonStreaming,
    requestOptions?: Anthropic.RequestOptions,
    maxAttempts: number = 3
  ): Promise<Anthropic.Message> {
    try {
      return await client.messages.create(params, requestOptions);
    } catch (e) {
      if (e instanceof Anthropic.RateLimitError && params.speed === "fast") {
        const { speed, ...rest } = params;
        return createMessageWithFastFallback(rest);
      }
      if (
        e instanceof Anthropic.InternalServerError ||
        e instanceof Anthropic.APIConnectionError
      ) {
        if (maxAttempts > 1) {
          return createMessageWithFastFallback(params, undefined, maxAttempts - 1);
        }
      }
      throw e;
    }
  }

  const message = await createMessageWithFastFallback(
    {
      model: "claude-opus-5-5",
      max_tokens: 1024,
      messages: [{ role: "user", content: "Hello" }],
      speed: "fast"
    },
    { maxRetries: 0 }
  );
  ```

  ```csharp C#
  AnthropicClient client = new();

  async Task<Message> CreateMessageWithFastFallback(
      MessageCreateParams parameters,
      int? maxRetries = null,
      int maxAttempts = 3)
  {
      try
      {
          var requestClient = maxRetries is int retries
              ? client.WithOptions(options => options with { MaxRetries = retries })
              : client;
          return await requestClient.Messages.Create(parameters);
      }
      catch (AnthropicRateLimitException)
      {
          if (parameters.Speed is not null)
          {
              return await CreateMessageWithFastFallback(
                  parameters with { Speed = null });
          }
          throw;
      }
      catch (Anthropic5xxException)
      {
          if (maxAttempts > 1)
          {
              return await CreateMessageWithFastFallback(
                  parameters, maxAttempts: maxAttempts - 1);
          }
          throw;
      }
  }

  var message = await CreateMessageWithFastFallback(
      new MessageCreateParams
      {
          Model = Model.ClaudeOpus5_5,
          MaxTokens = 1024,
          Messages = [new() { Role = Role.User, Content = "Hello" }],
          Speed = Speed.Fast,
      },
      maxRetries: 0);
  ```

  ```go Go
  func createMessageWithFastFallback(
  	ctx context.Context,
  	client *anthropic.Client,
  	params anthropic.MessageNewParams,
  	maxAttempts int,
  	opts ...option.RequestOption,
  ) (*anthropic.Message, error) {
  	message, err := client.Messages.New(ctx, params, opts...)
  	if err != nil {
  		var apierr *anthropic.Error
  		if errors.As(err, &apierr) && apierr.StatusCode == 429 && params.Speed != "" {
  			params.Speed = ""
  			return createMessageWithFastFallback(ctx, client, params, maxAttempts)
  		}
  		if (errors.As(err, &apierr) && apierr.StatusCode >= 500) || !errors.As(err, &apierr) {
  			if maxAttempts > 1 {
  				return createMessageWithFastFallback(ctx, client, params, maxAttempts-1)
  			}
  		}
  		return nil, err
  	}
  	return message, nil
  }

  func main() {
  	client := anthropic.NewClient()
  	message, err := createMessageWithFastFallback(
  		context.TODO(),
  		&client,
  		anthropic.MessageNewParams{
  			Model:     anthropic.ModelClaudeOpus5_5,
  			MaxTokens: 1024,
  			Messages: []anthropic.MessageParam{
  				anthropic.NewUserMessage(anthropic.NewTextBlock("Hello")),
  			},
  			Speed: anthropic.MessageNewParamsSpeedFast,
  		},
  		3,
  		option.WithMaxRetries(0),
  	)
  	if err != nil {
  		panic(err)
  	}
  	fmt.Println(message)
  }
  ```

  ```java Java
  import com.anthropic.errors.InternalServerException;
  import com.anthropic.errors.RateLimitException;
  // ...
  // SDKの自動リトライを無効にし、以下のフォールバック処理で対応します
  AnthropicClient client =
          AnthropicOkHttpClient.builder().fromEnv().maxRetries(0).build();

  Message createMessageWithFastFallback(
          MessageCreateParams params, int maxAttempts) {
      try {
          return client.messages().create(params);
      } catch (RateLimitException e) {
          if (params.speed().isPresent()) {
              MessageCreateParams retryParams = params.toBuilder()
                      .speed(Optional.empty())
                      .build();
              return createMessageWithFastFallback(retryParams, maxAttempts);
          }
          throw e;
      } catch (InternalServerException e) {
          if (maxAttempts > 1) {
              return createMessageWithFastFallback(params, maxAttempts - 1);
          }
          throw e;
      }
  }

  void main() {
      Message message = createMessageWithFastFallback(
              MessageCreateParams.builder()
                      .model(Model.CLAUDE_OPUS_5_5)
                      .maxTokens(1024L)
                      .addUserMessage("Hello")
                      .speed(MessageCreateParams.Speed.FAST)
                      .build(),
              3);
      message.content().stream()
              .flatMap(block -> block.text().stream())
              .forEach(textBlock -> IO.println(textBlock.text()));
  }
  ```

  ```php PHP
  use Anthropic\Core\Exceptions\APIConnectionException;
  use Anthropic\Core\Exceptions\InternalServerException;
  use Anthropic\Core\Exceptions\RateLimitException;
  use Anthropic\RequestOptions;
  // ...
  $client = new Client();

  function createMessageWithFastFallback(
      Client $client,
      array $params,
      ?RequestOptions $requestOptions = null,
      int $maxAttempts = 3,
  ) {
      try {
          return $client->messages->create(
              ...$params,
              requestOptions: $requestOptions,
          );
      } catch (RateLimitException $e) {
          if (isset($params['speed'])) {
              unset($params['speed']);
              return createMessageWithFastFallback($client, $params);
          }
          throw $e;
      } catch (InternalServerException | APIConnectionException $e) {
          if ($maxAttempts > 1) {
              return createMessageWithFastFallback(
                  $client, $params, maxAttempts: $maxAttempts - 1
              );
          }
          throw $e;
      }
  }

  $message = createMessageWithFastFallback(
      $client,
      [
          'model' => 'claude-opus-5-5',
          'maxTokens' => 1024,
          'messages' => [['role' => 'user', 'content' => 'Hello']],
          'speed' => 'fast',
      ],
      RequestOptions::with(maxRetries: 0),
  );
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  def create_message_with_fast_fallback(client, request_options: {}, max_attempts: 3, **params)
    client.messages.create(**params, request_options: request_options)
  rescue Anthropic::Errors::RateLimitError
    raise unless params[:speed] == "fast"
    params.delete(:speed)
    create_message_with_fast_fallback(client, **params)
  rescue Anthropic::Errors::InternalServerError, Anthropic::Errors::APIConnectionError
    raise unless max_attempts > 1
    create_message_with_fast_fallback(client, max_attempts: max_attempts - 1, **params)
  end

  message = create_message_with_fast_fallback(
    client,
    model: "claude-opus-5-5",
    max_tokens: 1024,
    messages: [{ role: "user", content: "Hello" }],
    speed: "fast",
    request_options: { max_retries: 0 }
  )
  ```
</CodeGroup>

## 考慮事項

* **プロンプトキャッシング：** 高速と標準速度を切り替えると、プロンプトキャッシュが無効になります。異なる速度のリクエスト間では、キャッシュされたプレフィックスは共有されません。
* **TTFT：** 高速モードの利点は、最初のトークンまでの時間（TTFT）ではなく、1秒あたりの出力トークン数（OTPS）に重点が置かれています。
* **Batch API：** 高速モードは[Batch API](https://platform.claude.com/docs/ja/build-with-claude/batch-processing)では利用できません。
* **Priority Tier：** 高速モードは[Priority Tier](https://platform.claude.com/docs/ja/api/service-tiers)のコミットメントでは利用できません。
* **Claude Platform on AWS：** 高速モードは現在、[Claude Platform on AWS](https://platform.claude.com/docs/ja/build-with-claude/claude-platform-on-aws)では利用できません。

## 次のステップ

<CardGroup cols={2}>
  <Card title="構造化出力" icon="code-brackets" href="https://platform.claude.com/docs/ja/build-with-claude/structured-outputs">
    エージェントワークフローから検証済みのJSON結果を取得します。
  </Card>

  <Card title="料金" icon="calculator" href="https://platform.claude.com/docs/ja/about-claude/pricing#fast-mode-pricing">
    モデルと機能に関するAnthropicの料金体系について学びます。
  </Card>

  <Card title="エフォート" icon="gauge" href="https://platform.claude.com/docs/ja/build-with-claude/effort">
    effortパラメータを使用して、Claudeが応答時に使用するトークン数を制御し、応答の徹底度とトークン効率のバランスを調整します。
  </Card>

  <Card title="メッセージのストリーミング" icon="arrow-right" href="https://platform.claude.com/docs/ja/build-with-claude/streaming">
    テキスト、ツール使用、拡張思考のデルタを含むMessages APIのレスポンスを、サーバー送信イベントで段階的にストリーミングします。
  </Card>
</CardGroup>
