首次调用API
sotaAI使用与 OpenAI 兼容的 API 格式,通过修改配置,您可以使用 OpenAI SDK 来访问 sotaAI API,或使用与 OpenAI API 兼容的软件。
参数 | 值 |
---|---|
base_url | https://sota-ai.nfshost.com/v1 |
api_key | 从API密钥页面获取 |
使用curl调用API
curl https://sota-ai.nfshost.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <您的API Key>" \
-d '{
"model": "<随意指定>",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"stream": true
}'
配置continue.dev使用sotaAI
models:
- name: sotaAI
provider: openai
model: openai/o3
apiKey: ea034a04bf37ea1f40544edc40a9b6ea
apiBase: https://sota-ai.nfshost.com/v1
contextLength: 64000
useLegacyCompletionsEndpoint: true
requestOptions:
extraBodyProperties:
thinking:
type: enabled
roles:
- chat
defaultCompletionOptions:
temperature: 0
maxTokens: 2500
注意:
1. 请将apiKey
替换为您自己的API Key
2. model
可根据需要随意填(某些软件前端需要指定'openai/o3'
字符串才启用长上下文)
3. thinking.type: enabled
强制启用think , thinking.type: disabled
强制关闭think , 整个extraBodyProperties
不配置,API将智能判断是否启用think
用量查询接口
https://sota-ai.nfshost.com/web/usage?key=<您的API Key>
接口返回Credits余量和最新50条历史API调用量