# Overview

> What Relayvia serves, every endpoint at a glance and where to start.

Relayvia is an AI API gateway. Point your SDK or tool at Relayvia, use a Relayvia API key and call models by their official names. Requests keep the OpenAI, Anthropic or Gemini format and are billed against your account's prepaid credits.

## Start here

- [Quickstart](https://relayvia.dev/docs/quickstart): Four steps: get an API key, choose a model, send your first request and see the usage in the console.
- [Authentication](https://relayvia.dev/docs/authentication): Which header each API format uses for your key, and whether its base URL includes /v1.
- [Model list](https://relayvia.dev/docs/models): Official model names, the models listed now and how to see which ones your key can use.
- [Error codes](https://relayvia.dev/docs/errors): Every error code with its HTTP status, fixed message and what to do; 402 versus 429; the three error formats.

## Endpoints

OpenAI-format endpoints use the base URL `https://api.relayvia.dev/v1`. Anthropic and Gemini SDKs take `https://api.relayvia.dev` and add the rest of the path themselves. Each endpoint has its own page.

| Method | Path | Format | Page |
| --- | --- | --- | --- |
| `POST` | `/v1/chat/completions` | OpenAI | [Chat Completions](https://relayvia.dev/docs/api/chat-completions) |
| `POST` | `/v1/responses` | OpenAI | [Responses](https://relayvia.dev/docs/api/responses) |
| `POST` | `/v1/messages` | Anthropic | [Messages](https://relayvia.dev/docs/api/messages) |
| `POST` | `/v1beta/models/{model}:generateContent` | Gemini | [Gemini native](https://relayvia.dev/docs/api/gemini) |
| `POST` | `/v1beta/models/{model}:streamGenerateContent` | Gemini | [Gemini native](https://relayvia.dev/docs/api/gemini) |
| `GET` | `/v1/models` | Query | [Models](https://relayvia.dev/docs/api/models) |
| `GET` | `/v1/models/{model}` | Query | [Models](https://relayvia.dev/docs/api/models) |
| `GET` | `/v1/balance` | Query | [Check credits](https://relayvia.dev/docs/api/balance) |
| `GET` | `/v1/dashboard/billing/subscription` | Query | [Check credits](https://relayvia.dev/docs/api/balance) |
| `GET` | `/v1/usage` | Query | [Check usage](https://relayvia.dev/docs/api/usage) |
| `GET` | `/v1/dashboard/billing/usage` | Query | [Check usage](https://relayvia.dev/docs/api/usage) |
| `POST` | `/v1/images/generations` | Async task | [Async tasks](https://relayvia.dev/docs/async-tasks) |
| `POST` | `/v1/video/generations` | Async task | [Async tasks](https://relayvia.dev/docs/async-tasks) |
| `GET` | `/v1/tasks/{task_id}` | Async task | [Async tasks](https://relayvia.dev/docs/async-tasks) |

## Set up with an AI agent

Paste the prompt below into an AI coding agent such as Claude Code or Codex CLI and it will configure your tools. The URLs and settings in it are the same as on the integration pages.

> **Note**
>
> Put your API key in the `RELAYVIA_API_KEY` environment variable first; the prompt does not contain the key.

```text
Configure my AI coding tools to use the Relayvia API gateway. My API key is in the environment variable RELAYVIA_API_KEY.

Facts:
- OpenAI-format base URL (Codex CLI, OpenAI SDKs, Cursor, Cline): https://api.relayvia.dev/v1
- Anthropic-format base URL (Claude Code): https://api.relayvia.dev
- Auth header: Authorization: Bearer <key> (the /v1/messages route also accepts x-api-key: <key>)
- Use official model names, e.g. claude-opus-5 or gpt-5.5. List models with GET https://api.relayvia.dev/v1/models.

Steps:
1. Ask me which tools to configure (Claude Code, Codex CLI, or others) before changing any file.
2. Claude Code: merge this into the env block of ~/.claude/settings.json, using the value of RELAYVIA_API_KEY as the token:
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.relayvia.dev",
    "ANTHROPIC_AUTH_TOKEN": "sk-...",
    "ANTHROPIC_MODEL": "claude-opus-5"
  }
}
3. Codex CLI: merge this into ~/.codex/config.toml (the key is read from RELAYVIA_API_KEY):
model = "gpt-5.5"
model_provider = "relayvia"

[model_providers.relayvia]
name = "Relayvia"
base_url = "https://api.relayvia.dev/v1"
env_key = "RELAYVIA_API_KEY"
wire_api = "responses"
4. Verify with: curl https://api.relayvia.dev/v1/models -H "Authorization: Bearer $RELAYVIA_API_KEY"
5. If Claude Code still asks for a login method or reports an auth conflict, run /logout inside Claude Code and start it again.

Rules: never print, log, or commit the API key; keep existing settings in those files; show me a diff before writing.

Full documentation index: https://relayvia.dev/llms.txt
```

## Docs for AI tools

[/llms.txt](https://relayvia.dev/llms.txt) lists every page of these docs. Every page also has a Markdown version: add `.md` to its URL, for example [/docs/quickstart.md](https://relayvia.dev/docs/quickstart.md), or use Copy as Markdown at the top of the page.
