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

# LLMs

> Use 12 frontier text/multimodal models behind one API: Claude Opus 4.7 / 4.6, Claude Sonnet 4.6, GPT-5 nano / mini, GPT-5.4 nano, GPT-4.1 mini, and Gemini 3.1 / 3 Pro / 3 Flash / 2.5 Pro / 2.5 Flash.

The LLM API exposes a dozen top-tier models — Claude, OpenAI GPT, and Gemini — behind a
single billing surface and a single AdSkull API key. You can call them three
ways:

1. **Native** — `POST /v1/llm/chat` (one stable shape across all models).
2. **OpenAI-compatible** — `POST /openai/v1/chat/completions` so existing
   OpenAI SDKs and OpenAI-shaped tools (Cline, Roo Code, Continue, Aider,
   Cursor, OpenWebUI, LiteLLM, LangChain, n8n, …) work without code changes.
3. **Anthropic-compatible** — `POST /anthropic/v1/messages` so Claude Code,
   openclaw, and Anthropic-shaped tools work by just changing `ANTHROPIC_BASE_URL`.

All three paths share the same authentication, the same rate limits, the
same idempotency rules, and the same billing path.

## Available models

| Model ID            | Family    | Context | Modalities                          | Best for                                                            |
| ------------------- | --------- | ------- | ----------------------------------- | ------------------------------------------------------------------- |
| `claude-opus-4.7`   | Anthropic | 200K    | text + image                        | Hardest reasoning, agent tool use.                                  |
| `claude-opus-4.6`   | Anthropic | 200K    | text + image                        | Strong reasoning, lower latency.                                    |
| `claude-sonnet-4.6` | Anthropic | 1M      | text + image                        | Coding, agents, large automation workflows.                         |
| `gpt-5-mini`        | OpenAI    | 400K    | text + image                        | OpenAI reasoning at low latency, tool calling.                      |
| `gpt-5-nano`        | OpenAI    | 400K    | text + image                        | Cheapest in catalog. High-volume classification and vision tagging. |
| `gpt-5.4-nano`      | OpenAI    | 400K    | text + image                        | Upgraded reasoning nano, built for subagent / pipeline workloads.   |
| `gpt-4.1-mini`      | OpenAI    | 1M      | text + image                        | 1M context, low-latency, no reasoning step.                         |
| `gemini-3.1-pro`    | Google    | 1M      | text + image + audio + video + file | Long context, full multimodal.                                      |
| `gemini-3-pro`      | Google    | 1M      | text + image + audio + video + file | Multimodal default.                                                 |
| `gemini-3-flash`    | Google    | 1M      | text + image + audio + video + file | Fast multimodal at low cost.                                        |
| `gemini-2.5-pro`    | Google    | 2M      | text + image + audio + video + file | Mega-context.                                                       |
| `gemini-2.5-flash`  | Google    | 1M      | text + image + audio + video + file | Cheap multimodal fallback.                                          |

`GET /v1/llm/models` returns the full catalog with per-model pricing in
millicredits per 1M tokens.

<Note>
  You **never** pass a provider-specific model name. There is no "claude-3-opus-20240229"
  here — we control which underlying weights satisfy each AdSkull model ID and
  may upgrade them transparently with at least 30 days' notice.
</Note>

## Pricing model

LLM calls bill in **millicredits** (1 credit = 1000 millicredits). This means
short prompts can cost a fraction of a credit. Whole credits are only deducted
from your balance once accumulated usage crosses the next 1000-millicredit
boundary; the remainder is carried as internal debt against your account.

Every response includes both the integer-precision and fractional cost:

```json theme={"theme":"github-dark"}
"usage": {
  "input_tokens": 412,
  "output_tokens": 188,
  "cached_tokens": 0,
  "millicredits_charged": 1230,
  "credits_charged": 1.23
}
```

Per-model rates (input / cached / output, millicredits per 1M tokens) are
returned by `GET /v1/llm/models`. See [Models](/public/models) for the broader
catalog across image, video, voice, and avatar.

## Required scopes

| Scope       | Routes                                            |
| ----------- | ------------------------------------------------- |
| `llm:read`  | `GET /v1/llm/models`, `GET /v1/llm/usage`         |
| `llm:write` | All chat / multimodal / OpenAI / Anthropic routes |

Both compatibility façades use the same AdSkull API key — there's no
separate "OpenAI key" or "Anthropic key" to issue.

## Idempotency

Every non-streaming `POST` accepts an `Idempotency-Key` header. Same key +
same body within 24h replays the cached response and charges nothing extra.
Streaming requests cannot be replayed but are still rate-limited normally.

## What's next

<CardGroup cols={2}>
  <Card title="Native chat" href="/public/feature-llm-chat">
    The simplest, most stable shape — one schema for every AdSkull LLM.
  </Card>

  <Card title="Multimodal helpers" href="/public/feature-llm-multimodal">
    One-call vision/audio/video descriptions with structured JSON output.
  </Card>

  <Card title="OpenAI-compatible" href="/public/feature-llm-openai-compat">
    Drop AdSkull into any OpenAI SDK or OpenAI-shaped tool.
  </Card>

  <Card title="Anthropic-compatible" href="/public/feature-llm-anthropic-compat">
    Use Claude Code, openclaw, and Anthropic SDKs unchanged.
  </Card>
</CardGroup>
