Omnigent Relay
CUSTOMER DOCUMENTATION

Build with Relay

Create a Relay account, issue a project API key, and call the implemented OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, or embeddings endpoint. Sign in and check the live catalog for enabled model IDs and customer prices.

Quick start

Create a project and Virtual Key in the console, then set these environment variables in a trusted server-side environment. Do not put a key in browser code or source control.

export RELAY_BASE_URL="https://YOUR-RELAY-HOST"
export RELAY_API_KEY="YOUR_PROJECT_KEY"
curl "$RELAY_BASE_URL/v1/chat/completions" \
  -H "Authorization: Bearer $RELAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"MODEL_ID_FROM_CATALOG","messages":[{"role":"user","content":"Hello"}]}'

Replace MODEL_ID_FROM_CATALOG with an enabled chat model ID. Model availability is restricted by the combined project and Virtual Key allowlists, and usage is billed to the project's Relay wallet.

Implemented public endpoints

  • POST /v1/chat/completions — OpenAI Chat Completions. The Gateway supports non-streaming and streaming modes; the console playground intentionally sends non-streaming requests only.
  • POST /v1/responses — OpenAI Responses translated to the shared chat pipeline. Stateful features such as previous_response_id, background execution, and conversation storage are not supported.
  • POST /v1/messages — Anthropic Messages protocol. Provide max_tokens; the Anthropic SDK's x-api-key header is accepted by the Gateway.
  • POST /v1/embeddings — Embedding requests require an enabled embedding model and matching embedding endpoint binding.

The signed-in API Playground currently exposes these four non-streaming POST routes only. It does not expose model catalog management, arbitrary URLs, or internal Gateway routes.

Authentication and key safety

  • Authenticate public data-plane requests with a Relay Virtual Key (sk-rl-…) using Authorization: Bearer, or the Anthropic Messages x-api-key header.
  • Treat the key as a secret. Keep it in a server-side environment variable or secret manager, do not commit it, and revoke it if exposed.
  • The browser Playground requires a signed-in Relay session and same-origin CSRF protection. It holds the key only in component memory and submits it to the same-origin BFF, which forwards it to the configured public Gateway. It is not saved in localStorage/sessionStorage, and the route does not persist or log request data.
  • Playground requests are limited to 1 MiB, responses to 2 MiB, upstream waits to 45 seconds, and redirects are rejected. Responses use Cache-Control: no-store.

Errors and limits

401 / RELAY_UNAUTHENTICATED

Check that the Virtual Key is valid, active, and sent in the expected authentication header.

403 / RELAY_MODEL_NOT_ALLOWED

The model may be outside the project or key allowlist, or the key may lack the required endpoint scope.

404 / RELAY_MODEL_NOT_FOUND

Use an enabled public model ID from the current catalog.

429 / RELAY_RATE_LIMITED

The key reached a configured rate or concurrency limit. Retry according to your application policy.

402 / RELAY_BUDGET_EXCEEDED

The project monthly budget has been reached.

SDK examples and protocol details

The task guide contains runnable Curl, OpenAI JavaScript, OpenAI Python, and Anthropic SDK examples for the implemented protocol routes, along with current compatibility boundaries.

Open the API Playground