curl --request POST \
--url https://api.aihubmax.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-5.4",
"messages": [
{
"role": "user",
"content": "Write a quicksort algorithm in Python"
}
]
}
'{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1757165031,
"model": "<string>",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 50,
"total_tokens": 70
}
}{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid API key",
"type": "authentication_error"
}
}{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Access denied",
"type": "permission_error"
}
}{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error"
}
}{
"error": {
"message": "Internal server error",
"type": "server_error"
}
}OpenAI Format - Tool Calling Chat
- Generic Chat Completions API reference with tool calling for all OpenAI-compatible models
- Supports Function Calling: define tools the model can invoke
- Structured output: supports JSON Object / JSON Schema format
- Multimodal input: supports text + image mixed input
- Supports streaming and non-streaming responses
curl --request POST \
--url https://api.aihubmax.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-5.4",
"messages": [
{
"role": "user",
"content": "Write a quicksort algorithm in Python"
}
]
}
'{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1757165031,
"model": "<string>",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 50,
"total_tokens": 70
}
}{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid API key",
"type": "authentication_error"
}
}{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Access denied",
"type": "permission_error"
}
}{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error"
}
}{
"error": {
"message": "Internal server error",
"type": "server_error"
}
}Authorizations
All APIs require Bearer Token authentication
Add to request header:
Authorization: Bearer YOUR_API_KEY
Body
Model name, e.g. gpt-5.4, deepseek-chat, etc.
"gpt-5.4"
List of messages in the conversation
Show child attributes
Show child attributes
Whether to stream the response
Sampling temperature (0-2)
0 <= x <= 2Maximum number of tokens to generate
Nucleus sampling parameter (0-1)
0 <= x <= 1Penalize new tokens based on their frequency in the text so far (-2 to 2)
-2 <= x <= 2Penalize new tokens based on whether they appear in the text so far (-2 to 2)
-2 <= x <= 2A list of tools the model may call
Show child attributes
Show child attributes
Controls which tool is called by the model
none, auto, required An object specifying the format that the model must output
Show child attributes
Show child attributes
Up to 4 sequences where the API will stop generating further tokens
How many chat completion choices to generate for each input message