Première requête
Jeton API
Replace YOUR_API_KEY with a token generated in the AIZN-API console (sk-xxx).
Première requête
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
}'
Exemple de réponse
{
"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"
}
Étapes suivantes
- Completion Object: understand the response fields
- Authentication: review the auth model
- Chat & Completions: move into the full chat reference