API Reference
Endpoint 详细
当前已上线 endpoints:POST /chat/completions 与 GET /models。Embeddings、TTS、voice-clone 在路线图中,上线后此页会更新。
基础信息
- Base URL:
https://solquir.io/api/v1 - Auth:
Authorization: Bearer <api-key> - Content-Type:
application/json(除 multipart upload) - 响应格式: JSON,错误用
{"error": {"type": "...", "message": "..."}} - 追溯 ID: 每个响应带
X-Solquir-Trace-Idheader
POST /chat/completions
OpenAI 兼容 chat completions endpoint。支持 streaming 与 non-streaming。
请求 body
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 模型 apiSlug,如 solquir-v1 |
messages | array | 是 | OpenAI message 格式 |
stream | boolean | 否 | true = SSE 流 |
temperature | number | 否 | 0-2,默认 0.7 |
max_tokens | integer | 否 | 上限 32k |
top_p | number | 否 | nucleus sampling,默认 1 |
响应(非流式)
json
{
"id": "chatcmpl-0xK2w...",
"object": "chat.completion",
"created": 1778550172,
"model": "solquir-v1",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "..." },
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 222,
"completion_tokens": 31,
"total_tokens": 253,
"cost_micro_usd": 4280
},
"thinking": [
{ "stage": "route", "picked": "claude-opus", "reason": "..." },
{ "stage": "tool", "name": "search", "ms": 480 }
]
}NOTE
thinking 字段是 Solquir 独有的扩展(OpenAI 没有), 不影响 OpenAI SDK 解析。GET /models
返回全部上架、active 的模型目录(不需要 API key)。OpenAI SDK 可用 client.models.list() 调用,或直接 GET 请求。
响应
json
{
"object": "list",
"data": [
{
"id": "solquir-v1",
"object": "model",
"owned_by": "solquir",
"displayName": "Solquir V1",
"description": "通用对话旗舰模型",
"kind": "chat",
"saleInputMicroUsdPerToken": 2,
"saleOutputMicroUsdPerToken": 8,
"currency": "USD",
"modality": "text",
"isActive": true,
"created": 1778550172
}
]
}NOTE
saleInputMicroUsdPerToken 和 saleOutputMicroUsdPerToken 单位是 microUSD(百万分之一美元)。 实际费用 = tokens × 对应值。OpenAI SDK 不感知这些扩展字段,正常忽略。GET /storefront/* (公开)
不需 API key。给前端站点 / 第三方 marketplace 拉商品目录用。
GET /storefront/categories— 全部 active 分类GET /storefront/listings?category=<slug>— 列表GET /storefront/listings/:slug— 单个详情