Function calling & tool integration with the innoGPT API
With the Responses API, you can define your own tools (functions) that the AI model can call during a conversation. This forms the basis for agents, workflows with n8n, database queries, external API calls, and much more.
💡 Also works with n8n, Make, Zapier, and LangChain. Since the innoGPT API is OpenAI-compatible, you can use it in any tool that supports OpenAI as a provider. The complete interactive documentation for live testing is available when logged in under Settings → API → Documentation.
How Function Calling works
Define tools — you describe functions using JSON schema
Model decides — it analyzes the request and calls a tool if necessary
You execute — your code calls the actual function with the arguments
Return result — the model incorporates the result into its response
Example: Weather Tool
curl -X POST https://app.innogpt.de/api/ext/v1/responses \
-H "Authorization: Bearer $INNOGPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5",
"input": "Wie ist das Wetter in Berlin?",
"tools": [
{
"type": "function",
"name": "get_weather",
"description": "Aktuelles Wetter für einen Ort abrufen",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "Stadtname, z. B. Berlin, Paris"
},
"units": {
"type": "string",
"enum": ["celsius", "fahrenheit"]
}
},
"required": ["location"]
}
}
]
}'
Tool definition: Schema
Control Tool Choice
With `tool_choice`, you define how aggressively the model should use tools:
Parallel tool calls
By default, the model can execute multiple tools in parallel:
{
"model": "gpt-5",
"input": "Wie ist das Wetter in Paris, Tokio und New York?",
"tools": [...],
"parallel_tool_calls": true
}
⚠️ Known behavior: Anthropic and Google models do not always strictly adhere to the OpenAI convention when dealing with complex tool arguments (e.g., escaping in arrays). For purely parallel multi-tool scenarios in n8n workflows, GPT and Mistral models are generally the most reliable choice. Please contact the support team if you encounter any issues.
With `parallel_tool_calls: false`, tools are executed sequentially.
Limit Tool Loop
Prevents "tool runaways" caused by faulty model logic:
{
"model": "gpt-5",
"input": "Recherchiere zu Thema X",
"tools": [...],
"max_tool_calls": 5
}
The default is 10 tool calls per response.
Practical examples
Database query
{
"type": "function",
"name": "query_orders",
"description": "Bestellungen aus der Datenbank abfragen",
"parameters": {
"type": "object",
"properties": {
"customer_id": {"type": "string"},
"status": {
"type": "string",
"enum": ["pending", "shipped", "delivered", "cancelled"]
},
"limit": {"type": "integer"}
},
"required": ["customer_id"]
}
}
Multi-Tool: Book a meeting + send an invitation
{
"tools": [
{
"type": "function",
"name": "book_room",
"description": "Meeting-Raum buchen",
"parameters": {
"type": "object",
"properties": {
"room_id": {"type": "string"},
"date": {"type": "string", "format": "date"},
"time": {"type": "string"},
"duration_minutes": {"type": "integer"}
},
"required": ["room_id", "date", "time"]
}
},
{
"type": "function",
"name": "send_calendar_invite",
"description": "Kalender-Einladung versenden",
"parameters": {
"type": "object",
"properties": {
"attendees": {"type": "array", "items": {"type": "string"}},
"title": {"type": "string"},
"datetime": {"type": "string", "format": "date-time"}
},
"required": ["attendees", "title", "datetime"]
}
}
]
}
Best practices
Clear tool descriptions
descriptions are crucial in determining when the model selects a tool:
{
"name": "search_knowledge_base",
"description": "Durchsucht die interne Wissensdatenbank nach Dokumentation, Richtlinien und Prozessen. Nutze dies bei Fragen zu Firmenprozessen, HR-Richtlinien oder internen Tools."
}
Precise parameter descriptions
{
"date": {
"type": "string",
"description": "Datum im ISO-8601-Format (YYYY-MM-DD), z. B. 2026-03-15"
}
}
Return errors cleanly
{"error": "Kunde nicht gefunden", "customer_id": "12345"}
This allows the model to respond to the error instead of hallucinating.
Webhooks for real-time events
If you want to respond to API events (e.g., a completed background job), use webhooks:
# Webhook anlegen
curl -X POST https://app.innogpt.de/api/ext/v1/webhooks \
-H "Authorization: Bearer $INNOGPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://deine-app.de/webhook", "events": ["response.completed"]}'
Additional endpoints:
GET /webhooks— listPOST /webhooks/{id}/test— Send test deliveryPOST /webhooks/{id}/secret— Rotate secretGET /webhooks/{id}/deliveries— Check delivery history
Was this helpful?
More in API
innoGPT API - Introduction & QuickstartAPI keysStill need help? Ask the team