Postman / Apifox 调用
用 Postman 或 Apifox 手动调试 Nodaryx 接口。
最快:生成可直接导入的 collection
在控制台打开 API Keys → 将密钥用于开发者工具 → Postman / Apifox,选好模型并下载
生成的 collection。把 JSON 导入 Postman 或 Apifox,设置环境变量 NODARYX_API_KEY
即可发送。该 collection 只使用环境变量,绝不含真实密钥。
想手动配置?按下面步骤来。
创建请求
- 方法:POST
- URL:
https://api.moyuncourse.site/v1/chat/completions
设置 Header
| Key | Value |
|---|---|
| Authorization | Bearer sk-nodaryx-xxxxxxxxxxxxxxxx |
| Content-Type | application/json |
设置 Body
选择 raw → JSON:
{
"model": "gemini-flash",
"messages": [{ "role": "user", "content": "你好" }]
}
用环境变量管理
建议把 Base URL 和 Key 存成环境变量,避免在每个请求里重复、也避免误把 Key 分享出去:
base_url=https://api.moyuncourse.site/v1api_key= 你的 Key
然后 URL 用 {{base_url}}/chat/completions,Header 用 Bearer {{api_key}}。
调试错误响应
返回非 200 时,查看响应体里的错误码,对照 错误码与排障 处理。