> ## Documentation Index
> Fetch the complete documentation index at: https://developers.meshapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Models

> Understanding model IDs, providers, capabilities, and how to choose the right model.

Mesh API routes to models across multiple upstream providers. Models are identified by a `provider/model-name` slug — the same format used in all inference requests.

<Info>
  Looking for the full catalog? [Available Models](/docs/reference/models-list) lists every model Mesh can route to today, with live pricing and context lengths.
</Info>

## What a model is

Mesh acts as a router, forwarding your standardized API calls to an expansive list of underlying foundational models. A **model** is a distinct neural network trained by an AI organization (OpenAI, Google, Anthropic, Meta, and others).

Each model handles a different maximum **context length** — the number of tokens it can process in a single request. Fast, small models may have smaller limits but respond almost instantly; large models can handle whole documents and are optimized for reasoning, at higher latency and cost.

When choosing one, weigh three things:

* **Cost** — do you need high intelligence, or just rapid categorization?
* **Latency** — lighter models offer much lower time-to-first-token.
* **Context length** — passing an entire codebase or large PDF needs a long-context model.

## Model ID format

```
<provider>/<model-name>
```

Examples:

| Model ID                                            | Provider               | Notes           |
| --------------------------------------------------- | ---------------------- | --------------- |
| `openai/gpt-4o`                                     | OpenAI                 | GPT-4o flagship |
| `openai/gpt-4o-mini`                                | OpenAI                 | Fast, cheap     |
| `anthropic/claude-opus-4-8`                         | OpenRouter → Anthropic | Via OpenRouter  |
| `anthropic/claude-haiku-4.5`                        | OpenRouter → Anthropic | Fastest Claude  |
| `google/gemini-pro-1.5`                             | OpenRouter → Google    | Long context    |
| `meta-llama/llama-3.3-70b-instruct`                 | OpenRouter             | Open weights    |
| `bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0` | AWS Bedrock            | Native Bedrock  |
| `vertex/gemini-1.5-pro-002`                         | Google Vertex AI       | Native Vertex   |
| `sarvam/bulbul:v3`                                  | Sarvam                 | Indian TTS      |

## Listing available models

```bash theme={null}
curl https://api.meshapi.ai/v1/models \
  -H "Authorization: Bearer rsk_YOUR_KEY"
```

The response is a JSON array of enabled models with pricing:

```json theme={null}
[
  {
    "id": "openai/gpt-4o-mini",
    "name": "GPT-4o-mini",
    "brand": "openai",
    "model_type": "text",
    "context_length": 128000,
    "is_free": false,
    "input_modalities": ["text"],
    "output_modalities": ["text"],
    "supports_tools": true,
    "supports_embeddings": false,
    "supports_realtime": false,
    "supports_structured_output": true,
    "supports_system_prompt": true,
    "supports_batching": false,
    "supports_thinking": false,
    "supports_completions_api": true,
    "supports_responses_api": true,
    "pricing": {
      "pricing_unit": "per_1m_tokens",
      "prompt_usd_per_1m": "0.15000000",
      "completion_usd_per_1m": "0.60000000",
      "input_usd_per_unit": "0.1500000000",
      "output_usd_per_unit": "0.6000000000",
      "cache_read_input_usd_per_1m": "0.07500000",
      "effective_date": "2026-04-14",
      "discount_pct": null
    }
  }
]
```

The `pricing` object carries a field per billing dimension the model supports —
cache read/write, long context, batch, audio, per-image, and a flat `request_usd`
where one applies. Dimensions the model does not bill for are `null`. See
[Pricing](/docs/getting-started/pricing) for how the units work.

### Query parameters

| Parameter  | Type    | Description                                                          |
| ---------- | ------- | -------------------------------------------------------------------- |
| `free`     | boolean | `true` = free models only, `false` = paid only, omit = all           |
| `type`     | string  | Filter by model type: `text`, `embedding`, `image`, `audio`, `video` |
| `provider` | string  | Filter by upstream provider: `amazon-bedrock`, `vertex`, `openai`    |

### Additional endpoints

| Endpoint                    | Description                                                                |
| --------------------------- | -------------------------------------------------------------------------- |
| `GET /v1/models/{model_id}` | Returns a single enabled model by its full model ID (e.g. `openai/gpt-4o`) |
| `GET /v1/models/search`     | Search the catalog by name, ID, or description                             |

## Choosing a model

### By task type

