Agents and Tool Calling
Build agentic workflows with function calling, multi-step reasoning, and tool use on Parasail.
Build AI agents that can call functions, reason across multiple steps, and interact with external tools. Parasail supports both the Chat Completions API with tool calling and the Responses API for multi-turn agentic workflows.
Two approaches
Chat Completions + tools
Single-model function calling
/v1/chat/completions
Responses API
Multi-turn agentic loops, parallel tool calls
/v1/responses
Function calling with Chat Completions
from openai import OpenAI
import json
client = OpenAI(
base_url="https://api.parasail.io/v1",
api_key="<PARASAIL_API_KEY>"
)
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a city.",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"}
},
"required": ["city"]
}
}
}
]
response = client.chat.completions.create(
model="parasail-deepseek-r1",
messages=[{"role": "user", "content": "What's the weather in Tokyo?"}],
tools=tools
)
print(response.choices[0].message.tool_calls)Responses API (multi-turn agentic)
The Responses API supports multi-turn conversations with parallel tool calls. It uses the standard Parasail gateway:
Base URL:
https://api.parasail.io/v1Required: Set
store: falseon every request (server-side state is not supported).
Relevant guides
Tool/Function Calling guide—detailed function calling tutorial
API reference
Responses API—full spec, compatibility table, and agentic loop example
Last updated