Documentation Index
Fetch the complete documentation index at: https://docs.focusapi.cn/llms.txt
Use this file to discover all available pages before exploring further.
端点
https://api.FocusAPI.com/v1
请求头
| 头 | 必填 | 说明 |
|---|---|---|
Authorization | 是 | Bearer sk-your-api-key |
Content-Type | 是 | application/json |
请求体(常用字段)
| 字段 | 类型 | 说明 |
|---|---|---|
model | string | 模型 ID,见模型广场 |
messages | array | 对话消息列表,role 为 system / user / assistant |
stream | boolean | true 时以 SSE 流式返回 |
temperature | number | 采样温度,可选 |
max_tokens | integer | 最大生成 token 数,可选 |
最小示例
流式输出
设置"stream": true 后,响应为 Server-Sent Events (SSE),每行以 data: 开头。
Python SDK 示例:
响应(非流式)
成功时 HTTP 200,JSON 结构兼容 OpenAI,例如:usage 用于计费参考,具体扣费规则见 计费说明。
