---
title: 快速模式
url: https://platform.claude.com/docs/zh-CN/build-with-claude/fast-mode
description: 从受支持的 Claude 模型获得最高 2.5 倍的每秒输出令牌数。
---

快速模式（fast mode）以溢价定价为 Claude Opus 5.5、Claude Opus 5 和 Claude Opus 4.8 提供最高 2.5 倍的每秒输出令牌数。如需启用，请在请求中设置 `speed: "fast"`。

<Note>
  Claude Opus 5.5 的快速模式不需要 `fast-mode-2026-02-01` beta 标头，也不需要申请访问权限。仍然发送该标头的请求可以继续正常工作。Claude Opus 5 和 Claude Opus 4.8 的快速模式处于研究预览阶段：请联系您的客户经理或[加入等候名单](https://claude.com/fast-mode)以申请访问权限，并在您的请求中发送 [beta 标头](https://platform.claude.com/docs/zh-CN/api/beta-headers)。
</Note>

<Note>
  要了解"zero data retention"（零数据保留），即 ZDR 如何适用于此功能，请参阅 [API 与数据保留](https://platform.claude.com/docs/zh-CN/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/zh-CN/managed-agents/overview)<br />[Claude in Microsoft Foundry](https://platform.claude.com/docs/zh-CN/build-with-claude/claude-in-microsoft-foundry)，适用于托管在 Azure 上的部署 |
| Claude Opus 5 (claude-opus-5)     | Claude API，包括 [Claude Managed Agents](https://platform.claude.com/docs/zh-CN/managed-agents/overview)                                                                                                                                            |
| Claude Opus 4.8 (claude-opus-4-8) | Claude API，包括 [Claude Managed Agents](https://platform.claude.com/docs/zh-CN/managed-agents/overview)                                                                                                                                            |

如果您之前在较早的模型上使用快速模式，请[迁移到支持快速模式的模型](https://platform.claude.com/docs/zh-CN/models/opus-5-5/migration-guide)。

快速模式不适用于[托管在 Anthropic 上](https://platform.claude.com/docs/zh-CN/build-with-claude/claude-in-microsoft-foundry#hosting-options)的 Claude in Microsoft Foundry 部署。

## 快速模式的工作原理

快速模式使用更快的推理配置运行同一模型。智能或能力没有任何变化。

* 与标准速度相比，每秒输出令牌数最高提升 2.5 倍
* 速度优势集中在"output tokens per second"（每秒输出令牌数），即 OTPS，而非"time to first token"（首令牌时间），即 TTFT
* 相同的模型权重和行为（不是不同的模型）
* 与 [streaming（流式传输）](https://platform.claude.com/docs/zh-CN/build-with-claude/streaming)兼容，在流式传输中 OTPS 的提升最为明显

## 基本用法

处于研究预览阶段的模型还需要 `fast-mode-2026-02-01` [beta 标头](https://platform.claude.com/docs/zh-CN/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>

## 定价

快速模式的定价是在整个 context window（上下文窗口）范围内对标准费率乘以一个倍数，包括超过 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/zh-CN/about-claude/pricing#prompt-caching)在快速模式定价之上叠加适用
* [数据驻留](https://platform.claude.com/docs/zh-CN/manage-claude/data-residency)倍数在快速模式定价之上叠加适用

有关完整的定价详情，请参阅[定价](https://platform.claude.com/docs/zh-CN/about-claude/pricing#fast-mode-pricing)页面。

## 速率限制

快速模式拥有专用的 rate limit（速率限制），与标准 Opus 速率限制相互独立。当超出您的快速模式速率限制时，API 会返回 `429` 错误，并附带 `retry-after` 标头，指示容量何时可用。

Claude Opus 5.5 在 Start、Build 和 Scale [使用层级](https://platform.claude.com/docs/zh-CN/api/rate-limits)中都有默认的快速模式速率限制，因此您无需申请访问权限即可在该模型上使用快速模式。处于 Evaluation 层级的组织在升级到 Start、Build 或 Scale 层级后，即可在 Claude Opus 5.5 上使用快速模式。

响应中包含指示您的快速模式速率限制状态的标头：

| 标头                                       | 描述               |
| ---------------------------------------- | ---------------- |
| `anthropic-fast-input-tokens-limit`      | 每分钟快速模式输入令牌的最大数量 |
| `anthropic-fast-input-tokens-remaining`  | 剩余的快速模式输入令牌数     |
| `anthropic-fast-input-tokens-reset`      | 快速模式输入令牌限制重置的时间  |
| `anthropic-fast-output-tokens-limit`     | 每分钟快速模式输出令牌的最大数量 |
| `anthropic-fast-output-tokens-remaining` | 剩余的快速模式输出令牌数     |
| `anthropic-fast-output-tokens-reset`     | 快速模式输出令牌限制重置的时间  |

要查看您的快速模式速率限制，请前往 Claude Console 中的[速率限制](https://platform.claude.com/usage/limits)页面。

## 检查使用了哪种速度

响应的 `usage` 对象包含一个 `speed` 字段，用于指示使用了哪种速度，值为 `"fast"` 或 `"standard"`。在[不支持快速模式的模型](https://platform.claude.com/docs/zh-CN/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` beta 标头的请求不会返回错误，而是会成功，但以标准速度运行。这一行为会在 `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"
  }
}
```

要跟踪整个组织的快速模式使用情况和成本，请参阅[使用量和成本 API](https://platform.claude.com/docs/zh-CN/manage-claude/usage-cost-api)。

## 重试与回退

### 自动重试

当超出快速模式速率限制时，API 会返回 `429` 错误，并附带 `retry-after` 标头。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>
  从快速速度回退到标准速度将导致 [prompt cache（提示缓存）](https://platform.claude.com/docs/zh-CN/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：** 快速模式的优势集中在每秒输出令牌数（OTPS），而非首令牌时间（TTFT）。
* **Batch API：** 快速模式不适用于 [Batch API](https://platform.claude.com/docs/zh-CN/build-with-claude/batch-processing)。
* **Priority Tier：** 快速模式不适用于 [Priority Tier](https://platform.claude.com/docs/zh-CN/api/service-tiers) 承诺。
* **Claude Platform on AWS：** 快速模式目前不适用于 [Claude Platform on AWS](https://platform.claude.com/docs/zh-CN/build-with-claude/claude-platform-on-aws)。

## 后续步骤

<CardGroup cols={2}>
  <Card title="结构化输出" icon="code-brackets" href="https://platform.claude.com/docs/zh-CN/build-with-claude/structured-outputs">
    从智能体工作流中获取经过验证的 JSON 结果。
  </Card>

  <Card title="定价" icon="calculator" href="https://platform.claude.com/docs/zh-CN/about-claude/pricing#fast-mode-pricing">
    了解 Anthropic 针对模型和功能的定价结构。
  </Card>

  <Card title="Effort" icon="gauge" href="https://platform.claude.com/docs/zh-CN/build-with-claude/effort">
    使用 effort 参数控制 Claude 在响应时使用多少令牌，在响应的详尽程度与令牌效率之间进行权衡。
  </Card>

  <Card title="流式传输消息" icon="arrow-right" href="https://platform.claude.com/docs/zh-CN/build-with-claude/streaming">
    通过服务器发送事件以增量方式流式传输 Messages API 响应，包括文本、工具使用和扩展思考增量。
  </Card>
</CardGroup>
