Saltar al contenido principal
POST
/
gemini
/
v1beta
/
models
/
{model}
:generateContent
Generate Content
curl --request POST \
  --url https://aihubmix.com/gemini/v1beta/models/{model}:generateContent \
  --header 'Content-Type: application/json' \
  --header 'x-goog-api-key: <api-key>' \
  --data '
{
  "contents": [
    {}
  ],
  "generationConfig": {},
  "safetySettings": [
    {}
  ],
  "systemInstruction": {},
  "tools": [
    {}
  ]
}
'
import requests

url = "https://aihubmix.com/gemini/v1beta/models/{model}:generateContent"

payload = {
"contents": [{}],
"generationConfig": {},
"safetySettings": [{}],
"systemInstruction": {},
"tools": [{}]
}
headers = {
"x-goog-api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{}
{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}
{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}
{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}
{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}
{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}
{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}

Autorizaciones

x-goog-api-key
string
header
requerido

Used by Gemini-shaped endpoints (/v1beta/...). The value is the gateway API key, shared with other endpoint shapes. The google-genai SDK uses this header by default.

Parámetros de ruta

model
string
requerido

Gemini model name, e.g. gemini-2.5-pro.

Cuerpo

application/json

Native Gemini generateContent request body. Field definitions here are illustrative — refer to https://ai.google.dev/api/rest/v1beta/models/generateContent as the authoritative reference.

contents
object[]
generationConfig
object
safetySettings
object[]
systemInstruction
object
tools
object[]

Respuesta

ok

Native Gemini response body. Refer to Google's official documentation for the authoritative field reference.