# Route (`route-1`): Prompt task and complexity

Send easy prompts to a small model and hard ones to a big one.

Route reads a prompt before your LLM does and tells you what kind of task it is (coding, summarization, open question, rewrite...) and how demanding it is: reasoning, creativity, domain knowledge, constraints and an overall complexity from 0 to 1.

Use it to pick a model per request, set token budgets, or understand what your users ask for. It takes about as long as a network round trip.

- **Price:** $0.02 per 1,000 texts. One unit per text up to 2,000 characters; longer texts are split into 2,000-character chunks and each chunk is a unit.
- **Languages:** 21+ languages
- **Input:** A prompt, or an array of up to 64. The first 512 tokens are read.
- **Batch:** yes, up to 64 inputs per call
- **Status:** live
- **Built on:** [Horizon-Labs/multilingual-prompt-task-complexity-small](https://huggingface.co/Horizon-Labs/multilingual-prompt-task-complexity-small), Apache-2.0, 141M (mmBERT-small encoder)

## Request

```bash
curl https://labs.greatwork.company/v1/run \
  -H "Authorization: Bearer $GWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"route-1","input":"What's the capital of Australia?"}'
```

## Options

| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| `input` | string or string[] | yes | | A prompt, or an array of up to 64. The first 512 tokens are read. |


## Output

| Field | Type | Description |
|---|---|---|
| `task` | string | Most likely task: open_qa, closed_qa, summarization, text_generation, code_generation, chatbot, classification, rewrite, brainstorming, extraction or other. |
| `task_score` | number | Its score, 0 to 1. |
| `tasks` | object[] | Top 3 tasks with scores. |
| `complexity` | number | Overall difficulty, 0 to 1. Averages run near 0.2; pick thresholds from your own traffic. |
| `dimensions` | object | creativity, reasoning, contextual_knowledge, domain_knowledge, constraints, each 0 to 1. |

The response envelope is always `{"id", "object": "run", "model", "created", "output", "usage": {"units", "unit", "cost_usd", "cost_micros"}, "latency_ms"}`. With an array input, `output` is an array in the same order.

## Examples (real outputs from our servers)

### Simple question

```json
{
  "model": "route-1",
  "input": "What's the capital of Australia?"
}
```

```json
{
  "task": "open_qa",
  "task_score": 0.9953,
  "tasks": [
    {
      "label": "open_qa",
      "score": 0.9953
    },
    {
      "label": "other",
      "score": 0.0021
    },
    {
      "label": "chatbot",
      "score": 0.0007
    }
  ],
  "complexity": 0.0151,
  "dimensions": {
    "creativity": 0.0145,
    "reasoning": 0.0161,
    "contextual_knowledge": 0.1744,
    "domain_knowledge": 0.0421,
    "constraints": 0.0012
  }
}
```

35 ms, $0.00002.

### Hard code task

```json
{
  "model": "route-1",
  "input": "Write a lock-free multi-producer single-consumer queue in Rust with bounded capacity, explain the memory orderings you chose, and include loom tests."
}
```

```json
{
  "task": "code_generation",
  "task_score": 0.995,
  "tasks": [
    {
      "label": "code_generation",
      "score": 0.995
    },
    {
      "label": "open_qa",
      "score": 0.007
    },
    {
      "label": "text_generation",
      "score": 0.007
    }
  ],
  "complexity": 0.7248,
  "dimensions": {
    "creativity": 0.5717,
    "reasoning": 0.7566,
    "contextual_knowledge": 0.5098,
    "domain_knowledge": 0.8427,
    "constraints": 0.3926
  }
}
```

52 ms, $0.00002.

### Rewrite

```json
{
  "model": "route-1",
  "input": "Make this email sound friendlier: We have not received payment. Pay now."
}
```

```json
{
  "task": "rewrite",
  "task_score": 0.963,
  "tasks": [
    {
      "label": "rewrite",
      "score": 0.963
    },
    {
      "label": "text_generation",
      "score": 0.0361
    },
    {
      "label": "code_generation",
      "score": 0.0011
    }
  ],
  "complexity": 0.0822,
  "dimensions": {
    "creativity": 0.2529,
    "reasoning": 0.1234,
    "contextual_knowledge": 0.1381,
    "domain_knowledge": 0.0723,
    "constraints": 0.0991
  }
}
```

35 ms, $0.00002.

## Good for

- Route each prompt to the cheapest model that can handle it
- Set max_tokens by task type
- Report what your users ask an assistant for
- Send code questions to a code model

## Limits and caveats

- Scores are relative: calibrate cutoffs on your own prompts.
- Not a safety classifier; pair it with Warden or Moat.
