# Route prompts automatically with enso-auto

URL: https://docs.hanzo.ai/docs/guides/enso/adaptive-tier-routing

> Send model: enso-auto with reasoning_effort to let Enso select the optimal model tier per request and inspect X-Routed-Model.

**Stop hardcoding a single model ID across routine extractions and deep refactors.** `enso-auto` starts at `enso-flash` and escalates only when the router or Kai judges a prompt needs `enso-pro`, `enso-max`, or `enso-ultra`.

## Architecture & contract

Enso classifies each prompt on CPU (`12 µs` for the learned policy), filters to models your org can serve, and bills strictly at the tier that answered. `X-Routed-Model` and the response body's `routing` object report the chosen tier and reason.

**Primary endpoint:** `POST /v1/chat/completions` · \*_Status:_\* `shipped` · \*_Level:_\* `foundations`

## Run it across all four surfaces

**CLI**

```bash
hanzo chat completions --data '{
  "model": "enso-auto",
  "reasoning_effort": "auto",
  "messages": [{"role": "user", "content": "Explain why a B-tree beats a hash index for range queries."}]
}'
```

**SDK**

**TypeScript**

```ts
import { Configuration, AiApi } from 'hanzoai';

const ai = new AiApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await ai.postChatCompletions({
  model: 'enso-auto',
  messages: [{ role: 'user', content: 'Explain why a B-tree beats a hash index for range queries.' }],
});
console.log(data);
```

**Python**

```python
import os
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AiApi

api = AiApi(ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"])))
print(api.post_chat_completions(
    model="enso-auto",
    messages=[{"role": "user", "content": "Explain why a B-tree beats a hash index for range queries."}],
))
```

**HTTP**

```bash
curl -si https://api.hanzo.ai/v1/chat/completions \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "enso-auto",
    "reasoning_effort": "auto",
    "messages": [{"role": "user", "content": "Explain why a B-tree beats a hash index for range queries."}]
  }'
```

**MCP**

```bash
curl -s -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "ai",
      "arguments": {"op": "get_models", "input": {}}
    }
  }'
```

## Verify the outcome

- Inspect `X-Routed-Model` in the HTTP response headers.
- Compare a trivial one-line extraction (routes to `enso-flash`) vs. a multi-file architecture critique (escalates to `enso-pro`/`enso-max`).

## Production guardrails

- Pass `reasoning_effort: "instant"` for latency-sensitive formatting calls where extended thinking adds zero value.

## Next steps & Hanzo University

- [Enso Model Reference](https://docs.hanzo.ai/docs/models/enso) · [Cost & Latency Bounds](https://docs.hanzo.ai/docs/guides/enso/cost-latency-bounds)

- **[ENS 201 — Enso Adaptive Intelligence](https://hanzo.university/enso-adaptive-intelligence)** ([Launch interactive lab on hanzo.app/learn](https://hanzo.app/learn/enso-adaptive-intelligence))

- **[PRA 104 — AI Practitioner](https://hanzo.university/ai-practitioner)** ([Launch interactive lab on hanzo.app/learn](https://hanzo.app/learn/ai-practitioner))
