跳至主要内容

發出請求

令牌

將請求中的 YOUR_API_KEY 替換成你在 AIZN-API 控制台 生成的令牌(sk-xxx)。

首個請求

curl https://api.aizn.com/v1/chat/completions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"temperature": 0.7
}'

返回示例

{
"id": "chatcmpl-AFNKwYwdb3KmPV3MT7yT0TBylkuH5",
"object": "chat.completion",
"created": 1728227990,
"model": "gpt-4o-2024-08-06",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test!"
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 13,
"completion_tokens": 5,
"total_tokens": 18
},
"system_fingerprint": "fp_67802d9a6d"
}

接下來讀什麼

原始來源