401 / RELAY_UNAUTHENTICATEDCheck that the Virtual Key is valid, active, and sent in the expected authentication header.
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.
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.
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.
401 / RELAY_UNAUTHENTICATEDCheck that the Virtual Key is valid, active, and sent in the expected authentication header.
403 / RELAY_MODEL_NOT_ALLOWEDThe model may be outside the project or key allowlist, or the key may lack the required endpoint scope.
404 / RELAY_MODEL_NOT_FOUNDUse an enabled public model ID from the current catalog.
429 / RELAY_RATE_LIMITEDThe key reached a configured rate or concurrency limit. Retry according to your application policy.
402 / RELAY_BUDGET_EXCEEDEDThe project monthly budget has been reached.
The task guide contains runnable Curl, OpenAI JavaScript, OpenAI Python, and Anthropic SDK examples for the implemented protocol routes, along with current compatibility boundaries.