v1

latestOpenAPI 3.1.02026-07-267724480.0 KB

Gemini Generating Content

Generates content using Google Gemini models via the native Gemini API format. Supports text generation, multimodal inputs, thinking/reasoning, function calling, Google Search grounding, structured output, and streaming. CometAPI proxies requests to Google's Gemini API — use this endpoint when you need Gemini-native features not available through the OpenAI-compatible endpoint.

post/v1beta/models/{model}:{operator}

Path parameters

modelstring required

Gemini model ID. Example: gemini-3-flash-preview, gemini-2.5-pro. See the Models page for current options.

operator'generateContent' | 'streamGenerateContent?alt=sse' required

The operation to perform. Use generateContent for synchronous responses, or streamGenerateContent?alt=sse for Server-Sent Events streaming.

Request body

cachedContentstring

The name of cached content to use as context. Format: cachedContents/{id}. See the Gemini context caching documentation for details.

Response

Successful response. For streaming requests, the response is a stream of SSE events, each containing a GenerateContentResponse JSON object prefixed with data: .

modelVersionstring

The model version that generated this response.

createTimestring

The timestamp when this response was created (ISO 8601 format).

responseIdstring

Unique identifier for this response.