← Blog

Best Function Calling Models: What to Pick and Why

2026-09-16 · 5 min read · SubToAPI Team

Best Function Calling Models: What to Pick and Why

If you're building an agent, a support bot, or any system where the model needs to call your code — search a database, hit an internal API, book something — you need a model that reliably decides when to call a tool, picks the right one, and produces valid structured arguments. That's what "function calling" (also called tool use) measures, and not every model does it equally well.

The short answer: Claude (especially Claude Opus and Sonnet), GPT-4-class models, and Gemini 1.5/2.0 Pro are currently the strongest general-purpose function calling models. Among these, Claude tends to produce more consistent JSON schema adherence and handles multi-step tool chains (calling one tool, reading the result, calling another) with fewer malformed calls. Below is a breakdown of what actually matters when comparing these models, and how to put whichever one you pick behind a clean API.

What "Best" Actually Means Here

Function calling quality isn't one number. When people ask which model is best at it, they're usually asking about a mix of these:

Benchmarks like Berkeley's Function-Calling Leaderboard are a useful signal, but they test narrow, synthetic tasks. Your own tool schemas, your own edge cases, and your own error-handling code matter more than a leaderboard rank.

How the Leading Models Compare

Claude (Opus, Sonnet, Haiku) Claude's tool use implementation is explicit: you define tools with JSON schemas, Claude either responds with text or a tool_use block containing structured input, and you send the result back as a tool_result. In practice, Claude is strong at knowing when not to call a tool, which reduces false-positive calls — a common failure mode in weaker models that call a function just because one is available. It also handles long tool-result payloads and chained calls well, which matters for agents that do several lookups before answering.

GPT-4 / GPT-4o OpenAI's function calling (now under the "tools" API) is mature and widely supported by frameworks. It's competitive on schema adherence and parallel calls. Where it sometimes lags is in longer agentic loops — it can occasionally re-call a tool with slightly malformed arguments after several turns, which means you still need validation and retry logic in your code regardless of model.

Gemini 1.5 / 2.0 Gemini's function calling has improved a lot and is a solid choice if you're already inside Google's ecosystem, but schema strictness has historically been less consistent than Claude's, especially with nested objects or enums. Worth testing directly against your schemas before committing.

Open models (Llama 3.1/3.3, Mistral, Qwen) Open-weight models have closed the gap for simple, single-tool tasks, especially when fine-tuned for function calling. For complex multi-tool agents with strict schema requirements, they still generally trail the closed frontier models on reliability, though this changes fast and is worth re-testing per release.

What This Looks Like in Practice

Regardless of which model wins on paper, you still need the same infrastructure: schema definitions, a loop that sends tool results back, error handling for malformed arguments, and usage tracking. This is exactly the layer SubToAPI sits on. It turns your existing Claude access into a standard HTTPS API — application keys (sub_live_...), streaming, tool use, and usage metadata in one dashboard — so you don't have to build that plumbing yourself.

A basic tool call through SubToAPI's Messages endpoint looks like this:

curl https://api.subtoapi.app/v1/messages \
  -H "Authorization: Bearer $SUBTOAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet",
    "max_tokens": 512,
    "tools": [
      {
        "name": "get_weather",
        "description": "Get current weather for a city",
        "input_schema": {
          "type": "object",
          "properties": {
            "city": { "type": "string" }
          },
          "required": ["city"]
        }
      }
    ],
    "messages": [
      { "role": "user", "content": "What is the weather in Lisbon?" }
    ]
  }'

The response includes a tool_use block with structured input for get_weather. You run the function, then send the result back in the next message as a tool_result to let the model finish its answer. Full details, including multi-step loops and parallel calls, are in the tools docs and the messages docs.

If you're evaluating model quality for function calling specifically, the fastest path is to spin up a handful of your real tool schemas, run the same prompts through Claude via the quickstart, and compare tool-call accuracy against whatever else you're testing. Since SubToAPI gives you application-scoped API keys and usage metadata per key, it's easy to run this kind of comparison across a team without sharing raw credentials — see pricing if you want seat-based access for multiple developers running evals in parallel.

Choosing for Your Use Case

There's no single "best" function calling model for every case, but Claude and GPT-4-class models are the safest starting point for most production agents today, with Gemini a strong contender if you're already in that ecosystem. Test against your own tool schemas before deciding — that's the only benchmark that actually predicts production behavior.

Questions

Which model is best at function calling right now? Claude and GPT-4-class models are generally the most reliable for multi-tool, multi-step agentic use, with Claude often producing more consistent schema adherence. Gemini and strong open models are competitive for simpler, single-tool tasks.

Do I need to fine-tune a model for function calling? No, in most cases. The leading models support native tool/function calling APIs out of the box — you define a JSON schema and the model returns structured arguments. Fine-tuning only helps for very narrow, high-volume, repetitive tool patterns.

How do I test function calling quality for my own use case? Run your real tool schemas and prompts, not generic benchmarks. Measure schema adherence, false-positive tool calls, and behavior across multi-step chains. You can do this quickly against Claude through SubToAPI's Messages API using your own tool definitions.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →