# API reference

> Endpoints, authentication and streaming.

All endpoints live under `https://freshrouter.com` and follow the request and response formats of the original APIs.

## Endpoints

| Method | Path | Format |
| --- | --- | --- |
| `POST` | `/v1/chat/completions` | OpenAI Chat Completions |
| `POST` | `/v1/responses` | OpenAI Responses |
| `POST` | `/v1/messages` | Anthropic Messages |
| `POST` | `/v1beta/models/{model}:generateContent` | Gemini |
| `POST` | `/v1/images/generations` | Images |
| `GET` | `/v1/models` | Models |

## Authentication

Send your key as `Authorization: Bearer sk-…`. For Anthropic Messages you can use `x-api-key`, and for Gemini `x-goog-api-key`.

## Streaming

Set `"stream": true` to receive server-sent events, exactly as with the original API:

```bash
curl https://freshrouter.com/v1/messages \
  -H "x-api-key: sk-your-freshrouter-key" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5-5",
    "max_tokens": 1024,
    "stream": true,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
```
