11
API 參考
所有端點位於 https://api.nxioai.com/api/v1。機器可讀的 OpenAPI 3.1 文件在 https://platform.nxioai.com/openapi.json。
端點
| 方法 | 路徑 | 認證 | 說明 |
|---|---|---|---|
| POST | /chat/completions | key | OpenAI 相容 chat completion;stream: true 為 SSE。 |
| GET | /models | — | 公開模型目錄與價格。 |
| GET | /key | key | 目前 key:label、上限、用量、剩餘。 |
| GET | /credits | key | 帳戶餘額。 |
| GET | /generation?id= | key | 單筆請求儲存的用量與費用。 |
| POST | /messages | key | 不支援 Anthropic Messages 格式。請改用 POST /chat/completions 呼叫 Claude 模型,模型 id 相同。 |
| POST | /responses | key | OpenAI Responses API 直通(支援 openai-response 的模型)。保留上游 id 供 previous_response_id 串接;我方 id 在 X-Request-Id / nxio_request_id;usage 加 cost。 |
| POST | /embeddings | key | OpenAI 相容的 embeddings:{model, input}。依 prompt_tokens 以模型輸入價計費;usage.cost 為 USD。 |
Header
| Header | 方向 | 意義 |
|---|---|---|
| Authorization: Bearer <key> | 請求 | 需認證的路由必填。 |
| X-Title / X-NXIO-Title | 請求 | 選用,分析用的應用名稱。 |
| HTTP-Referer | 請求 | 選用,分析用的應用 URL。 |
| X-Request-Id | 回應 | NXIO request id,等於回應 id。 |
| Retry-After | 回應 | 402(in-flight)與 429 時建議等待秒數。 |