Agents · best for

Top picks for Function / Tool Calling (2026)

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

Updated 2026-10-13 · 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? OpenAI: GPT-5 tops this ranking on blended score. If cost drives the decision, OpenAI: o3 (batch) is the cheapest of the leaders at $1.00/M input.

#ModelScoreIn / 1MOut / 1MContext
1 OpenAI: GPT-5openai/gpt-5 130 $1.25 $10.00 400,000 Details →
2 OpenAI: GPT-5 (batch)openai/gpt-5:batch 130 $0.62 $5.00 400,000 Details →
3 Google: Gemini 2.5 Progoogle/gemini-2.5-pro 130 $1.25 $10.00 1,048,576 Details →
4 Google: Gemini 2.5 Pro (batch)google/gemini-2.5-pro:batch 130 $0.62 $5.00 1,048,576 Details →
5 OpenAI: o3openai/o3 129 $2.00 $8.00 200,000 Details →
6 OpenAI: o3 (batch)openai/o3:batch 129 $1.00 $4.00 200,000 Details →
7 Anthropic: Claude Opus 4.7 (batch)anthropic/claude-opus-4.7:batch 128 $2.50 $12.50 1,000,000 Details →
8 OpenAI: o4 Mini Highopenai/o4-mini-high 128 $1.10 $4.40 200,000 Details →
9 OpenAI: o4 Miniopenai/o4-mini 128 $1.10 $4.40 200,000 Details →
10 OpenAI: o4 Mini (batch)openai/o4-mini:batch 128 $0.55 $2.20 200,000 Details →
11 Anthropic: Claude Sonnet 4.6anthropic/claude-sonnet-4.6 127 $3.00 $15.00 1,000,000 Details →
12 Anthropic: Claude Sonnet 4.6 (batch)anthropic/claude-sonnet-4.6:batch 127 $1.50 $7.50 1,000,000 Details →
13 OpenAI: o3 Mini Highopenai/o3-mini-high 127 $1.10 $4.40 200,000 Details →
14 Google: Gemini 2.5 Flashgoogle/gemini-2.5-flash 126 $0.30 $2.50 1,048,576 Details →
15 Google: Gemini 2.5 Flash (batch)google/gemini-2.5-flash:batch 126 $0.15 $1.25 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

The Model Movers Report

One email every Friday, built from this site's own rankings: the current top five by benchmark score, every model released in the last seven days, and one note worked out from that week's numbers. You can unsubscribe from any issue with one click.