Skip to content

OpenAI-Compatible and Anthropic API Reference

https://frugalrelay.me/v1

Pass a Frugal Relay API key in the Authorization header:

Authorization: Bearer fr-your-key-here
POST /v1/chat/completions
Terminal window
curl 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.

Claude models in the public pricing catalog support the Anthropic endpoint type:

POST /v1/messages
Terminal window
curl 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."}]
}'
GET /v1/models

This 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/models

It 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.

For supported models, set stream: true and consume the returned server-sent events. Test streaming behavior before migrating production traffic.

HTTP statusMeaning
401Invalid or missing API key
402Insufficient balance or quota
429Rate or spending limit exceeded
500Gateway or upstream error; retry only when the error is transient

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.