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

# LLM Router API

> Run prompts through the LLM of your choice and get each answer with the exact model version, its maker, the finish reason, token counts and the exact cost of the call. You pay exactly what each call costs at the model's own token rates.

`POST /v1/data/llm/route/run`

**Pricing:** Metered: you pay exactly each call's cost at the selected model's rates (default OpenAI: GPT-4o-mini: \$0.15 per 1M input tokens).

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**prompts** `string[]` *required*

One or more prompts. Each prompt is one call to the model and one row.

**model** `string` (default: openai/gpt-4o-mini)

The model that answers. Pick from the list (popular models first). Each model shows its own rates per 1M input and output tokens, and that is exactly what each call costs.

358 allowed values, for example `openai/gpt-4o-mini` (OpenAI: GPT-4o-mini), `openai/gpt-5.6-luna-pro` (OpenAI: GPT-5.6 Luna Pro), `openai/gpt-5.6-luna` (OpenAI: GPT-5.6 Luna), `openai/gpt-5.6-terra-pro` (OpenAI: GPT-5.6 Terra Pro), `openai/gpt-5.6-terra` (OpenAI: GPT-5.6 Terra), `anthropic/claude-fable-5.2` (Anthropic: Claude Fable 5.2), `anthropic/claude-haiku-5.5` (Anthropic: Claude Haiku 5.5), `anthropic/claude-sonnet-5.5` (Anthropic: Claude Sonnet 5.5), `anthropic/claude-opus-5.5` (Anthropic: Claude Opus 5.5), `google/gemini-4-hydrogen` (Google: Gemini 4 Hydrogen). Fetch the full list with `GET /v1/data/llm/route?expand=options`.

**files** `string[]`

Optional public file URLs (image, audio, video or PDF) for models that can read them. One prompt with several files runs the prompt on each file; several prompts with one file asks each prompt about that file. Several prompts with several files is refused. The model must accept the file type.

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/llm/route/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "prompts": [
      "Describe this image in one short sentence."
    ],
    "files": [
      "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg",
      "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png",
      "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg"
    ],
    "model": "openai/gpt-4o-mini"
  }
}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.mindcase.co/v1/data/llm/route/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "prompts": [
        "Describe this image in one short sentence."
    ],
    "files": [
        "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg",
        "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png",
        "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg"
    ],
    "model": "openai/gpt-4o-mini"
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/llm/route/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "prompts": [
    "Describe this image in one short sentence."
  ],
  "files": [
    "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg",
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png",
    "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg"
  ],
  "model": "openai/gpt-4o-mini"
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one answer, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `id` | ID | text |
| `prompt` | Prompt | text |
| `fileUrl` | File URL | text |
| `answer` | Answer | text |
| `model` | Model | text |
| `provider` | Provider | text |
| `finishReason` | Finish Reason | text |
| `promptTokens` | Prompt Tokens | number |
| `completionTokens` | Completion Tokens | number |
| `reasoningTokens` | Reasoning Tokens | number |
| `totalTokens` | Total Tokens | number |
| `costUsd` | Cost (USD) | number |
| `createdAt` | Created At | datetime |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "llm/route",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "fileUrl": "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg",
      "finishReason": "stop",
      "answer": "A close-up of an orange tabby cat with striking yellow eyes.",
      "provider": "OpenAI",
      "totalTokens": 25530,
      "completionTokens": 14,
      "model": "openai/gpt-4o-mini",
      "id": "gen-1794256172-sFQSXJKIw2DGTe9KEDT9",
      "promptTokens": 25516,
      "prompt": "Describe this image in one short sentence.",
      "costUsd": 0.0023478,
      "createdAt": "2026-11-09T20:29:32Z",
      "reasoningTokens": 0
    }
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.