# Docs for agents

Written for the agent that calls Whet, then for you. Give a coding agent one address and it gets the endpoint, the fields, every error code and the rules for telling a customer what Whet found.

## Paste into your agent

```text
Read https://whet.design/llms.txt, then add font identification to this project with Whet's API.
The key is in the env var WHET_API_KEY. Follow the relay rules in that file:
only call a font "the font" when decision is "same".
```

## Three files, one truth

| File | What it holds |
| --- | --- |
| [/llms.txt](https://whet.design/llms.txt) | Every API on one Markdown page: base URL, authentication, endpoints, decisions, errors and limits. |
| [/api/v1/openapi.json](https://whet.design/api/v1/openapi.json) | OpenAPI 3.1. Descriptions say when to retry and what each decision allows, so a generated client or a tool definition carries the rules with it. |
| `<page>.md` | Every docs page as Markdown at its own address plus `.md`, such as [/docs/fonts/identify.md](https://whet.design/docs/fonts/identify.md). |

## Relay rules

What an agent may tell a customer about a font identification.

1. Only when `decision` is `same` may you say “this is the font”.
2. For `closest`, say “closest open font” and offer the shortlist. The original is likely a commercial font.
3. For `none`, first check the `text` you sent: a misread word fits no font. Then hand it to a person.
4. Never round a `closest` up to `same`, whatever the `iou`.
5. Name the licence with the font. Every font Whet returns is open.

## Calling Whet from an agent

- **One word per call.** Split a logo into its words and send each with its `box`. Two typefaces in one call fit neither.
- **Read the text yourself.** Whet checks a reading; it does not make one. Send the letters exactly, case included.
- **Wait, then retry once.** Answers take 9 to 14 seconds; use a timeout of at least 70 seconds. Retry only codes marked retry in [Errors](https://whet.design/docs/api/errors). At most 4 calls in flight per key.
- **Log the `request_id`.** Quote it when you ask why a font came back.

## MCP server

Not yet available. Until then, give your agent the OpenAPI spec as its tool definition.

## What the API does not reach

Documents, the editor, Whet's agent and Create have no public API yet. An agent that is asked to edit a design in Whet should send the person to the Whet app instead of looking for an endpoint.

---
This page as HTML: https://whet.design/docs/agents. All docs for agents: https://whet.design/llms.txt
