> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mixlayer.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mixlayer.com/_mcp/server.

# Pricing

> Understand how Mixlayer calculates inference and hosted-tool charges

Mixlayer charges for the model usage and hosted tools consumed by a request. Model rates vary, so the [Models section of the console](https://console.mixlayer.com/app/models) is the source of truth for current prices.

## Generation models

Generation models can have three token rates:

| Usage          | How it is charged                                                                                                                   |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Uncached input | Input tokens that were not served from the prompt cache, at the model's input rate.                                                 |
| Cached input   | Cached input tokens, at the model's cache-read rate.                                                                                |
| Output         | All generated tokens, at the model's output rate. Reasoning models may generate reasoning tokens in addition to the visible answer. |

To estimate the token cost, convert each token count to millions and multiply it by the corresponding rate:

```text
cost =
  uncached input × input rate
  + cached input × cache-read rate
  + output × output rate
```

Uncached input is total input minus cached input.

The API response reports token usage. Chat Completions returns `prompt_tokens`, `completion_tokens`, and `prompt_tokens_details.cached_tokens`; Responses returns `input_tokens`, `output_tokens`, and `input_tokens_details.cached_tokens`.

### Worked example

Suppose a model has these hypothetical rates:

* Input: \$0.20 per million tokens
* Cached input: \$0.05 per million tokens
* Output: \$0.80 per million tokens

A request uses 1,000,000 total input tokens, of which 200,000 are cached, and generates 100,000 output tokens:

| Usage                 | Calculation                  | Cost       |
| --------------------- | ---------------------------- | ---------- |
| Uncached input        | 800,000 ÷ 1,000,000 × \$0.20 | \$0.16     |
| Cached input          | 200,000 ÷ 1,000,000 × \$0.05 | \$0.01     |
| Output                | 100,000 ÷ 1,000,000 × \$0.80 | \$0.08     |
| **Total model usage** |                              | **\$0.25** |

These rates are illustrative. Always use the current rates shown in the [Mixlayer console](https://console.mixlayer.com/app/models).

## Embeddings

Embedding requests are charged only for the input tokens processed, at the embedding model's input rate. There is no output-token charge because the returned vectors are not generated tokens.

For a batch, usage is the combined input tokens across all items. Changing the output dimensions changes the vector size, but not the number of input tokens billed. The response reports the billed token count in `usage.prompt_tokens`.

## Hosted tools

Hosted-tool charges are added to model usage. A tool call that completes is billable even if the subsequent model generation fails. The response reports hosted-tool usage under `usage.server_tool_use`.

See [Server-Side Tools](/server-side-tools) for current web-search pricing and usage fields.

## Interrupted and failed requests

* Successful generation is billed from its recorded token usage.
* Work already generated when the client disconnects may still be billable.
* A failed generation is not billed for model tokens, but any hosted-tool calls that completed remain billable.

Set realistic output-token limits and stop streams you no longer need, but do not assume disconnecting cancels work that has already completed.

## Billing accounts and credits

Organizations use either prepaid or post-paid billing. Prepaid usage draws from the billing account's credit balance; post-paid usage is invoiced. See [Credits & Limits](/credits-and-limits) for recharges, automatic top-up, billing errors, and spend controls.

## Custom and fine-tuned models

Mixlayer can host custom, fine-tuned, and distilled models for you. [Get in touch](mailto:hello@mixlayer.com) to discuss pricing.