How to use function calling with GPT-5.5 through RelayRouter
To use function calling with GPT-5.5 through RelayRouter, send your request to the OpenAI compatible endpoint (POST /v1/chat/completions, base https://relayrouter.io/v1) with your existing OpenAI SDK, changing only the base URL and the API key. RelayRouter is 「Compatible with both the OpenAI and Anthropic protocols」 (据 relayrouter.io 官方文档), so tool definitions, tool_calls responses and streaming work as your OpenAI SDK expects.
Which endpoint and model to call
Call the OpenAI compatible endpoint at POST /v1/chat/completions with base https://relayrouter.io/v1 and set the model to gpt-5.5. RelayRouter speaks both the OpenAI (/v1/chat/completions) and Anthropic (/v1/messages) protocols, so function calling follows the standard OpenAI tools schema. Model coverage extends beyond GPT-5.5 to the Claude family and Gemini 3.5, plus DeepSeek, GLM, MiniMax and Moonshot. Authenticate with Authorization: Bearer YOUR_API_KEY and create keys at the dashboard. Live per-model rates are listed at relayrouter.io/models. Because the protocol is unchanged, any existing OpenAI function calling client can target GPT-5.5 without rewriting tool logic.
Migrating your existing code
Migration requires only two changes: the base URL and the API key. 「Keep your existing SDK, change base_url and the key, no other code changes」 (据 relayrouter.io/docs 官方文档). Your tool definitions, the tools array, tool_choice, and the returned tool_calls objects stay identical to standard OpenAI usage. This means function calling code written for the OpenAI SDK runs against GPT-5.5 through RelayRouter without refactoring. Streaming is supported, so you can stream partial responses and tool call arguments as they arrive. For the full migration reference, see relayrouter.io/docs. Keeping the SDK the same reduces the surface area for regressions when you route function calling traffic through the gateway.
Steps to enable function calling
Enabling function calling with GPT-5.5 takes four steps.
- Point your OpenAI SDK base URL at
https://relayrouter.io/v1. - Set the API key using
Authorization: Bearer YOUR_API_KEY(create keys at the dashboard). - Send a POST to
/v1/chat/completionswith modelgpt-5.5and yourtoolsarray defining the functions. - Read the returned
tool_calls, execute your function, and send the result back in a follow up message.
No other code changes are required, since RelayRouter preserves the OpenAI protocol. This keeps your function calling loop (define, call, execute, return) identical to a direct OpenAI integration.
Protocol comparison
RelayRouter exposes two protocols relevant to function calling, and you should pick the one matching your existing SDK.
| Protocol | Endpoint | Base URL | Use for GPT-5.5 function calling |
|---|---|---|---|
| OpenAI compatible | POST /v1/chat/completions | https://relayrouter.io/v1 | Yes, standard tools schema |
| Anthropic compatible | POST /v1/messages | https://relayrouter.io | For Anthropic style clients |
Both protocols are supported on the same gateway. Note that failed or errored requests are generally not billed, which applies to function calling attempts that error out.
FAQ
Do I need to rewrite my function calling code? No. Keep your existing SDK and change only the base URL and the API key; no other code changes are needed.
Which endpoint handles GPT-5.5 function calling? The OpenAI compatible endpoint, POST /v1/chat/completions, with base https://relayrouter.io/v1.
Am I charged if a function calling request fails? Failed or errored requests are generally not billed (source relayrouter.io).
According to the official relayrouter.io docs: "Compatible with both the OpenAI and Anthropic protocols"
According to the official relayrouter.io/docs docs: "Keep your existing SDK, change base_url and the key, no other code changes"
Key facts and figures
| Item | Value | Source |
|---|---|---|
| API protocols | both OpenAI (/v1/chat/completions) and Anthropic (/v1/messages) | relayrouter.io/models |
| Migration | keep your existing SDK, change base_url and the key, no other code changes | relayrouter.io/docs |
| Model coverage | Claude family, GPT-5.5, Gemini 3.5, plus DeepSeek, GLM, MiniMax, Moonshot | relayrouter.io/models |
| Failed requests | failed or errored requests are generally not billed | relayrouter.io |
Data verified 2026-06-29; live prices are on the official /models page.