curl --request POST \
--url https://api.aihubmax.com/v1beta/models/{model}:generateContent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Explain the core principles of the Transformer architecture"
}
]
}
]
}
'{
"candidates": [
{
"content": {
"parts": [
{
"text": "Hello! How can I help you today?"
}
],
"role": "model"
},
"finishReason": "STOP",
"safetyRatings": [
{
"category": "<string>",
"probability": "<string>"
}
]
}
],
"usageMetadata": {
"promptTokenCount": 25,
"candidatesTokenCount": 150,
"totalTokenCount": 175
}
}{
"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"
}
}Gemini Format
Gemini Format - Generate Content
- Universal generateContent API reference for all Gemini-native-format compatible models
- Minimized parameters for quick start
- Text conversation: single-turn or multi-turn contextual dialogue
- Multimodal input: supports mixed text + image/audio/video input
- Generation config: control temperature, topP, topK, maxOutputTokens via generationConfig
POST
/
v1beta
/
models
/
{model}
:generateContent
curl --request POST \
--url https://api.aihubmax.com/v1beta/models/{model}:generateContent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Explain the core principles of the Transformer architecture"
}
]
}
]
}
'{
"candidates": [
{
"content": {
"parts": [
{
"text": "Hello! How can I help you today?"
}
],
"role": "model"
},
"finishReason": "STOP",
"safetyRatings": [
{
"category": "<string>",
"probability": "<string>"
}
]
}
],
"usageMetadata": {
"promptTokenCount": 25,
"candidatesTokenCount": 150,
"totalTokenCount": 175
}
}{
"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 endpoints require Bearer Token authentication
Add the following to your request header:
Authorization: Bearer YOUR_API_KEY
Path Parameters
Model name, e.g. gemini-2.5-flash
Example:
"gemini-2.5-flash"
Body
application/json
List of conversation contents
Show child attributes
Show child attributes
System instruction
Show child attributes
Show child attributes
Generation configuration
Show child attributes
Show child attributes
List of available tools
Show child attributes
Show child attributes
Safety settings
Show child attributes
Show child attributes