OpenAI-Compatible and Anthropic API Reference
Base URL
Section titled “Base URL”https://frugalrelay.me/v1Authentication
Section titled “Authentication”Pass a Frugal Relay API key in the Authorization header:
Authorization: Bearer fr-your-key-hereOpenAI-compatible chat completions
Section titled “OpenAI-compatible chat completions”POST /v1/chat/completionscurl https://frugalrelay.me/v1/chat/completions \ -H "Authorization: Bearer $FRUGAL_RELAY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.6-luna", "messages": [{"role": "user", "content": "Summarize this text."}] }'Common request fields include model, messages, stream, and model-supported generation or tool parameters. Parameter support can vary by model and upstream route; validate the exact features your application uses.
Anthropic-compatible messages
Section titled “Anthropic-compatible messages”Claude models in the public pricing catalog support the Anthropic endpoint type:
POST /v1/messagescurl https://frugalrelay.me/v1/messages \ -H "x-api-key: $FRUGAL_RELAY_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{ "model": "claude-sonnet-5", "max_tokens": 256, "messages": [{"role": "user", "content": "Summarize this text."}] }'List models
Section titled “List models”GET /v1/modelsThis endpoint requires authentication and returns models available to the supplied key. The public pricing catalog lists models and routes currently advertised by the service.
Codex CLI uses a separate catalog endpoint when model discovery is enabled:
GET /v1/codex/modelsIt returns Codex model metadata in a top-level models array, filtered to models available to the supplied key. See the Codex and Claude Code setup guide for the required Codex configuration.
Streaming
Section titled “Streaming”For supported models, set stream: true and consume the returned server-sent events. Test streaming behavior before migrating production traffic.
Error codes
Section titled “Error codes”| HTTP status | Meaning |
|---|---|
401 | Invalid or missing API key |
402 | Insufficient balance or quota |
429 | Rate or spending limit exceeded |
500 | Gateway or upstream error; retry only when the error is transient |
Compatible clients
Section titled “Compatible clients”The OpenAI-compatible endpoint works with current clients that support a custom base URL, including the OpenAI SDK and compatible HTTP clients. Claude models can also use the Anthropic-compatible messages request shape.
See Supported Models for endpoint types and Pricing for route-specific costs.