Documentation Index
Fetch the complete documentation index at: https://docs.geekai.co/llms.txt
Use this file to discover all available pages before exploring further.
以下是 Message API 最简单的流式响应(边回答边输出)请求示例,只需要将 stream 设置为 true 即可:
curl --location --request POST 'https://geekai.co/api/v1/messages' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "claude-sonnet-4-20250514",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "你好"}
]
"stream": true
}'
对于流式请求,需要在客户端接收响应时进行特殊处理才能获取到,以 JavaScript 为例,需要通过 EventSource 进行监听获取。