SPB Git

Repository Public

service-tiers.md 8.6 KB 233 lines markdown

1---2title: Service tiers3url: https://platform.claude.com/docs/en/api/service-tiers4description: Different tiers of service allow you to balance availability, performance, and predictable costs based on your application's needs.5---67<Warning>8  Priority Tier capacity commitments are no longer available for purchase. Organizations with an existing commitment can continue to use Priority Tier through their contract end date, and this page remains available as a reference for them. If you need guaranteed capacity, [contact sales](https://claude.com/contact-sales).9</Warning>1011Anthropic offers three service tiers:1213* **Priority Tier:** Available only to organizations with an existing capacity commitment14* **Standard:** Default tier for both piloting and scaling everyday use cases15* **Batch:** Best for asynchronous workflows that can wait or benefit from being outside your normal capacity1617## Standard tier1819The standard tier is the default service tier for all API requests. The API prioritizes these requests alongside all other requests with best-effort availability.2021## Priority Tier2223The API prioritizes requests in this tier over all other requests. This prioritization helps minimize ["server overloaded" errors](https://platform.claude.com/docs/en/api/errors#http-errors), even during peak times.2425For more information, see [Existing Priority Tier commitments](https://platform.claude.com/docs/en/api/service-tiers#existing-priority-tier-commitments).2627## How requests get assigned tiers2829When handling a request, Anthropic decides to assign a request to Priority Tier in the following scenarios:3031* Your organization has sufficient Priority Tier capacity **input** tokens per minute32* Your organization has sufficient Priority Tier capacity **output** tokens per minute3334Anthropic counts usage against Priority Tier capacity as follows:3536**Input tokens**3738* Cache reads as 0.1 tokens per token read from the cache39* Cache writes as 1.25 tokens per token written to the cache with a 5 minute TTL40* Cache writes as 2.00 tokens per token written to the cache with a 1 hour TTL41* For [US-only inference](https://platform.claude.com/docs/en/manage-claude/data-residency) (`inference_geo: "us"`) requests on Claude 4.6 and later models, input tokens are 1.1 tokens per token42* All other input tokens are 1 token per token4344**Output tokens**4546* For [US-only inference](https://platform.claude.com/docs/en/manage-claude/data-residency) (`inference_geo: "us"`) requests on Claude 4.6 and later models, output tokens are 1.1 tokens per token47* All other output tokens are 1 token per token4849Otherwise, requests proceed at standard tier.5051<Note>52  These burndown rates reflect the relative pricing of each token type. For example, US-only inference is priced at 1.1x on Claude 4.6 and later models, so each token consumed with `inference_geo: "us"` draws down 1.1 tokens from your Priority Tier capacity.53</Note>5455<Note>56  Requests assigned Priority Tier pull from both the Priority Tier capacity and the regular rate limits. If servicing the request would exceed the rate limits, the request is declined.57</Note>5859## Using service tiers6061You can control which service tiers can be used for a request by setting the `service_tier` parameter:6263<CodeGroup>64  ```bash cURL65  curl https://api.anthropic.com/v1/messages \66    -H "x-api-key: $ANTHROPIC_API_KEY" \67    -H "anthropic-version: 2023-06-01" \68    -H "content-type: application/json" \69    -d '{70      "model": "claude-opus-4-8",71      "max_tokens": 1024,72      "messages": [{"role": "user", "content": "Hello, Claude!"}],73      "service_tier": "auto"74    }'75  ```7677  ```bash CLI78  ant messages create --transform usage.service_tier --raw-output <<'YAML'79  model: claude-opus-4-880  max_tokens: 102481  messages:82    - role: user83      content: Hello, Claude!84  service_tier: auto  # Automatically use Priority Tier when available, fallback to standard85  YAML86  ```8788  ```python Python89  client = anthropic.Anthropic()9091  message = client.messages.create(92      model="claude-opus-4-8",93      max_tokens=1024,94      messages=[{"role": "user", "content": "Hello, Claude!"}],95      service_tier="auto",  # Automatically use Priority Tier when available, fallback to standard96  )97  print(message.usage.service_tier)98  ```99100  ```typescript TypeScript101  const client = new Anthropic();102103  const message = await client.messages.create({104    model: "claude-opus-4-8",105    max_tokens: 1024,106    messages: [{ role: "user", content: "Hello, Claude!" }],107    service_tier: "auto" // Automatically use Priority Tier when available, fallback to standard108  });109  console.log(message.usage.service_tier);110  ```111112  ```csharp C#113  AnthropicClient client = new();114115  var message = await client.Messages.Create(new MessageCreateParams116  {117      Model = Model.ClaudeOpus4_8,118      MaxTokens = 1024,119      Messages = [new() { Role = Role.User, Content = "Hello, Claude!" }],120      ServiceTier = ServiceTier.Auto, // Automatically use Priority Tier when available, fallback to standard121  });122  Console.WriteLine(message.Usage.ServiceTier);123  ```124125  ```go Go126  client := anthropic.NewClient()127128  message, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{129  	Model:     anthropic.ModelClaudeOpus4_8,130  	MaxTokens: 1024,131  	Messages: []anthropic.MessageParam{132  		anthropic.NewUserMessage(anthropic.NewTextBlock("Hello, Claude!")),133  	},134  	// Automatically use Priority Tier when available, fallback to standard135  	ServiceTier: anthropic.MessageNewParamsServiceTierAuto,136  })137  if err != nil {138  	log.Fatal(err)139  }140  fmt.Println(message.Usage.ServiceTier)141  ```142143  ```java Java144  AnthropicClient client = AnthropicOkHttpClient.fromEnv();145146  MessageCreateParams params = MessageCreateParams.builder()147      .model(Model.CLAUDE_OPUS_4_8)148      .maxTokens(1024L)149      .addUserMessage("Hello, Claude!")150      // Automatically use Priority Tier when available, fallback to standard151      .serviceTier(MessageCreateParams.ServiceTier.AUTO)152      .build();153154  Message message = client.messages().create(params);155  IO.println(message.usage().serviceTier().orElseThrow());156  ```157158  ```php PHP159  $client = new Client();160161  $message = $client->messages->create(162      model: 'claude-opus-4-8',163      maxTokens: 1024,164      messages: [['role' => 'user', 'content' => 'Hello, Claude!']],165      serviceTier: 'auto', // Automatically use Priority Tier when available, fallback to standard166  );167  echo $message->usage->serviceTier;168  ```169170  ```ruby Ruby171  client = Anthropic::Client.new172173  message = client.messages.create(174    model: "claude-opus-4-8",175    max_tokens: 1024,176    messages: [{ role: "user", content: "Hello, Claude!" }],177    service_tier: :auto # Automatically use Priority Tier when available, fallback to standard178  )179  puts(message.usage.service_tier)180  ```181</CodeGroup>182183The `service_tier` parameter accepts the following values:184185* `"auto"` (default) - Uses the Priority Tier capacity if available, falling back to your other capacity if not186* `"standard_only"` - Only use standard tier capacity, useful if you don't want to use your Priority Tier capacity187188The response `usage` object also includes the service tier assigned to the request:189190```json191{192  "usage": {193    "input_tokens": 410,194    "cache_creation_input_tokens": 0,195    "cache_read_input_tokens": 0,196    "output_tokens": 585,197    "service_tier": "priority"198  }199}200```201202This allows you to determine which service tier was assigned to the request.203204When requesting `service_tier="auto"` with a model with a Priority Tier commitment, these response headers provide insights:205206```text wrap207anthropic-priority-input-tokens-limit: 10000208anthropic-priority-input-tokens-remaining: 9618209anthropic-priority-input-tokens-reset: 2025-01-12T23:11:59Z210anthropic-priority-output-tokens-limit: 10000211anthropic-priority-output-tokens-remaining: 6000212anthropic-priority-output-tokens-reset: 2025-01-12T23:12:21Z213```214215You can use the presence of these headers to detect if your request was eligible for Priority Tier, even if it was over the limit.216217## Existing Priority Tier commitments218219A Priority Tier commitment consists of:220221* A number of input tokens per minute222* A number of output tokens per minute223* A commitment duration (1, 3, 6, or 12 months)224* A specific model version225226Priority Tier targets 99.5% uptime with prioritized computational resources. Requests beyond your committed capacity automatically fall back to standard tier.227228### Supported models229230Priority Tier is supported on all available Claude models except Claude Fable 5.1, Claude Mythos 5.1, Claude Mythos 5, [Claude Mythos Preview](https://anthropic.com/glasswing), Claude Opus 5, and Claude Sonnet 5.231232Check the [Models overview](https://platform.claude.com/docs/en/models/overview) for more details on available models.233
Files main
Menu

Theme