# Models

> The catalog of models your project can call through Lykia, with context length, supported parameters and per-token prices.

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

Returns every model the calling key's project can use through Lykia. A model is listed when a provider Lykia connects to directly offers it with a price; models at the providers of the project's own provider keys are listed too, so two projects can see different lists. The response may be up to a minute old. If you send a model that has since dropped out of it, or that has been turned off, the request fails with `404`. How to read model ids and prices is explained in the [Models](https://www.getlykia.com/en/docs/models) guide.

## Query parameters

- `supported_parameters` (string) — Return only models that support this parameter, for example `tools` for models that can call tools or `response_format` for JSON output. Separate several names with commas to get models that support all of them.
- `output_modalities` (string) — The default list is meant for chat and leaves out models that only produce vectors (embeddings). `embedding` returns only the models for [`POST /embeddings`](https://www.getlykia.com/en/docs/api-reference/embeddings); `image`, `video`, `audio` (speech) and `transcription` return media models with that output; `all` returns everything.
- `kind` (string) — Only models of these kinds, separated by commas: `chat`, `embedding`, `image`, `video`, `speech` or `transcription`. Media models (image, video, speech, transcription) are not in the default list; ask for them with `kind` or `output_modalities`.

## Example

List the models that support tool calling:

**Request**

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?supported_parameters=tools",
    headers={"Authorization": f"Bearer {os.environ['LYKIA_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()

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

TypeScript

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

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

Go

```go
package main

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

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://api.getlykia.com/v1/models?supported_parameters=tools", 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()

	body, _ := io.ReadAll(resp.Body)
	if resp.StatusCode != http.StatusOK {
		panic(fmt.Sprintf("Lykia returned %d: %s", resp.StatusCode, body))
	}

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

**Response (200)**

```json
{
  "data": [
    {
      "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"
    }
  ]
}
```

## Response

The response is a `data` array of model objects, newest first. The field names are the ones common OpenAI-compatible model lists use, so libraries that read that format read this list without changes.

- `id` (string) — The model id, `author/model`. This is the value you put in a request's `model` field.
- `canonical_slug` (string) — The model's id; in Lykia it is the same as `id`.
- `hugging_face_id` (null) — Present for compatibility; Lykia does not fill it in.
- `name` (string) — Display name.
- `created` (integer | null) — When the model was released, or when it was added to the catalog if the release date is not known, as a Unix timestamp in seconds.
- `description` (string) — A short description of the model.
- `context_length` (integer | null) — The most tokens the input and output can add up to.
- `architecture` (object) — What the model takes in and puts out.
  - `modality` (string) — A compact summary such as `text+image->text`.
  - `input_modalities` (string\[]) — Accepted input types (`text`, `image`, `file`…).
  - `output_modalities` (string\[]) — Output types it produces.
  - `tokenizer` (null) — Present for compatibility; Lykia does not fill it in.
- `pricing` (object) — Unit prices in USD, as decimal strings. Only the units that have a price for the model are present. When the model is offered by more than one provider, this is the lowest price available to your project.
  - `prompt` (string) — Per input token.
  - `completion` (string) — Per generated token.
  - `request` (string) — A flat fee per request.
  - `image` (string) — Per input image.
  - `input_cache_read` (string) — Per input token read from the cache.
  - `input_cache_write` (string) — Per input token written to the cache.
- `top_provider` (object) — The model's limits.
  - `context_length` (integer | null) — Context length.
  - `max_completion_tokens` (integer | null) — The most tokens a single response can contain.
- `supported_parameters` (string\[]) — The request parameters the model supports (`tools`, `response_format`, `temperature`…).
- `is_free` (boolean) — `true` for a free model: requests to it are not charged to credits but count towards the daily limit for free models.
- `expiration_date` (string | null) — The date the model will be retired, or `null` if none is set.
- `kind` (string) — Which endpoint the model is for: `chat`, `embedding`, `image`, `video`, `speech` or `transcription`.
- `media` (object) — Only on media models. Their token `pricing` is `{}`; the price is here instead.
  - `kind` (string) — `image`, `video`, `speech` or `transcription`.
  - `capabilities` (object) — What the model accepts: for example `sizes`, `sizeRule`, `aspectRatios`, `resolutions`, `qualities`, `maxN`, `maxInputImages`, `mask`, `seed`, `outputFormats`, `durations`, `firstFrame`, `lastFrame`, `audio`, `speech` (formats, speed, input limit), `transcription` (formats, file limit, timestamps) and `providerOptions` (the allowed `provider_options`). `deprecatedAt` is the date the provider retires the model, when announced.
  - `pricing` (object) — The unit price: `unit` (`per_image`, `per_megapixel`, `per_second`, `per_minute`, `per_video`, `per_character` or `per_token`), `quantity` (how many units `usd` is for; `1` unless stated), `tiers` (prices by variant: each has `when`, the conditions such as `resolution`, `quality`, `audio` or `tokenType`, and `usd`, a decimal string), `surcharges` (extra fees with `when`, `usd` and `per`: `request`, `image` or `second`) and an optional `note`.
  - `providers` (string\[]) — The providers that serve the model for your project, in the order Lykia tries them.

> **Tip:** Prices are per token. Multiply by 1,000,000 to get the price per million tokens: a `"0.00000015"` prompt price is USD 0.15 per million input tokens.

These are list prices. A request's cost is calculated from `prompt`, `completion`, `input_cache_read`, `input_cache_write`, `image` and `request`; details in [Credits and billing](https://www.getlykia.com/en/docs/guides/credits-and-billing#what-a-request-costs).
