# MCP tools reference

> Every tool and ready-made workflow of the Lykia MCP server, with its inputs, its output, the scope it needs and whether it spends credits.

The Lykia MCP server at `https://api.getlykia.com/mcp` offers the tools below. How to connect a client is covered in [MCP: connect Lykia to your AI client](https://www.getlykia.com/en/docs/guides/mcp). Each tool runs in the project the connection belongs to.

| Tool                                  | Scope         | Spends credits |
| ------------------------------------- | ------------- | -------------- |
| [`models_list`](#models-list)         | `models:read` | No             |
| [`model_get`](#model-get)             | `models:read` | No             |
| [`cost_estimate`](#cost-estimate)     | `models:read` | No             |
| [`chat`](#chat)                       | `chat`        | Yes            |
| [`credits_get`](#credits-get)         | `usage:read`  | No             |
| [`usage_summary`](#usage-summary)     | `usage:read`  | No             |
| [`generation_get`](#generation-get)   | `usage:read`  | No             |
| [`image_generate`](#image-generate)   | `images`      | Yes            |
| [`video_generate`](#video-generate)   | `videos`      | Yes            |
| [`video_status`](#video-status)       | `videos`      | No             |
| [`video_wait`](#video-wait)           | `videos`      | No             |
| [`speech_generate`](#speech-generate) | `speech`      | Yes            |
| [`voices_list`](#voices-list)         | `speech`      | No             |
| [`workflows_list`](#workflows-list)   | none          | No             |
| [`workflow_get`](#workflow-get)       | none          | No             |

Every tool returns structured content that matches its output schema, plus a short text summary for the model to read. Tools are listed to a client only when the connection has the scope they need; calling a tool without its scope is refused with HTTP `403` and `insufficient_scope`. Connections made with a project API key have every scope.

## Errors

A tool that fails returns `isError: true` and an `error` object in its structured content:

- `error` (object)
  - `message` (string) — What went wrong and what to do next, in English.
  - `code` (string) — A stable code, for example `invalid_request`, `model_not_found`, `max_cost_exceeded`, `cost_unknown`, `rate_limited`, `insufficient_credits` or `limit_exceeded`.
  - `status` (number | null) — The HTTP status of the underlying gateway error, when there is one.
  - `reason` (string) — The error class, as in [Errors](https://www.getlykia.com/en/docs/guides/errors).

## models_list

Lists the models this project can call, with context length, modalities and prices in USD per million tokens. The list is the same as [`GET /models`](https://www.getlykia.com/en/docs/api-reference/models) for the project.

- `search` (string) — Text matched against the model id and name, for example `claude` or `gpt-4o`.
- `output_modality` (string) — Only models that produce this: `text`, `image`, `audio`, `video`, `file`. Use `text` for chat models.
- `input_modality` (string) — Only models that accept this input, for example `image` for vision models.
- `supports` (string) — Only models that support this request parameter, for example `tools` or `response_format`.
- `max_price` (number) — Only models whose input price is at most this many USD per million tokens.
- `free_only` (boolean) — Only free models.
- `sort` (string) — `name` (default), `price` (cheapest input price first) or `newest`.
- `limit` (integer) — The most models to return, from 1 to 200. Defaults to 50.

Output: `total` (models that match), `returned`, and `models[]` with `id`, `name`, `context_length`, `input_modalities`, `output_modalities`, `pricing_usd_per_million_tokens { prompt, completion }` and `is_free`.

## model_get

Returns one model's full details: description, context length, maximum output tokens, modalities, supported parameters and exact prices.

- `model` (string, required) — A model id such as `openai/gpt-4o-mini`.

Output: `model`, the full model object as in `GET /models`, plus `pricing_usd_per_million_tokens`.

## cost_estimate

Estimates the **highest possible** cost of a `chat` call before it runs. Prompt tokens are estimated from the text (about four characters per token) and the whole `max_tokens` output is assumed, so the real cost is usually lower. Nothing is spent.

- `model` (string) — A model id. Defaults to the project's default model.
- `prompt` (string) — The user prompt. Give this or `messages`.
- `messages` (array) — The full conversation: objects with `role` (`system`, `developer`, `user` or `assistant`) and `content` (text or content parts).
- `system` (string) — An optional system instruction.
- `max_tokens` (integer) — The output limit you will ask for. Defaults to 1024.

```json
{
  "model": "openai/gpt-4o-mini",
  "prompt": "Write three subject lines for our spring newsletter.",
  "max_tokens": 256
}
```

Output: `model`, `estimated_max_cost_usd`, `currency` (`USD`) and `estimates[]` (one per model considered).

## chat

Runs a text model once (not streamed) and returns the answer. **Spends credits** of the connected project, under the same rules as [`POST /chat/completions`](https://www.getlykia.com/en/docs/api-reference/chat-completions): the company balance, the project budget, the connection's monthly limit and the rate limit all apply, and the request appears in the project's request logs with the app's name.

- `model` (string) — A model id such as `openai/gpt-4o-mini`. Defaults to the project's default model.
- `prompt` (string) — The user prompt. Give this or `messages`.
- `messages` (array) — The full conversation instead of `prompt`, as in `cost_estimate`. Content parts follow the Chat Completions format.
- `system` (string) — An optional system instruction.
- `max_tokens` (integer) — The output limit. Defaults to 1024.
- `temperature` (number) — Sampling temperature, from 0 to 2.
- `max_cost_usd` (number) — Refuse to run, without charging anything, when the highest possible cost is above this many USD (error `max_cost_exceeded`).
- `metadata` (object) — String tags stored with the request record and never sent to the provider.

```json
{
  "model": "openai/gpt-4o-mini",
  "prompt": "Write three subject lines for our spring newsletter.",
  "max_tokens": 256,
  "max_cost_usd": 0.01,
  "metadata": { "team": "marketing" }
}
```

Output:

- `id` (string) — The request id; pass it to `generation_get`.
- `model` (string) — The model that answered.
- `provider` (string | null) — The provider that answered.
- `content` (string) — The answer text.
- `finish_reason` (string | null) — `length` means the answer stopped at `max_tokens`.
- `usage` (object) — `prompt_tokens`, `completion_tokens` and `total_tokens`.
- `cost_usd` (number) — What the request cost.
- `latency_ms` (number) — How long the call took.
- `max_tokens_applied` (number | null) — The output limit Lykia applied, when it set or lowered it.

Good practice, which the tool description also tells the model: run `cost_estimate` with the same input, show the estimate, wait for your go-ahead, then call `chat` with `max_cost_usd` slightly above the estimate.

## credits_get

Shows the company's prepaid balance, what is available for new requests, and this connection's own spending limit and usage.

No inputs.

Output: `company { id, name }`, `project { id, name }`, `credits` (as in [`GET /credits`](https://www.getlykia.com/en/docs/api-reference/credits)) and `connection` with `label`, `limit`, `limit_reset`, `usage`, `limit_remaining` and, for apps connected through OAuth, `scopes`.

## usage_summary

Summarises the project's usage between two UTC dates: requests, errors, tokens and cost in USD, grouped by model, by day or by key and connection.

- `from` (string) — First day, `YYYY-MM-DD` (UTC). Defaults to 30 days ago.
- `to` (string) — Last day, inclusive, `YYYY-MM-DD` (UTC). Defaults to today.
- `group_by` (string) — `model` (default), `day` or `key`.
- `limit` (integer) — The most rows to return. Defaults to 50.

```json
{
  "from": "2026-11-01",
  "to": "2026-11-23",
  "group_by": "model",
  "limit": 10
}
```

Output: `from`, `to`, `group_by`, `totals { requests, errors, prompt_tokens, completion_tokens, cost_usd, list_cost_usd }` and `rows[]` with the same figures per group. With `group_by: "key"`, each row says whether it is an API key or a connected app and whether it is this connection.

## generation_get

Fetches one request record by its id (the `id` that `chat` returns): model, provider, tokens, real cost, latency, status and fallback attempts. Prompt and answer text are never returned. A record appears a moment after the request finishes.

- `id` (string, required) — The request id, for example `gen-1732350000-AbCdEf0123456789`.

Output: `generation`, the same object as [`GET /generation`](https://www.getlykia.com/en/docs/api-reference/generation) returns.

## image_generate

Generates or edits images with an image model through [`POST /images/generations`](https://www.getlykia.com/en/docs/api-reference/images-generations). **Spends credits** under the same rules as `chat`.

- `model` (string) — An image model id or preset. Defaults to `@image`.
- `prompt` (string, required) — What to draw, or how to change the source images.
- `n` (integer) — How many images, 1 to 4. Defaults to 1.
- `size`, `aspect_ratio`, `resolution`, `quality`, `seed`, `output_format` — As the model allows; see its `media.capabilities` with `model_get`.
- `images` (string\[]) — Up to 8 source images for editing or as references: `https://` URLs or `data:` URIs.
- `provider_options` (object) — Provider-specific options from the model's allow-list.
- `max_cost_usd` (number) — Refuse to run, without charging anything, when the highest possible cost is above this many USD.
- `metadata` (object) — String tags stored with the request record.

```json
{
  "model": "@image",
  "prompt": "A flat illustration of a lighthouse at dusk, warm colours",
  "aspect_ratio": "16:9",
  "n": 1,
  "max_cost_usd": 0.1,
  "metadata": { "team": "marketing" }
}
```

Output: `id`, `model`, `provider`, `cost_usd` and `images[]` with `url` (a one-hour link to the original file, or `null` when Lykia's storage is not available), `expires_at`, `mime_type`, `width`, `height` and `preview`. The tool also returns a small preview of up to four images (at most 1024 px on the long side) for the client to show; the original file is never re-encoded.

## video_generate

Starts a video job through [`POST /videos`](https://www.getlykia.com/en/docs/api-reference/videos-create) and returns at once. **Spends credits** when the job completes; a failed, cancelled or timed-out job is free unless the provider charged for a rejection.

- `model` (string) — A video model id or preset. Defaults to `@video`.
- `prompt` (string, required) — What should happen in the video.
- `image`, `last_frame` (string) — A first and last frame: `https://` URLs or `data:` URIs.
- `reference_images` (string\[]) — Reference images, as the model allows.
- `duration`, `aspect_ratio`, `resolution`, `audio`, `seed`, `provider_options` — As in `POST /videos`.
- `max_cost_usd` (number) — Refuse to start, without charging anything, when the highest possible cost is above this many USD.
- `metadata` (object) — String tags stored with the request record.

```json
{
  "model": "@video",
  "prompt": "Slow camera push towards a lighthouse at dusk, waves below",
  "duration": 5,
  "aspect_ratio": "16:9",
  "max_cost_usd": 1
}
```

Output: the job object with `id`, `status` (`queued`), `model` and `provider`. Follow it with `video_wait` or `video_status`.

## video_status

Reads a video job once through [`GET /videos/{id}`](https://www.getlykia.com/en/docs/api-reference/videos-get).

- `id` (string, required) — The job id from `video_generate`.

Output: the job object. Once `completed` it carries a one-hour link to the file and the real cost.

## video_wait

Waits for a video job, checking it every few seconds, and reports progress to clients that ask for it.

- `id` (string, required) — The job id.
- `timeout_seconds` (integer) — How long to wait, up to 300. Defaults to 300.

Output: the job object plus `done` (whether the job ended) and `waited_seconds`. When `done` is `false` the job is still running; call `video_wait` again.

## speech_generate

Turns text into speech through [`POST /audio/speech`](https://www.getlykia.com/en/docs/api-reference/audio-speech). **Spends credits** under the same rules as `chat`.

- `model` (string) — A speech model id or preset. Defaults to `@tts`.
- `input` (string, required) — The text to speak, up to 10,000 characters.
- `voice` (string, required) — A voice id from `voices_list`.
- `response_format`, `speed`, `language`, `instructions` — As in `POST /audio/speech`.
- `max_cost_usd` (number) — Refuse to run, without charging anything, when the cost is above this many USD.
- `metadata` (object) — String tags stored with the request record.

```json
{
  "model": "@tts",
  "input": "Welcome to the spring collection.",
  "voice": "JBFqnCBsd6RMkjVDRZzb",
  "response_format": "mp3",
  "max_cost_usd": 0.05
}
```

Output: `id`, `model`, `cost_usd`, `url` and `expires_at` (a one-hour link to the audio when Lykia's storage is available; otherwise the audio is returned inline when it is small enough), `mime_type` and `bytes`.

## voices_list

Lists the voices of a speech model through [`GET /audio/voices`](https://www.getlykia.com/en/docs/api-reference/audio-voices-list): the provider's ready-made voices and the project's clones.

- `model` (string) — A speech model id or preset. Defaults to `@tts`.

Output: `model` and `voices[]` with `id`, `name` and the other voice fields.

When `max_cost_usd` is given and no price is known for the chosen options, a spending tool does not run and returns `cost_unknown`. With only your own provider keys for the model, the estimate is `0` because Lykia credits are not spent.

## workflows_list

Lists the ready-made workflows available on this connection. A workflow is a recipe for the model: what to ask you, which tools to call in which order, and that it must show a cost estimate and wait for your go-ahead before spending.

- `language` (string) — `en` (default) or `tr`.

Output: `workflows[]` with `name`, `title`, `description` and `arguments[]`.

## workflow_get

Returns the full instructions of one workflow.

- `name` (string, required) — The workflow name, for example `model-compare`.
- `arguments` (object) — Inputs you already gave, keyed by argument name.
- `language` (string) — `en` (default) or `tr`.

Output: `name`, `title` and `instructions`.

## Ready-made workflows

Clients that support MCP prompts show these as commands (for example as slash commands); other clients reach them through `workflows_list` and `workflow_get`. Both give the same text.

| Workflow          | What it does                                                                                                                | Needs                                           |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| `model-compare`   | Runs the same prompt on two to four text models with identical settings and compares answer quality, latency and real cost. | `models:read`, `chat`                           |
| `cost-report`     | Summarises the project's spending by model and by day, checks the balance and suggests concrete ways to save.               | `usage:read`, `models:read`                     |
| `product-ad`      | Turns a product photo into ready-to-run ad images with a headline and a call to action.                                     | `models:read`, `images`, `usage:read`           |
| `ad-variants`     | Produces several versions of one ad that differ only in headline or hook, ready for A/B testing.                            | `models:read`, `images`, `usage:read`           |
| `ad-resize`       | Recomposes one ad for feed, story, banner and other placement sizes without cropping away the product or text.              | `models:read`, `images`, `usage:read`           |
| `ad-localize`     | Adapts an ad's copy and visuals to other languages and markets, keeping the layout and brand intact.                        | `models:read`, `images`, `usage:read`           |
| `logo-concepts`   | Explores several distinct logo directions for a brand, as simple marks that work at small sizes.                            | `models:read`, `images`, `usage:read`           |
| `social-pack`     | Turns one idea into a matching set of posts for several platforms, with images, captions and alt text.                      | `models:read`, `images`, `usage:read`           |
| `storyboard`      | Breaks a script into shots and draws each one as a consistent storyboard frame.                                             | `models:read`, `images`, `usage:read`           |
| `product-video`   | Creates a short showcase video of a product, starting from its photo and a planned camera move.                             | `models:read`, `images`, `videos`, `usage:read` |
| `ugc-video`       | Makes a short, vertical, creator-style video with a fast hook and a spoken line about a product.                            | `models:read`, `videos`, `speech`, `usage:read` |
| `explainer-video` | Plans, narrates and generates the scenes of a short explainer video on a topic, product or process.                         | `models:read`, `speech`, `videos`, `usage:read` |
| `voiceover`       | Turns a script into a clean voiceover file with a chosen voice, pace and format.                                            | `models:read`, `speech`, `usage:read`           |

A workflow is listed only when the connection has the scopes its steps need. Every workflow that spends asks for a cost estimate and your go-ahead first.
