> ## Documentation Index
> Fetch the complete documentation index at: https://docs.levanto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# LLMs

> OpenAI- and Anthropic-compatible endpoints: change the base URL, keep your client.

Open-weight models now match closed ones on most work, at a fraction of the price.

## First call

Base URL: `https://api.levanto.ai/v1`, with the same `lv_live_...` key as Sage.

```bash cURL theme={"theme":"github-light"}
curl -s https://api.levanto.ai/v1/chat/completions \
  -H "Authorization: Bearer $LEVANTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [{"role": "user", "content": "Reply with the word ok."}]
  }'
```

```python Python theme={"theme":"github-light"}
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.levanto.ai/v1",
    api_key=os.environ["LEVANTO_API_KEY"],
)

resp = client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "Reply with the word ok."}],
)
print(resp.choices[0].message.content)
```

```typescript TypeScript theme={"theme":"github-light"}
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api.levanto.ai/v1',
  apiKey: process.env.LEVANTO_API_KEY,
});

const resp = await client.chat.completions.create({
  model: 'auto',
  messages: [{ role: 'user', content: 'Reply with the word ok.' }],
});
console.log(resp.choices[0].message.content);
```

Response, abridged:

```json theme={"theme":"github-light"}
{
  "object": "chat.completion",
  "model": "deepseek/deepseek-v4-flash",
  "choices": [
    {"index": 0, "message": {"role": "assistant", "content": "ok"}, "finish_reason": "stop"}
  ],
  "usage": {"prompt_tokens": 10, "completion_tokens": 23, "total_tokens": 33}
}
```

`model` is the model that answered.

## Models

Send `"auto"` to let the [router](https://docs.levanto.ai/llms/routers.md) pick, or a model id.

```bash theme={"theme":"github-light"}
curl -s https://api.levanto.ai/v1/models \
  -H "Authorization: Bearer $LEVANTO_API_KEY" | jq -r '.data[].id'
```

```text theme={"theme":"github-light"}
auto
deepseek/deepseek-v4-flash
openai/gpt-oss-120b
moonshotai/kimi-k3.1-pro
...
```

Prices and context sizes: [Models page](https://platform.levanto.ai/routing/models).

## API formats

| Endpoint | Format |
| - | - |
| `POST /v1/chat/completions` | OpenAI Chat Completions |
| `POST /v1/responses` | OpenAI Responses |
| `POST /v1/messages` | Anthropic Messages |
| `GET /v1/models` | The models your key can call |

All three stream with `"stream": true`. `/v1/messages` also takes the key in an `x-api-key` header. `/v1/responses` stores nothing: send the whole conversation on every call (`previous_response_id` returns 400).

## Next

> [card] [Routers](https://docs.levanto.ai/llms/routers.md)
>
> Let `auto` pick the model.

> [card] [Coding agents](https://docs.levanto.ai/llms/coding-agents.md)
>
> Claude Code and Codex.

> [card] [Advanced options](https://docs.levanto.ai/llms/advanced.md)
>
> Per-call controls.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.