Agents · best for

Top picks for Function / Tool Calling (2026)

Reliable JSON tool-call generation. Ranked from 425 live models on the OpenRouter catalog, weighted for tool calling, structured output.

Updated 2026-09-07 · prices checked at this morning's rebuild

What this is Ranked by capability match + real benchmark scores (Aider Polyglot, Artificial Analysis Intelligence Index) + live pricing. Models need the right specs for Function / Tool Calling, then benchmark performance refines the order. Full methodology →

Which should you use? Anthropic: Claude Opus 4.7 (batch) tops this ranking on blended score. If cost drives the decision, Z.ai: GLM 5.3 Flash is the cheapest of the leaders at $0.07/M input.

#ModelScoreIn / 1MOut / 1MContext
1 Anthropic: Claude Opus 4.7 (batch)anthropic/claude-opus-4.7:batch 160 $2.50 $12.50 1,000,000 Details →
2 Claude Opus 5 (batch)anthropic/claude-opus-5:batch 157 $2.50 $12.50 1,000,000 Details →
3 Meta: Muse Spark 1.3meta/muse-spark-1.3 157 $1.25 $4.25 1,048,576 Details →
4 Anthropic: Claude Sonnet 4.6anthropic/claude-sonnet-4.6 157 $3.00 $15.00 1,000,000 Details →
5 Anthropic: Claude Sonnet 4.6 (batch)anthropic/claude-sonnet-4.6:batch 157 $1.50 $7.50 1,000,000 Details →
6 SpaceXAI: Grok 4.6x-ai/grok-4.6 156 $2.00 $6.00 500,000 Details →
7 Z.ai: GLM 5.3 Flashz-ai/glm-5.3-flash 156 $0.07 $0.25 1,310,720 Details →
8 Z.ai: GLM 5.3 Flash (batch)z-ai/glm-5.3-flash:batch 156 $0.15 $0.50 1,048,575 Details →
9 MoonshotAI: Kimi K3moonshotai/kimi-k3 155 $3.00 $15.00 1,048,576 Details →
10 MoonshotAI: Kimi K3 (batch)moonshotai/kimi-k3:batch 155 $3.00 $15.00 1,048,576 Details →
11 Anthropic: Claude Opus 4.7anthropic/claude-opus-4.7 155 $5.00 $25.00 1,000,000 Details →
12 OpenAI: GPT-5.6 Solopenai/gpt-5.6-sol 155 $2.00 $10.00 1,050,000 Details →
13 OpenAI: GPT-5.6 Sol (batch)openai/gpt-5.6-sol:batch 155 $1.00 $5.00 1,050,000 Details →
14 Qwen: Qwen3.8 Max (0902)qwen/qwen3.8-max-0902 155 $2.00 $6.00 1,000,000 Details →
15 DeepSeek: DeepSeek V4 Flash Vision Expdeepseek/deepseek-v4-flash-vision-exp 154 $0.22 $0.66 1,048,576 Details →
AI Apps OnSpace AI Build and deploy AI-powered apps without code.
Try free →

Affiliate link. PicksByModel may earn a commission at no extra cost to you.

How we ranked these

For Function / Tool Calling, we weight models on tool calling, structured output. Scores combine each model's public specs with independent benchmark results (Aider Polyglot coding scores, Artificial Analysis intelligence/coding/agentic indices) and live pricing. See full methodology →

About Function / Tool Calling

Function calling is the task of generating properly formatted JSON that maps user intent to specific tool or API invocations. You need it when building agents, chatbots, or automation systems that must reliably execute external functions rather than generate freeform text. A good model produces valid, schema-compliant JSON consistently, with correct parameter mapping and no hallucinated fields; a poor one generates malformed JSON, invents tool names, or misaligns arguments to the wrong functions. The main cost consideration is that stricter models (like Claude 3.5 Sonnet with native tool_use) reduce parsing failures and retry loops, lowering total token spend despite higher per-call cost.

When to use: Use this when you need an AI to decide which real action to take (book a flight, query a database, send an email) rather than just talk about it. The AI should output a specific instruction the computer can immediately execute.

Common questions

Which models are best at function calling without generating invalid JSON?

Claude 3.5 Sonnet and GPT-4 Turbo both excel here, with Claude's native tool_use mode offering the lowest error rate for schema compliance. Open-source models like Llama 2 70B can work with strict prompt engineering, but require more retry overhead and validation logic.

How much slower is function calling compared to regular text generation?

Function calling typically adds 10-20% latency because models must reason about which tool to call before generating JSON. If you're calling multiple tools in sequence (a multi-step agent), latency compounds, but intelligent caching and parallel tool execution can offset this cost.

Related tasks