# Using the docs as an agent

> Machine-readable versions of these docs for AI agents and coding assistants, including llms.txt, Markdown pages, the OpenAPI spec and the reference JSON.

Every page in these docs is available in a form an agent can read without rendering HTML.

| URL | What it is | Use it for |
|---|---|---|
| `https://dataforgaio.com/llms.txt` | An index of every docs page, with one-line descriptions and links to the Markdown versions, in the llmstxt.org format | Finding the right page |
| `https://dataforgaio.com/llms-full.txt` | All guides and the full API reference as one Markdown file | Loading everything into a long context at once |
| `https://dataforgaio.com/docs/<page>.md` | Any docs page as raw Markdown, for example `/docs/quickstart.md` or `/docs/api/serp-google-organic-live-advanced.md` | Reading one page |
| `https://dataforgaio.com/openapi.json` | The OpenAPI 3.1 spec for every served endpoint | Generating clients and tool definitions |
| `https://dataforgaio.com/docs/api-reference.json` | The reference data behind the endpoint pages: fields, prices per mode and level, errors and examples | Structured lookups, such as the price of an endpoint |

## Pointing a coding assistant at the docs

Give the assistant the index and let it pull pages as needed:

```text
Use the DataForGAIO API docs. Start from https://dataforgaio.com/llms.txt and
fetch the .md version of any page you need. Base URL: https://api.dataforgaio.com/v1.
Auth: Basic with any login and my dg_ key as the password (or Bearer).
Always set max_cost on tasks.
```

For a project that will use the API heavily, save `llms-full.txt` into the repository or the assistant's context so it doesn't fetch it on every session.

## Generating tools from OpenAPI

`/openapi.json` describes each operation with its request body, response schema, examples and errors. Most agent frameworks can turn it into tool definitions directly. Two things to add by hand:

- **Cost controls.** Make `max_cost` a required argument on every tool that calls a paid endpoint, and set a default. See [Tool-calling tips](https://dataforgaio.com/docs/tool-calling-tips.md).
- **Auth.** Inject the key on the server side, as a Basic password or a Bearer token. Never pass it to the model.

## Discovering what's served

The API can describe itself too, with your key:

- `GET /v1/account/support_matrix?supported=true` lists every served route with its method, mode and price.
- `GET /v1/account/user_data` returns your balance and the full price table.
- `GET /v1/ai/<engine>/llm_responses/models` lists the AI models for an engine.
- `GET /v1/serp/google/locations` and `/languages` list targeting codes.

All four are free.

## The MCP server

If your agent speaks the Model Context Protocol, the hosted MCP server gives it the Crawl API, `POST /v1/serp` and the AI visibility reports as ready-made tools. See [MCP server](https://dataforgaio.com/docs/mcp-server.md).
