# Model selector

> Describe an agent and get a ranked list of models that fit it, with reasons and prices.

Send the agent's system prompt, code or a description, plus preferences. Give at least one of the three texts.

```
POST https://models.pydantic.dev/api/select
Content-Type: application/json

{"system_prompt": "...", "code": "...", "description": "...", "weights": "any", "price_appetite": 3, "gateway_only": false, "latency": false}
```

- `weights`: `any`, `open` or `closed`
- `price_appetite`: 1 (the cheapest model that works) to 5 (the best available)
- `gateway_only`: only models built in to Pydantic AI Gateway
- `latency`: the agent is interactive, so speed matters

The response has `needs` (what the agent needs from a model) and up to five `recommendations`, best first, each with a `slug`, a `score` from 0 to 100, `reasons`, and the `model` as it appears in https://models.pydantic.dev/models.json, plus a `summary` of two or three sentences. Two models rank the candidates and their scores are averaged. If the input does not describe an agent, `recommendations` is empty and `more_input` says what to send instead. A request takes around ten seconds and is rate limited.

Send `Accept: text/event-stream` to get the answer in stages as server-sent `update` events, each a full response with a `status`: `partial` when the first model has ranked, `summarising` when both have, and `done` with the final summary.

Every response has an `id`: the `id` in the request if it is a UUID, or a new one. A run is not saved over an existing run with the same `id`. A finished run with recommendations is saved for 30 days: `GET https://models.pydantic.dev/api/select/runs/{id}` returns it with the `request` that was sent, and `DELETE` on the same URL deletes it; https://models.pydantic.dev/select/{id} shows it. Recommendations are saved by slug and returned with the model's current data, or `model: null` if the model has left the registry. Anyone who has the ID can read or delete the run.

To filter the list yourself instead: `https://models.pydantic.dev/api/models`
