# API Overview

> Base URL, authentication, and quick-start examples in Python, Node.js, and curl for the LLMoxy API.

LLMoxy provides a fully compatible Anthropic Messages API interface. Just change the Base URL and use the official SDK seamlessly.

## Base URL

```txt
https://llmoxy.com/v1
```

> **TIP**
> Tools like Claude Code use the address **without** `/v1`, i.e. `https://llmoxy.com`. SDK calls include `/v1`.

## Authentication

### Method 1: x-api-key (recommended)

```http
x-api-key: YOUR_API_KEY
```

### Method 2: Authorization

```http
Authorization: Bearer YOUR_API_KEY
```

## Quick Start

### Python

```python
from anthropic import Anthropic

client = Anthropic(
api_key="YOUR_API_KEY",
base_url="https://llmoxy.com/v1"
)

message = client.messages.create(
model="claude-opus-5-5",
max_tokens=1024,
messages=[
{"role": "user", "content": "Hello!"}
]
)

print(message.content[0].text)
```

### Node.js

```js
import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic({
apiKey: 'YOUR_API_KEY',
baseURL: 'https://llmoxy.com/v1'
});

const message = await client.messages.create({
model: 'claude-opus-5-5',
max_tokens: 1024,
messages: [
{ role: 'user', content: 'Hello!' }
]
});

console.log(message.content[0].text);
```

### OpenAI Compatible (Chat Completions)

#### curl

```bash
curl https://llmoxy.com/v1/chat/completions \
  -H "Authorization: Bearer <LLMOXY_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-4.7",
    "messages": [
      { "role": "user", "content": "Say hello in one short sentence." }
    ]
  }'
```

#### TypeScript

```ts
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.LLMOXY_API_KEY,
  baseURL: "https://llmoxy.com/v1",
});

const response = await client.chat.completions.create({
  model: "grok-4.7",
  messages: [{ role: "user", content: "Write a haiku about routers." }],
});

console.log(response.choices[0]?.message?.content);
```

#### Python

```py
from openai import OpenAI

client = OpenAI(
    api_key="<LLMOXY_API_KEY>",
    base_url="https://llmoxy.com/v1",
)

response = client.chat.completions.create(
    model="grok-4.7",
    messages=[{"role": "user", "content": "Write a haiku about routers."}],
)

print(response.choices[0].message.content)
```

## Streaming Output

Set `stream: true` in Chat or Responses requests, and LLMoxy returns an OpenAI-compatible SSE stream.

```bash
curl https://llmoxy.com/v1/chat/completions \
  -H "Authorization: Bearer <LLMOXY_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-4.7",
    "stream": true,
    "messages": [
      { "role": "user", "content": "Count from one to five." }
    ]
  }'
```

## Supported Models

### Claude Series (available groups: Claude)

| Model | Description |
| --- | --- |
| claude-fable-5-2 | Best performance |
| claude-opus-5-5 | Balanced choice |

### Gemini Series (available group: Gemini)

| Model | Description |
| --- | --- |
| gemini-4-argon | Best performance |
| gemini-3.8-flash | Fast response |

> **Latest Model List**
> See the [official model hub](https://llmoxy.com/) for currently available models.

## Billing

Billed by actual token usage (including cache write and cache read). Prices vary by model. See [Groups and Pricing](https://en.llmoxy.com/docs/get-started/recharge-and-pricing) for details.

## Next Steps

- [Anthropic Format](https://en.llmoxy.com/docs/api-reference/anthropic-format) — request parameters, response format, code examples
- [Chat Completions](https://en.llmoxy.com/docs/api-reference/chat-completions) — OpenAI-compatible request format
- [Routing, Billing, and Errors](https://en.llmoxy.com/docs/api-reference/routing-billing-errors) — learn about fees and error codes

This is the markdown version of https://en.llmoxy.com/docs/api-reference/api-overview.
