第一次请求
用 curl 发起一次最小请求,验证你已正确配置 API Key。
下方接口与域名为示例:
https://api-platform.ope.ai。
1) 设置环境变量
export OPEAI_API_KEY="YOUR_API_KEY"
2) 发起请求(示例:Chat Completions)
curl https://api-platform.ope.ai/v1/chat/completions \
-H "Authorization: Bearer $OPEAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "DeepSeek-V3.2",
"messages": [
{"role": "user", "content": "hello"}
]
}'
3) 你应该看到什么
- 成功时:返回 JSON 响应(包含
id、choices等字段) - 失败时:返回标准错误对象(见「错误处理」)