# Models

> How model ids are written (author/model), listing and filtering the catalog with GET /models, the units prices are given in, and free models.

In Lykia every model has an id of the form `author/model`, for example `openai/gpt-4o-mini`, `anthropic/claude-sonnet-4.5` or `google/gemini-2.5-flash`. You put that id in the request's `model` field and Lykia decides which provider serves it (you can influence that with [Provider routing](https://www.getlykia.com/en/docs/guides/provider-routing)).

## Model ids

- The first part is the company or community that built the model; the second part is the model's name. The provider is not part of the id: `mistralai/mistral-small-3.2-24b-instruct` keeps the same id whichever provider ends up serving it. Lykia translates it to the model name the provider expects.
- The catalog is Lykia's own: Lykia manages its models, ids and prices. There are no ids with a suffix such as `:free` and no alias ids starting with `~`.
- Send ids exactly as written in the catalog. An id that is not in the catalog returns `404`.

> **Tip:** Coming from OpenAI? Prefix model names with the author: `openai/gpt-4o` instead of `gpt-4o`. See [Migrating from OpenAI](https://www.getlykia.com/en/docs/guides/migrate-from-openai).

## Listing the catalog

`GET https://api.getlykia.com/v1/models`

One request returns every model your project can call, with its context length, input and output types, supported parameters and prices. The list is per project: a model is listed when a provider Lykia connects to directly offers it with a price. If you have added your own provider key to the project, that provider's models are listed too.

**Request**

cURL

```bash
curl https://api.getlykia.com/v1/models \
  -H "Authorization: Bearer $LYKIA_API_KEY"
```

Python

```python
import os

import requests

response = requests.get(
    "https://api.getlykia.com/v1/models",
    headers={"Authorization": f"Bearer {os.environ['LYKIA_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()

for model in response.json()["data"]:
    print(model["id"], model["context_length"], model["pricing"].get("prompt"))
```

TypeScript

```typescript
const response = await fetch("https://api.getlykia.com/v1/models", {
  headers: { Authorization: `Bearer ${process.env.LYKIA_API_KEY}` },
});
if (!response.ok) {
  throw new Error(`Lykia returned ${response.status}: ${await response.text()}`);
}

const { data } = await response.json();
for (const model of data) {
  console.log(model.id, model.context_length, model.pricing.prompt);
}
```

Go

```go
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
	"os"
)

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://api.getlykia.com/v1/models", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("LYKIA_API_KEY"))

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		panic(fmt.Sprintf("Lykia returned %d", resp.StatusCode))
	}

	var result struct {
		Data []struct {
			ID            string `json:"id"`
			ContextLength int    `json:"context_length"`
			Pricing       struct {
				Prompt string `json:"prompt"`
			} `json:"pricing"`
		} `json:"data"`
	}
	if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
		panic(err)
	}
	for _, model := range result.Data {
		fmt.Println(model.ID, model.ContextLength, model.Pricing.Prompt)
	}
}
```

**Response (200)**

```json
{
  "data": [
    {
      "id": "anthropic/claude-sonnet-4.5",
      "canonical_slug": "anthropic/claude-sonnet-4.5",
      "hugging_face_id": null,
      "name": "Anthropic: Claude Sonnet 4.5",
      "created": 1795415185,
      "description": "Claude Sonnet 4.5 is Anthropic's mid-sized model for coding, agents and long documents. It accepts text, image and file inputs and returns text.",
      "context_length": 1000000,
      "architecture": {
        "modality": "text+image+file->text",
        "input_modalities": [
          "text",
          "image",
          "file"
        ],
        "output_modalities": [
          "text"
        ],
        "tokenizer": null
      },
      "pricing": {
        "prompt": "0.000003",
        "completion": "0.000015",
        "input_cache_read": "0.0000003",
        "input_cache_write": "0.00000375"
      },
      "top_provider": {
        "context_length": 1000000,
        "max_completion_tokens": 64000
      },
      "supported_parameters": [
        "include_reasoning",
        "max_completion_tokens",
        "max_tokens",
        "reasoning",
        "response_format",
        "stop",
        "structured_outputs",
        "temperature",
        "tool_choice",
        "tools",
        "top_k",
        "top_p"
      ],
      "is_free": false,
      "expiration_date": null,
      "kind": "chat"
    },
    {
      "id": "openai/gpt-4o-mini",
      "canonical_slug": "openai/gpt-4o-mini",
      "hugging_face_id": null,
      "name": "OpenAI: GPT-4o-mini",
      "created": 1795415185,
      "description": "GPT-4o mini is OpenAI's small, low-cost multimodal model. It accepts text, image and file inputs and returns text.",
      "context_length": 128000,
      "architecture": {
        "modality": "text+image+file->text",
        "input_modalities": [
          "text",
          "image",
          "file"
        ],
        "output_modalities": [
          "text"
        ],
        "tokenizer": null
      },
      "pricing": {
        "prompt": "0.00000015",
        "completion": "0.0000006",
        "input_cache_read": "0.000000075"
      },
      "top_provider": {
        "context_length": 128000,
        "max_completion_tokens": 16384
      },
      "supported_parameters": [
        "frequency_penalty",
        "logit_bias",
        "logprobs",
        "max_completion_tokens",
        "max_tokens",
        "prediction",
        "presence_penalty",
        "response_format",
        "seed",
        "stop",
        "structured_outputs",
        "temperature",
        "tool_choice",
        "tools",
        "top_logprobs",
        "top_p",
        "web_search_options"
      ],
      "is_free": false,
      "expiration_date": null,
      "kind": "chat"
    }
  ]
}
```

The [`GET /models`](https://www.getlykia.com/en/docs/api-reference/models) reference describes every field. The ones you will reach for most:

- `id`: what you put in the request's `model` field.
- `context_length`: the longest context the model accepts, in tokens.
- `architecture.input_modalities`: the kinds of input it accepts (`text`, `image` and so on).
- `supported_parameters`: request parameters the model supports (`tools`, `response_format`, `temperature`…).
- `pricing`: unit prices, explained below.

## Filtering by capability

The `supported_parameters` query parameter returns only the models that support the parameter you name; separate several names with commas to get the models that support all of them. For example, models that can call tools:

**cURL**

```bash
curl "https://api.getlykia.com/v1/models?supported_parameters=tools" \
  -H "Authorization: Bearer $LYKIA_API_KEY"
```

**Python**

```python
import os

import requests

response = requests.get(
    "https://api.getlykia.com/v1/models",
    params={"supported_parameters": "tools"},
    headers={"Authorization": f"Bearer {os.environ['LYKIA_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
print([model["id"] for model in response.json()["data"]])
```

**TypeScript**

```typescript
const url = new URL("https://api.getlykia.com/v1/models");
url.searchParams.set("supported_parameters", "tools");

const response = await fetch(url, {
  headers: { Authorization: `Bearer ${process.env.LYKIA_API_KEY}` },
});
if (!response.ok) {
  throw new Error(`Lykia returned ${response.status}: ${await response.text()}`);
}

const { data } = await response.json();
console.log(data.map((model: { id: string }) => model.id));
```

Filter on `structured_outputs` or `response_format` the same way to find candidates for [structured outputs](https://www.getlykia.com/en/docs/guides/structured-outputs).

The default list is meant for chat, so models that only produce vectors are left out. Add `output_modalities=embedding` to list the models for [`POST /embeddings`](https://www.getlykia.com/en/docs/api-reference/embeddings), or `output_modalities=all` for everything.

## Price units

Values in the `pricing` object are **USD per unit**, given as strings that hold a decimal number. When a model is offered by more than one provider, this shows the lowest price available to your project; a request is charged at the price of the provider that served it. They are strings so that nothing is lost to floating-point rounding; parse them with a decimal library if you do arithmetic with them. A unit that has no price for a model is left out of its `pricing` object.

| Field               | Unit                                 |
| ------------------- | ------------------------------------ |
| `prompt`            | per input token                      |
| `completion`        | per output token                     |
| `input_cache_read`  | per input token read from the cache  |
| `input_cache_write` | per input token written to the cache |
| `request`           | flat fee per request                 |
| `image`             | per input image                      |

Per-token prices are tiny numbers. Multiply by a million to make them readable: `"prompt": "0.00000015"` means 0.15 USD per million input tokens.

A request's cost is calculated from the `prompt`, `completion`, `input_cache_read`, `input_cache_write`, `image` and `request` prices, the token counts the provider reports and the number of images in the request, and comes back in the response as `usage.cost`. The formula and the rounding rule are in [Credits and billing](https://www.getlykia.com/en/docs/guides/credits-and-billing#what-a-request-costs).

## Image, video, speech and transcription models

Media models are not in the default `GET /models` list, which is meant for chat. Ask for them by kind: `GET /models?kind=image` (or `video`, `speech`, `transcription`). Each media model has `kind`, an empty token `pricing` and a `media` object:

- `media.capabilities` says what the model accepts: sizes or aspect ratios, resolutions, durations, first and last frame, audio, how many images per request, speech formats and so on.
- `media.pricing` is the unit price. The `unit` is per image, per megapixel, per second, per minute, per video, per character or per token, and `tiers` give the price for each variant (for example by resolution, or with and without audio). `usd` is a decimal string for `quantity` units.
- `media.providers` lists the providers that serve the model for your project.

Paying with Lykia credits depends on the provider being enabled on Lykia; when it is not, a request on credits returns `403` with `platform_sales_disabled`. With your own provider key ([BYOK](https://www.getlykia.com/en/docs/guides/byok)), every model of a supported provider works. Guides: [Image generation](https://www.getlykia.com/en/docs/guides/image-generation), [Video generation](https://www.getlykia.com/en/docs/guides/video-generation), [Speech and voices](https://www.getlykia.com/en/docs/guides/speech-and-voices), [Transcription](https://www.getlykia.com/en/docs/guides/transcription).

## Free models

Lykia can mark some models as free, in which case Lykia covers their cost. Free models need no credits, but there is a daily request limit for them that depends on the plan; see [Limits](https://www.getlykia.com/en/docs/guides/limits#daily-limit-on-free-models). There are no free models by default; the [model catalog](https://www.getlykia.com/en/models) on the site shows which models are free, if any, and in `GET /models` a free model has `is_free: true`.

## How the catalog changes

Lykia manages the catalog: new models are added, and prices are kept up to date against the providers' own pricing pages. Every day Lykia also checks each provider's own model list; a model a provider no longer offers is no longer used through that provider. A model that is turned off is not listed and returns `404`. Rather than hard-coding a model list in your application, read it from `GET /models` when you need it, and watch the `expiration_date` of the models you use: when it is set, the model will be removed on that date.

If your project has an allowed-models list, a request for a model outside that list returns `403`. See [Projects](https://www.getlykia.com/en/docs/guides/projects).
