Skip to main content

LLMs.txt

LLMs.txt is a web standard that makes your API documentation AI-accessible. APIMatic's LLMs.txt generation feature automatically creates standardized files that enable AI tools like ChatGPT to understand and work with your API documentation effectively.

Like sitemap.xml or robots.txt, your llms.txt files generate and update automatically as part of your developer portal build process. This enables AI coding assistants to provide accurate, context-aware help to developers using your APIs.

APIMatic creates two complementary files that serve different AI tool consumption patterns.

The llms.txt file

The llms.txt file contains a summary of your documentation with one-sentence descriptions and links for each page. AI tools use this file to quickly understand what documentation you have and where to find specific information. You can access this file at https://your-portal.com/llms.txt.

The llms-full.txt file

The llms-full.txt file contains your complete documentation text including API references, guides, and code examples. AI tools read this file to get detailed information about your API for generating accurate code suggestions. This file is available at https://your-portal.com/llms-full.txt.

The files regenerate automatically whenever your documentation changes, ensuring AI tools always have access to your latest content. Both files follow the plain text llms.txt standard specification for maximum compatibility with AI tools.

Benefits

  • AI tools provide accurate, context-aware code assistance based on your actual documentation
  • Better discovery of relevant API features and faster problem-solving with AI suggestions
  • Lower support burden as AI tools can answer routine documentation questions

Enable LLMs.txt

note

Currently, this feature is only available for developer portals using the Docs-as-Code workflow. The files are generated for the default language specified in your initialPlatform setting, which defaults to HTTP if not explicitly configured.

Add the following configuration to your APIMATIC-BUILD.json file under the generatePortal section:

{
"generatePortal": {
"baseUrl": "your-base-url",
"llmsContextGeneration": {
"enable": true
}
}
}

Verification

After rebuilding your portal, verify the files are generated and accessible:

  1. Navigate to https://your-portal-url/llms.txt
  2. Navigate to https://your-portal-url/llms-full.txt

Additional Resources

For detailed configuration options and troubleshooting, see the LLMS Context Generation Reference in the APIMatic documentation.