| Task              | Recommended models                                                      |
| ----------------- | ----------------------------------------------------------------------- |
| General chat      | `openai/gpt-4o-mini`, `anthropic/claude-haiku-4.5`                      |
| Complex reasoning | `openai/gpt-4o`, `anthropic/claude-opus-4-8`                            |
| Long documents    | `google/gemini-pro-1.5` (1M context)                                    |
| Code generation   | `openai/gpt-4o`, `meta-llama/llama-3.3-70b-instruct`                    |
| Embeddings        | `openai/text-embedding-3-small`, `bedrock/amazon.titan-embed-text-v2:0` |
| Text to speech    | `openai/tts-1`, `sarvam/bulbul:v3` (Indian languages)                   |
| Image generation  | `openai/gpt-image-1-mini`, `openai/dall-e-3`                            |

### By cost

Free models (`is_free: true`) cost \$0 for both prompt and completion tokens. Check the Dashboard → **Models** tab to filter for free models by provider.

Paid model pricing varies widely — a frontier reasoning model may cost 100× more per token than a lightweight model. Check `pricing.prompt_usd_per_1m` and `pricing.completion_usd_per_1m` in the API response for live pricing.

### Let the gateway decide

Set `"model": "auto"` and the gateway classifies your prompt and picks an appropriate model automatically. See [Auto Routing](/docs/capabilities/auto-routing).

## Model capabilities

| Field                               | Type                | Meaning                                                                                                                |
| ----------------------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `id`                                | string              | Full model ID, `brand/model-name`                                                                                      |
| `brand`                             | string              | The organization that trained the model, e.g. `openai`, `anthropic`                                                    |
| `context_length`                    | integer             | Maximum combined prompt + completion tokens                                                                            |
| `model_type`                        | string              | `text`, `embedding`, `image`, `audio`, `tts`, `stt`, or `video`                                                        |
| `input_modalities`                  | string\[]           | Accepted input types (e.g. `["text", "image"]`)                                                                        |
| `output_modalities`                 | string\[]           | Produced output types (e.g. `["text"]`)                                                                                |
| `supports_tools`                    | boolean             | Supports tool/function calling                                                                                         |
| `supports_embeddings`               | boolean             | Can produce embedding vectors                                                                                          |
| `supports_realtime`                 | boolean             | Supports WebSocket realtime sessions                                                                                   |
| `supports_structured_output`        | boolean             | Supports JSON schema-constrained output                                                                                |
| `supports_system_prompt`            | boolean             | Accepts a system message                                                                                               |
| `supports_batching`                 | boolean             | Eligible for async batch requests                                                                                      |
| `supports_thinking`                 | boolean             | Exposes chain-of-thought reasoning tokens                                                                              |
| `supports_completions_api`          | boolean             | Compatible with `/v1/chat/completions`                                                                                 |
| `supports_responses_api`            | boolean             | Compatible with `/v1/responses`                                                                                        |
| `supports_video_generation`         | boolean             | Can generate video                                                                                                     |
| `supports_background_response`      | boolean             | Eligible for `background: true` on `/v1/responses`                                                                     |
| `supports_image_*`                  | boolean             | Image edit capabilities — `edit`, `inpaint`, `outpaint`, `mix`, `reframe`, `upscale`, `reference`, `remove_background` |
| `is_composite` / `composite_models` | boolean / string\[] | Whether the entry fans out to several underlying models, and which                                                     |
| `is_free`                           | boolean             | \$0 cost for all tokens                                                                                                |

`supports_system_prompt` defaults to `true`. Check the relevant flag before sending a request that depends on a specific capability — an unsupported feature is generally rejected by the upstream rather than silently downgraded.

## Provider routing

Each model is backed by one upstream provider. The provider determines authentication, latency, and regional availability:

| Provider slug | Upstream                                                         |
| ------------- | ---------------------------------------------------------------- |
| `openrouter`  | OpenRouter (aggregator — proxies Anthropic, Meta, Mistral, etc.) |
| `openai`      | OpenAI direct                                                    |
| `bedrock`     | AWS Bedrock                                                      |
| `vertex`      | Google Vertex AI                                                 |
| `qwen`        | Alibaba Cloud DashScope                                          |
| `sarvam`      | Sarvam AI                                                        |
| `byteplus`    | BytePlus (video)                                                 |

<Info>
  The model registry is live — models can be enabled or disabled by the platform team. Always use `GET /v1/models` at runtime rather than hardcoding a static model list.
</Info>
