llms.txt
是一项拟议标准,旨在使网站内容对大语言模型更易于访问。与用于网络爬虫的 robots.txt 类似,llms.txt
告知 AI 工具有哪些文档可用以及如何访问这些文档。
文件
币安 API 文档提供两个 llms.txt 文件:
格式
llms.txt(摘要)
摘要文件包含所有文档页面的结构化列表,包括标题、描述和 URL:
# Binance API Documentation
> Comprehensive API documentation for Binance trading platform.
## Spot Trading
- [Changelog](/docs/spot-trading/1.changelog): Spot Trading API changelog
- [README](/docs/spot-trading/2.readme): Getting started with Spot Trading API
...
## Derivatives Trading
- [Change Log](/docs/derivatives/change-log): Derivatives API changelog
...
llms-full.txt(完整内容)
完整文件包含每个文档页面的完整 Markdown 内容,以标题分隔。这对于将整个文档加载到大语言模型的上下文窗口中非常有用。
使用示例
输入到任意大语言模型
# 下载并用作上下文
curl -s https://developers.binance.com/zh-CN/docs/llms.txt
# 完整文档,用于全面的上下文
curl -s https://developers.binance.com/zh-CN/docs/llms-full.txt
与 Claude 配合使用
请阅读 https://developers.binance.com/zh-CN/docs/llms.txt,并帮助我了解
如何使用币安 API 下合约订单。
在 Python 脚本中使用
import requests
# 获取文档索引
response = requests.get( "https://developers.binance.com/zh-CN/docs/llms.txt" )
docs_index = response.text
# 将其作为上下文输入到大语言模型
messages = [
{ "role" : "system" , "content" : f "Binance API docs: \n{ docs_index } " },
{ "role" : "user" , "content" : "How do I check my account balance?" }
]
与 LangChain 配合使用
from langchain_community.document_loaders import WebBaseLoader
loader = WebBaseLoader( "https://developers.binance.com/zh-CN/docs/llms-full.txt" )
docs = loader.load()
何时使用 llms.txt 与其他选项
llms.txt — 您希望快速让大语言模型了解所有可用文档,或将完整文档加载到上下文中
Agent REST API — 您需要结构化的 JSON 数据、过滤查询或程序化访问
MCP Server — 您正在使用 Claude Code、Cursor 或其他兼容 MCP 的 IDE
Last modified on June 26, 2026