Tool/Function Calling
Let Parasail models call your functions and tools via the Chat Completions and Responses APIs.
Overview
Tool (function) calling lets a model decide when to invoke an external function—a weather API, a database query, a calculator—and emit a structured request for it. Your application runs the function and feeds the result back to the model.
Parasail exposes tool calling through two OpenAI-compatible surfaces:
Chat Completions API (
/v1/chat/completions)—the classic single-call interface. You passtools, inspectmessage.tool_calls, run the tool, and append atoolmessage for the next call.Responses API (
/v1/responses)—the newer agentic interface built for multi-step loops. You passtools, inspectresponse.outputforfunction_callitems, and appendfunction_call_outputitems.
Both use the same base URL and API key:
https://api.parasail.io/v1The tool schema (name, description, JSON Schema parameters) is the same in both APIs—only the wrapper shape and the response handling differ. Pick Chat Completions for simple one-shot tool calls, and the Responses API for multi-turn agentic workflows.
Supported models
The following models support tool calling and tool_choice as of June 2026. Verify current availability via the models endpoint.
Treat this table as a starting point for validation. Test your actual tool schema and prompt before depending on tool calls in production.
parasail-llama-33-70b-fp8
✅
✅
parasail-llama-4-scout-instruct
✅
✅
parasail-llama-4-maverick-instruct-fp8
✅
✅
parasail-qwen3-30b-a3b
✅
✅
parasail-qwen3-235b-a22b
✅
✅
parasail-qwen3-32b
✅
✅
parasail-mistral-devstral-small
✅
✅
In the Chat Completions API, each tool must be wrapped as {"type": "function", "function": {...}}. The function object holds the name, description, and a JSON Schema parameters.
Expected arguments:
Returning the tool result
Run your function, then append the assistant's tool call and a tool message with the result before calling the model again:
In the Responses API, tools are defined with a flat shape—type, name, description, and parameters at the top level (no nested function object). Tool calls come back as function_call items in response.output, and you return results as function_call_output items.
The Responses API requires store=False on every request. See the Responses API reference for the full compatibility table.
Chat Completions tools vs. Responses tools
Tool definition
{"type": "function", "function": {name, description, parameters}}
{"type": "function", name, description, parameters} (flat)
Where calls appear
message.tool_calls[]
response.output[] items with type == "function_call"
Returning results
{"role": "tool", "tool_call_id": ..., "content": ...}
{"type": "function_call_output", "call_id": ..., "output": ...}
Best for
One-shot tool calls
Multi-step agentic loops
The underlying schema—the function name, description, and JSON Schema parameters—is identical between the two; only the wrapper and the result-handling differ.
Next steps
Last updated