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": "Is the weather in Hangzhou good for going out today?"
}
]
}
],
"tools": [
{
"functionDeclarations": [
{
"name": "get_weather",
"description": "Get current weather information for a specified city",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "City name"
},
"unit": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
],
"description": "Temperature unit"
}
},
"required": [
"city"
]
}
}
]
}
]
}
'{
"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"
}
}Tool Calling
Gemini Format - Tool Calling Generate Content
- Universal generateContent API (with tool calling) for all Gemini-native-format compatible models
- Tool calling: supports function declarations, model can invoke defined functions
- Multimodal input: supports mixed text + image/audio/video input
- Generation config: control temperature, topP, topK, maxOutputTokens via generationConfig
- Safety settings: configurable content safety thresholds
- Supports both streaming and non-streaming responses
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": "Is the weather in Hangzhou good for going out today?"
}
]
}
],
"tools": [
{
"functionDeclarations": [
{
"name": "get_weather",
"description": "Get current weather information for a specified city",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "City name"
},
"unit": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
],
"description": "Temperature unit"
}
},
"required": [
"city"
]
}
}
]
}
]
}
'{
"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