# Build with AI

> How to give Claude Code, Cursor or ChatGPT the right context from the Messajo docs, with llms.txt, per-page Markdown and OpenAPI.

A coding assistant gets the API right more often when it reads the real documentation instead of guessing. Messajo publishes the docs in formats made for that.

## What you can hand to the assistant

| What | Where | What for |
| --- | --- | --- |
| Docs index | [`https://docs.messajo.com/llms.txt`](/llms.txt) | Short index: API description and links to the full docs, the condensed docs and OpenAPI. To read a single page, use its `.md` |
| Full docs | [`https://docs.messajo.com/llms-full.txt`](/llms-full.txt) | Everything in a single file, for a large context |
| Short docs | [`https://docs.messajo.com/llms-small.txt`](/llms-small.txt) | Abridged version, for a small context |
| One page | `<page url>.md` | The page as plain Markdown |
| OpenAPI | [`/openapi.json`](/openapi.json) | The exact contract of every route, body and error |

The `llms*.txt` files are generated from the Portuguese pages only. The per-page `.md` files exist in every language.

## Every page as Markdown

Append `.md` to the address of any page:

```text
https://docs.messajo.com/start/quickstart.md
https://docs.messajo.com/en/start/quickstart.md
https://docs.messajo.com/es/start/quickstart.md
```

Next to every page title there is a **Copy page** control. It copies the page Markdown to the clipboard and its menu offers **View as Markdown**, **Open in ChatGPT** and **Open in Claude**. The last two open the assistant with a request to read that page.

## OpenAPI

The API contract is available as JSON, one file per language:

- [`/openapi.json`](/openapi.json): English.
- [`/openapi.pt-BR.json`](/openapi.pt-BR.json): Portuguese.
- [`/openapi.es.json`](/openapi.es.json): Spanish.

The [interactive reference](/en/reference) is generated from the same file, and so are the types of the [TypeScript SDK](/en/sdk/typescript/). Hand over the OpenAPI when the assistant needs the exact shape of a request body.

## Point the assistant at the docs

The path is the same in Claude Code, Cursor and other coding assistants:

1. **In the conversation.** Paste the address of `llms.txt` or of the page's `.md` and ask it to read it before writing code.
2. **In the project's instruction file.** Write the address once in the file your assistant reads at the start of every session (such as `CLAUDE.md` or the project rules), and every session starts with the docs at hand.
3. **For exact formats.** Give it `openapi.json`, or the `.md` of the page for the route in question, instead of asking the assistant to remember.

Example snippet for the instruction file:

```text
Messajo API (official WhatsApp, Instagram and Messenger):
- Docs index: https://docs.messajo.com/llms.txt
- API contract: https://docs.messajo.com/openapi.json
- Before writing code that calls the API, read the route's .md page.
- Use the @messajo/sdk SDK; never invent fields outside the OpenAPI.
```

## What helps an assistant debug

Every API error has the same body, with three fields that help whoever is debugging (see [Error format](/en/errors/)):

- `code`: a stable identifier, safe to handle in code.
- `docs_url`: a link to the `code` in [Errors](/en/errors/), with its meaning and what to do.
- `request_id`: the same value as the `X-Request-Id` header (see [X-Request-Id for support](/en/api/authentication/#x-request-id-for-support)).

Paste the whole error body into the assistant: the `docs_url` leads to the right explanation.

## First task

A good first request, with `llms.txt` already in the conversation:

```text
Read https://docs.messajo.com/en/send/text.md and https://docs.messajo.com/en/webhooks/verify-signature.md.
Then, with @messajo/sdk:
1. send a text to 5511999999999 using the key in MESSAJO_API_KEY;
2. create an endpoint that receives webhooks and verifies the Messajo-Signature
   header before handling the event.
If a field is not in the docs, ask instead of making it up.
```

Supporting pages: [Send text](/en/send/text/) and [Verify the signature](/en/webhooks/verify-signature/).
