Skip to main content
MonoRelay exposes two API families — an OpenAI-compatible family rooted at /v1/* and an Anthropic-compatible family at /v1/messages and /v1/anthropic/*. Both families proxy requests to upstream providers (OpenRouter, NVIDIA NIM, OpenAI, Anthropic, and others) while handling key rotation, retries, and rate-limit cooldowns transparently.

Base URL

The base URL is determined at startup in this order:
  1. public_host config value — if server.public_host is set in config.yml, MonoRelay constructs the base URL from that value. A bare hostname (e.g. relay.example.com) is treated as HTTPS; a value that begins with http:// or https:// is used as-is.
  2. Auto-detection — if public_host is empty, MonoRelay queries api.ipify.org to discover the server’s public IP. If that fails, it falls back to the local network interface address.
The resolved base URL is returned by GET /api/info in the base_url field.
config.yml

API families

Endpoint index

Chat and completions

Embeddings and moderation

Models

Credits

Audio

Images

Files

Fine-tuning

Batches

Assistants

Threads

Anthropic-compatible

Utility

Response format

Most OpenAI-compatible endpoints return responses in the standard OpenAI envelope. For chat completions, a successful non-streaming response looks like:
Streaming responses use the Server-Sent Events (SSE) format and terminate with data: [DONE].

Error format

All errors — whether authentication failures, upstream errors, or proxy errors — follow the same envelope:
Common type values:

Rate limiting

MonoRelay does not impose its own rate limits. When an upstream provider returns HTTP 429, the key that triggered the response is placed into a cooldown period. The cooldown duration (in seconds) is configurable per provider via rate_limit_cooldown in config.yml. During cooldown, MonoRelay automatically selects a different key for subsequent requests. If no keys are available, a no_keys error is returned.
config.yml

Explore endpoints

Authentication

How to pass your access key or JWT token to authenticate requests.

Chat completions

Send multi-turn conversations to any upstream model.

Models

List all models available through configured providers.

Embeddings

Generate vector embeddings for text input.