API Request Test
Open Linux Shell or Windows CMD terminal and paste the following command to run your first API request. Make sure to replace YOUR_API_KEY with your API key.
curl Request Example
bash
curl https://ai-tokenhub.com/v1/chat/completions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"model": "qwen3.5-plus",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"temperature": 0.7
}'Response Example
This request asks the model to complete the prompt "Say this is a test!" using the qwen3.5-plus model. You should receive a response similar to the following:
json
{
"id":"chatcmpl-abc123",
"object":"chat.completion",
"created":1677858242,
"model":"qwen3.5-plus",
"usage":{
"prompt_tokens":13,
"completion_tokens":7,
"total_tokens":20
},
"choices":[
{
"message":{
"role":"assistant",
"content":"\n\nThis is a test!"
},
"finish_reason":"stop",
"index":0
}
]
}Response Field Description
| Field | Description |
|---|---|
id | Unique identifier for the request |
object | Return object type, here is chat.completion |
created | Unix timestamp of request creation time |
model | Actual model name processed |
usage | Token usage statistics |
choices | List of model-generated responses |
finish_reason | Generation completion reason, stop means normal completion |
Now you have completed your first chat request. finish_reason being stop means the API returned the complete output generated by the model.