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.

  1. Point your OpenAI SDK base URL at https://relayrouter.io/v1.
  2. Set the API key using Authorization: Bearer YOUR_API_KEY (create keys at the dashboard).
  3. Send a POST to /v1/chat/completions with model gpt-5.5 and your tools array defining the functions.
  4. 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.

ProtocolEndpointBase URLUse for GPT-5.5 function calling
OpenAI compatiblePOST /v1/chat/completionshttps://relayrouter.io/v1Yes, standard tools schema
Anthropic compatiblePOST /v1/messageshttps://relayrouter.ioFor 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

ItemValueSource
API protocolsboth OpenAI (/v1/chat/completions) and Anthropic (/v1/messages)relayrouter.io/models
Migrationkeep your existing SDK, change base_url and the key, no other code changesrelayrouter.io/docs
Model coverageClaude family, GPT-5.5, Gemini 3.5, plus DeepSeek, GLM, MiniMax, Moonshotrelayrouter.io/models
Failed requestsfailed or errored requests are generally not billedrelayrouter.io

Data verified 2026-06-29; live prices are on the official /models page.


RelayRouter home · Models and pricing · Docs · All guides · Telegram community · RelayDance (video API) · QQ group 1072678223