> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Portrix Gateway: One Endpoint for 400+ AI Providers

> The Portrix gateway is a single API endpoint that proxies requests to 400+ AI providers. Understand how it sits between your app and every LLM provider.

The Portrix gateway is the central piece of the platform — a single HTTPS endpoint your applications call instead of each individual AI provider. Rather than maintaining separate API keys, SDKs, and integration code for OpenAI, Anthropic, Google, Mistral, and dozens of others, you point your application at one URL and the gateway takes care of everything behind the scenes.

## How the gateway works

When your application sends a request, it travels through the gateway on its way to the appropriate AI provider. The gateway inspects the request, routes it to the right destination, translates the protocol if needed, and returns a normalized response — all transparently.

<Steps>
  <Step title="Your app sends a request">
    You call `https://api.portrix.ai/v1` using any OpenAI-compatible SDK or HTTP client, specifying the model you want.
  </Step>

  <Step title="The gateway routes the request">
    Portrix identifies the target provider from the model name, applies your routing rules, and forwards the request to the correct provider endpoint.
  </Step>

  <Step title="The provider processes the request">
    OpenAI, Anthropic, Google, or whichever provider you targeted receives and handles the request using its native API.
  </Step>

  <Step title="The gateway normalizes the response">
    The provider's response is translated back into OpenAI-compatible format and returned to your application — consistent regardless of which provider was used.
  </Step>
</Steps>

## What the gateway handles

The gateway manages several cross-cutting concerns so your application code stays simple.

<CardGroup cols={2}>
  <Card title="Authentication & Key Management" icon="key">
    Authenticate once with a single Portrix API key. The gateway manages provider-specific credentials on your behalf — no more storing a dozen API keys in your environment.
  </Card>

  <Card title="Request Routing" icon="route">
    The gateway directs each request to the correct provider based on the model you specify, your routing rules, and current provider availability.
  </Card>

  <Card title="Protocol Translation" icon="arrow-right-arrow-left">
    Your OpenAI-format requests are automatically converted to each provider's native API format before being forwarded, and responses are normalized back.
  </Card>

  <Card title="Fallback Handling" icon="shield">
    When a provider is unavailable or over quota, the gateway can automatically retry against a fallback model so your application stays resilient.
  </Card>

  <Card title="Response Normalization" icon="code">
    Every response — regardless of provider — comes back in a consistent shape, so your response-parsing code works universally.
  </Card>
</CardGroup>

## The base URL

All requests to Portrix go through one base URL:

```
https://api.portrix.ai/v1
```

This endpoint is fully OpenAI-compatible, so you can point any existing OpenAI integration at it with minimal changes. Here is a basic request using cURL:

```bash theme={null}
curl https://api.portrix.ai/v1/chat/completions \
  -H "Authorization: Bearer $PORTRIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o",
    "messages": [
      { "role": "user", "content": "Hello, world!" }
    ]
  }'
```

<Note>
  Replace `$PORTRIX_API_KEY` with your actual Portrix API key from the [dashboard](https://app.portrix.ai).
</Note>

## OpenAI compatibility

<Info>
  The gateway speaks OpenAI's API format natively — any SDK or tool that already works with OpenAI works with Portrix. You can switch by changing one line: the `base_url` (or equivalent) in your client configuration.
</Info>

This means you can use the official `openai` Python or Node.js SDK, LangChain, LlamaIndex, or any other OpenAI-compatible tooling without modification. Simply set the base URL to `https://api.portrix.ai/v1` and your Portrix API key.

```python theme={null}
from openai import OpenAI

client = OpenAI(
    api_key="your-portrix-api-key",
    base_url="https://api.portrix.ai/v1",
)

response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Hello, world!"}],
)

print(response.choices[0].message.content)
```

## Rate limits and quotas

Every Portrix account has rate limits and usage quotas that govern how many requests you can make per minute and per month. Individual providers also impose their own limits, which the gateway enforces transparently. For details on configuring limits, setting up alerts, and understanding your usage, see [Rate Limits](/configuration/rate-limits).
