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

# Relay gateway

> Route OpenAI-compatible model requests through Relay using a project-scoped Relay key.

The Relay gateway receives the model request, applies the project's policy, calls the selected provider with a connected provider credential, and returns the provider-compatible response.

## Send a request

Call Relay's OpenAI-compatible endpoint directly:

<CodeGroup>
  ```bash cURL theme={null}
  curl https://relay.oximy.com/v1/chat/completions \
    -H "Authorization: Bearer ox_..." \
    -H "Content-Type: application/json" \
    -d '{
      "model": "oximy/auto",
      "messages": [{"role": "user", "content": "Summarize the release risk."}]
    }'
  ```

  ```http HTTP theme={null}
  POST /v1/chat/completions HTTP/1.1
  Host: relay.oximy.com
  Authorization: Bearer ox_...
  Content-Type: application/json

  {
    "model": "oximy/auto",
    "messages": [
      {"role": "user", "content": "Summarize the release risk."}
    ]
  }
  ```
</CodeGroup>

Use the gateway URL shown in your Relay setup when it differs from the public URL above.

Because the endpoint is OpenAI-compatible, an existing compatible client can
use it by replacing its base URL and API key. Relay does not require an Oximy
client library.

## Select a model

* Send `oximy/auto` to apply Relay's active routing policy.
* Send a provider-prefixed model ID, such as `openai/gpt-4o-mini`, to request that model directly.
* Configure a fallback model for automatic-routing failures.

Provider-prefixed IDs avoid ambiguity where multiple providers expose similar model names.

## Production checklist

* Use a dedicated project and key per application environment.
* Verify each provider credential and confirm its models are callable.
* Set project and key limits before increasing traffic.
* Exercise the fallback with a controlled failure.
* Confirm Traffic records show the expected source, resolved model, and routing reason.
* Revoke old keys after rotation.

<Warning>
  A Relay key authenticates the application to Relay. It is not a provider API key, and it should never be sent directly to a model provider.
</Warning>

<Card title="Configure routing and fallbacks" icon="sliders-horizontal" href="/docs/relay/routing-fallbacks">
  Define the candidates and behavior behind `oximy/auto`.
</Card>
