Skip to main content
Every AI provider has its own API format, authentication scheme, and request structure. Portrix bridges these differences so you write your integration code once and it works with all providers — no per-provider SDK, no per-provider request adapters, and no per-provider response parsers.

The problem

The major AI providers have diverged significantly in their API designs. OpenAI uses a POST /v1/chat/completions endpoint where messages are passed as an array of {role, content} objects. Tools are defined under a tools array with a function schema. Streaming responses are sent as data: {...} Server-Sent Events terminated by data: [DONE]. Anthropic uses a POST /v1/messages endpoint with a different message shape — system is a top-level field rather than a message in the array, and content can be a structured list of blocks. Tools are defined differently, and its streaming format uses event types like content_block_delta rather than OpenAI’s chunk format. Google Gemini has its own REST API under generativelanguage.googleapis.com with entirely different field names (contents instead of messages, parts instead of content), a different authentication mechanism (API key as a query parameter), and its own streaming protocol. Maintaining native integrations with each provider means writing and updating bespoke code for every API you consume.

Portrix’s solution

Portrix accepts all requests in the OpenAI format and translates them internally to each provider’s native protocol before forwarding. The provider’s response is also normalized back to OpenAI format before it reaches your application.
Your code never changes — only the model field in your request determines which provider is used.

Supported protocols

Tool and function calling

When you define tools in OpenAI’s function calling format, Portrix automatically converts those definitions to the equivalent format for the target provider. You write your tools once and they work across providers. For example, the following tool definition works whether you target openai/gpt-4o, anthropic/claude-3-5-sonnet, or google/gemini-1.5-pro:
Portrix translates the OpenAI tools schema into Anthropic’s tools format (with input_schema instead of parameters) automatically, and maps the response back so tool_calls in the returned message follows the OpenAI shape.

Streaming

Streaming responses via Server-Sent Events (SSE) are normalized to OpenAI’s data: {...} format regardless of which provider processes the request. Enable streaming by setting stream: true in your request body.
Even though Google Gemini uses a different streaming protocol internally, the chunks you receive follow OpenAI’s ChatCompletionChunk shape — so your streaming parsing code is portable across all providers.
Some advanced provider-specific features may not be available through the unified protocol layer. Features that have no equivalent in the OpenAI format — such as Anthropic’s extended thinking tokens or provider-specific safety configurations — may require provider-specific headers or may not be accessible. Check the provider-specific documentation for edge cases.