# How AI reads an API

> How your AI reads API docs on Dockito: the overview, finding a task in words, operations, types and a ready-to-run call.

Your AI never reads a whole spec. It reads the overview, finds what the task needs, and reads just that: about 3,000 tokens to go from "add refunds to checkout" to a working call on Stripe's 8 MB spec.

## The reads

Through MCP `get` on an API doc:

| Read | Gives |
|---|---|
| (none) | The overview: the API, its groups, how it works (auth, pagination, errors), the checks, the version |
| `find: "refund a payment"` | The operations for a task in plain words, best first |
| `group: "refunds"` | A group's operations, a line each |
| `ops: ["PostRefunds"]` | Operations whole: parameters, body, responses (`"POST /v1/refunds"` works too) |
| `schemas: ["refund"]` | Schemas whole |
| `refs_to: "refund"` | What uses a schema |
| `types: ["PostRefunds"]` | The request and response as TypeScript (or `{"ops": […], "lang": "zod"}`, `"pydantic"`) |
| `call: "PostRefunds"` | A ready call with the required fields (`{"op": …, "lang": "fetch"}`, `"python"`) |
| `since: 12` | What changed since version 12; with `breaking: true`, only what breaks |
| `depth: 1` | Expands `$ref`s one level (up to 3) |
| `lines: "120-260"` | The file's own lines |
| `export: "postman"` | A download link to the whole API as a Postman collection, `"json"`, `"yaml"` or `"markdown"`; it opens without sign-in for 10 minutes |

Long replies page (`page: 2`) and say how to narrow.

## Changing a spec

`edit_openapi` changes the spec at the version your AI read (`base`) and publishes the next one. The layout and comments of the file stay.

```json
{ "doc": "bookings-api", "base": 7, "ops": [
  { "op": "param", "at": "POST /bookings", "add": { "name": "Idempotency-Key", "in": "header", "schema": { "type": "string" } } }
] }
```

```text
v8 from v7: 1 op. POST /bookings: + param "Idempotency-Key" (optional).
Breaking: none.
```

All ops apply or none. If someone changed the same operation since `base`, nothing is saved and the reply says what changed, so your AI can read it again.
