---
name: win-sh-ai-model-router
description: Use this skill when an AI agent needs to choose an AI model by task, cost, speed, benchmark quality, or fallback through the public win.sh AI Model Router API.
---

# win.sh AI Model Router

Use this skill when you need to choose a model instead of hardcoding one.

## Discovery

- Landing page: https://win.sh/ai-model-router
- Agent index: https://win.sh/llms.txt
- OpenAPI: https://win.sh/openapi.json
- API OpenAPI: https://win.sh/api/openapi.json
- Model table: https://win.sh/router/models

## Endpoints

- `GET /router?task=code&latency=fast&budget=low&quality=high`
- `GET /router?task=code&latency=fast&budget=low&quality=high&providers=anthropic,openai`
- `GET /router?task=code&latency=fast&budget=low&quality=high&regions=us,eu`
- `GET /router/raw?task=code&latency=fast&budget=low&quality=high`
- `GET /router/models`
- `GET /router/cheapest`
- `GET /router/cheapest/raw`
- `GET /router/fastest`
- `GET /router/fastest/raw`
- `GET /router/smartest`
- `GET /router/smartest/raw`
- `GET /router/best-value`
- `GET /router/best-value/raw`

Legacy `/api/*` aliases are still available for compatibility.

Public read endpoints require no authentication.

## Route Params

- `task`: `summary`, `extraction`, `code`, `reasoning`, `planning`, or `general`
- `latency`: `fast`, `normal`, or `overnight`
- `budget`: `low` or `balanced`
- `quality`: `balanced` or `high`
- `providers`: optional comma-separated provider allowlist, such as `anthropic,openai`
- `regions`: optional comma-separated model provider region allowlist, using `us`, `eu`, and `china`

## Workflow

1. Classify the job before picking a model.
2. Use `task=code&quality=high` for coding, debugging, tests, and refactors.
3. Use `task=summary&budget=low&quality=balanced` for simple summaries.
4. Use `task=extraction&budget=low&quality=balanced` for structured extraction.
5. Use `task=reasoning&quality=high` for hard analysis and multi-step decisions.
6. Use `task=planning&quality=high` for roadmaps, execution plans, and project breakdowns.
7. Call `/router` when you need the reason, fallback, price, speed, and logo metadata.
8. Call `/router/raw` when a shell script or agent only needs the model id.
9. Use the returned `fallback` if the selected provider fails or is unavailable.
10. Add `providers=anthropic,openai` when the caller is only allowed to use selected providers.
11. Add `regions=us,eu` or `regions=china` when the caller is only allowed to use models from selected provider regions.

## Examples

```bash
curl "https://win.sh/router?task=code&latency=fast&budget=low&quality=high"
curl "https://win.sh/router?task=code&latency=fast&budget=low&quality=high&providers=anthropic,openai"
curl "https://win.sh/router?task=code&latency=fast&budget=low&quality=high&regions=us,eu"
curl "https://win.sh/router/raw?task=summary&latency=fast&budget=low&quality=balanced"
curl "https://win.sh/router/cheapest/raw"
curl "https://win.sh/router/models"
```

## Response Shape

`/router` returns the selected model, human-readable name, provider, favicon logo URL, fallback, reason, policy, price, intelligence score, speed, task, provider filter, region filter, and update time.

`/router/raw` returns only the model id as plain text.

If `providers` is set and no verified model matches the allowlist, the router returns `400` instead of picking a model outside the allowed providers.

If `regions` is set and no verified model matches the allowlist, the router returns `400` instead of picking a model outside the allowed regions.

## Selection Rules

- Cheap routine work favors reliable low-cost models.
- Coding favors coding benchmark score with price and speed checks.
- Reasoning favors reasoning benchmark score and a higher quality floor.
- Planning balances reasoning, speed, and price.
- Fast latency raises the speed weight.
- Low budget raises the price weight.
- High quality raises the benchmark floor.
