# Models

> List the models your key can call, with the price you are billed, context windows and input types, and the catalogue query behind the pricing page.

## List models

`GET https://backend.alfnrl.io/v1/models`

The models your key can call, in the OpenAI list format, so `models.list()` in the OpenAI SDKs, and tools that call it on start-up, work against the AlphaNeural base URL. Each entry also carries the price you are billed and what the model can take, in the shape OpenRouter-style clients already read.

```bash
curl https://backend.alfnrl.io/v1/models \
  -H "Authorization: Bearer $ALPHANEURAL_API_KEY"
```

```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://backend.alfnrl.io/v1",
    api_key=os.environ["ALPHANEURAL_API_KEY"],
)

for model in client.models.list():
    print(model.id, model.model_extra.get("context_length"))
```

```ts
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://backend.alfnrl.io/v1",
  apiKey: process.env.ALPHANEURAL_API_KEY,
});

for await (const model of client.models.list()) {
  // The extras are not in the OpenAI types; the SDK keeps them on the object.
  const { context_length } = model as typeof model & { context_length?: number };
  console.log(model.id, context_length);
}
```

```json
{
  "object": "list",
  "data": [
    {
      "id": "openrouter/anthropic/claude-haiku-4.5",
      "object": "model",
      "created": 0,
      "owned_by": "anthropic",
      "description": "Claude Haiku 4.5 ...",
      "context_length": 200000,
      "pricing": {"prompt": "0.0000011", "completion": "0.0000055"},
      "architecture": {
        "modality": "text+image->text",
        "input_modalities": ["text", "image"],
        "output_modalities": ["text"],
        "tokenizer": "Claude"
      },
      "top_provider": {"context_length": 200000, "max_completion_tokens": 64000},
      "supported_parameters": ["max_tokens", "temperature", "tools", "response_format"]
    },
    {"id": "openrouter/openai/gpt-4o-mini", "object": "model", "created": 0, "owned_by": "openai", "context_length": 128000, "pricing": {"prompt": "0.000000165", "completion": "0.00000066"}}
  ]
}
```

Entries are sorted by `id`. Each entry's `id` is exactly what you send as `model`.

| Field | |
|---|---|
| `id`, `object` | The model id, and always `model`. |
| `created` | Always `0`: the gateway records no registration date. |
| `owned_by` | The publisher, parsed from the id (`anthropic`, `openai`, ...). `alphaneural` when the id carries none, such as one of your own deployments. |
| `description` | The catalogue description, when there is one. |
| `context_length` | The input window in tokens. |
| `pricing.prompt`, `pricing.completion` | US dollars per token, as decimal strings, **margin included**: the price you are billed, the same figure [Pricing](https://app.alphaneural.io/pricing) quotes per million. |
| `architecture` | `input_modalities` and `output_modalities` (`text`, `image`, ...), `modality` as `text+image->text`, and the `tokenizer` family. |
| `top_provider` | `context_length` again, and `max_completion_tokens`, the reply limit, when known. |
| `supported_parameters` | The OpenAI request parameters this model accepts, when known. The gateway drops any parameter a model does not support rather than refusing the request. |

Every field after `owned_by` is left out, not sent as `null`, when it is not known. `pricing` is left out for a model with no registry price; that is not a free model, and it will be billed from the provider's reported cost.

Only chat models are listed, because this base URL serves chat completions only. Embedding, image and audio models your key can reach are listed by the [raw gateway](https://app.alphaneural.io/docs/gateway#models) at `https://proxy.alfnrl.io/v1/models`, which lists every model the key can reach, with ids only. The two lists are therefore not identical.

The list is what your key may call, not the whole catalogue: a Private or Standalone key sees its own deployments and nothing else. When the gateway refuses the key, its status is passed through: `401` for a key it does not know, `400` for one it cannot use, `429` when it is rate limited. See [Errors](https://app.alphaneural.io/docs/errors#models).

## The catalogue over GraphQL

The same prices and capabilities, for every model in the public catalogue rather than the ones your key can call, are available from the catalogue query. No authentication is needed:

```bash
curl https://backend.alfnrl.io/query \
  -H "Content-Type: application/json" \
  -d '{"query": "{ litellmModels { name vendor displayInputCostPerToken displayOutputCostPerToken maxInputTokens maxOutputTokens inputModalities outputModalities } }"}'
```

```json
{
  "data": {
    "litellmModels": [
      {
        "name": "openrouter/openai/gpt-4o-mini",
        "vendor": "openai",
        "displayInputCostPerToken": 1.65e-7,
        "displayOutputCostPerToken": 6.6e-7,
        "maxInputTokens": 128000,
        "maxOutputTokens": null,
        "inputModalities": null,
        "outputModalities": null
      }
    ]
  }
}
```

| Field | |
|---|---|
| `name` | The model id to send as `model`. |
| `vendor` | The publisher, parsed from the name. `null` when the name carries none. |
| `displayInputCostPerToken`, `displayOutputCostPerToken` | The price per token in US dollars, margin included: the prices on [Pricing](https://app.alphaneural.io/pricing), which quotes them per million. `null` means free or unpriced; the catalogue cannot tell the two apart, so never read `null` as a price of zero. |
| `maxInputTokens`, `maxOutputTokens` | Context window and reply limit. `null` where not recorded, which for `maxOutputTokens` is most models. |
| `inputModalities`, `outputModalities` | What the model accepts and produces, such as `["text", "image"]`. Few models have these recorded yet, so expect `null`. |

This is the same catalogue [/models](https://app.alphaneural.io/models) and [Pricing](https://app.alphaneural.io/pricing) are built from, and it lists `alphaneural/auto` first, with `alphaneural` as its vendor and every price `null`.

## Model ids

- **Catalogue models** are named `openrouter/<vendor>/<model>`, for example `openrouter/anthropic/claude-haiku-4.5`. Copy ids from [/models](https://app.alphaneural.io/models), [Pricing](https://app.alphaneural.io/pricing) or the list above.
- **`alphaneural/auto`** is not a model but a router: the server picks a ladder of catalogue models for each request and you pay for the one that answered. See [Routing](https://app.alphaneural.io/docs/routing).
- **Your own deployments** are called by their deployment name, once the deployment has completed on a template that serves through the gateway (the vLLM and API templates). Until you publish a deployment to the catalogue, only a Private or Standalone key reaches it (see [Authentication](https://app.alphaneural.io/docs/authentication)).
- **An id nobody serves** is still forwarded, and the gateway's error for it is returned unchanged.
