Our API docs and AI tools: the llms.txt file and giving an assistant the whole documentation

AI & Agents·· 48 views· 3 min read

The short answer: at the root of the documentation there is an llms.txt file: a plain-text index of every page, in both languages, each with a link to its Markdown version and a sentence about what it covers. At the end, a link to the OpenAPI specification. It is the quickest way to get an AI assistant working from our documentation rather than from what it thinks it knows.

What the file contains

Part What it says
Header The MozOut name, the API base address and a note that every page has a Markdown version.
Documentação em português Every page in Portuguese, with its .md link and description.
Documentation in English The same, in English.
Specification The link to the OpenAPI specification.

How to use it with an assistant

1 An assistant that opens links: give it the llms.txt link and ask it to read only the pages it needs, such as API rules and SMS.
2 An assistant with no internet access: open the page you need, click Copy page and paste the text into the conversation.
3 A coding assistant in your editor: many accept files or links as context. Add the Markdown pages you will use, or the OpenAPI specification.

A well-written request

The more precise the request, the less the assistant makes up. An example:

Read the llms.txt of this documentation and the API rules and SMS pages.
Write a Python function that sends an SMS through the API.
The key comes from the RLX_API_KEY environment variable.
Always send Idempotency-Key and wait for Retry-After after a 429.
Use only operations that appear in the documentation.

Never paste your API key into a conversation with an assistant. It does not need it to write the code; the key only goes into the environment where the program runs. And check the result: if the assistant uses an operation that is not on the "What the API does today" list, that operation does not exist.
What llms.txt is in general, and whether it is worth having on your own website, is covered in llms.txt: what it is.

Open the index and see how it is laid out.

Open llms.txt

SEE ALSO

Every page of our API docs in Markdown: View as Markdown, Copy page and what they are for

Summarise with AI and Share in our API docs: what the buttons do and when to trust the answer

The OpenAPI specification of our API: what it is, where to download it and what it contains

llms.txt: what it is, and whether it does anything for your site

Code examples in our API docs: curl, PHP, Python and JavaScript, ready to copy and adapt

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $6.60/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.