Tool use pricing and tokens

Tool use requests are priced the same as any other Claude API request, based on the total number of input tokens sent to the model (including in the tools parameter) and the number of output tokens generated.

The additional tokens from tool use come from:

  • The tools parameter in API requests (tool names, descriptions, and schemas)
  • tool_use content blocks in API requests and responses
  • tool_result content blocks in API requests

When you use tools, we also automatically include a special system prompt for the model which enables tool use. The number of tool use tokens required for each model are listed below (excluding the additional tokens listed above):

ModelTool use system prompt token count
Claude 3 Opus395 tokens
Claude 3 Sonnet159 tokens
Claude 3 Haiku264 tokens

These token counts are added to your normal input and output tokens to calculate the total cost of a request. Refer to our models overview table for current per-model prices.

When you send a tool use prompt, just like any other API request, the response will output both input and output token counts as part of the reported usage metrics.

Keep in mind that tool use often requires multiple round-trips between your code and Claude (to execute tools and return results), so a single end-user query may result in several API requests and associated token costs. Design your tools and prompts to be as concise as possible while still providing enough information for Claude to effectively use the tools.