Models Hub
API ReferenceChat

Gemini text chat / media recognition.

Gemini `generateContent`-compatible endpoint for text chat and media recognition requests.

Edit this page
POST
/v1beta/models/{model}:generateContent

Path Parameters

model*string

Model ID in the Gemini-compatible interface path.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/v1beta/models/gemini-2.5-flash:generateContent" \  -H "Content-Type: application/json" \  -d '{    "contents": [      {        "role": "user",        "parts": [          {            "text": "Hello, please introduce Models Hub."          }        ]      }    ]  }'
{
  "candidates": [
    {}
  ],
  "promptFeedback": {},
  "usageMetadata": {}
}
{
  "error": {
    "code": "string",
    "message": "string",
    "request_id": "string"
  }
}