For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

Approach
Best for
API

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/v1

  • Required: Set store: false on every request (server-side state is not supported).

Relevant guides

API reference

Last updated