Skip to main content
Call Gemini image models through the native generateContent protocol for full parameter control in advanced scenarios.

Endpoint

Method: POST Base URL: https://api.gregapi.com/v1beta/models/{model}:generateContent

Authentication

Supported Models

Request Structure

The request body follows the standard generateContent protocol:

contents array (required)

Each content object contains a parts array with the following part types:

generationConfig object

generationConfig.imageConfig object

Aspect Ratio Values

gemini-3.1-flash-image additionally supports 1:4, 4:1, 1:8, 8:1, 9:21.

Reference Image Editing

Pass reference images via inline_data for editing. Multiple inline_data entries can be added to the parts array, up to 15 reference images.

Response Structure

Billed-but-blocked error response

The native API keeps Gemini protocol field names. If no image was generated but the upstream already returned billable prompt usage, the error response retains usageMetadata instead of an OpenAI-style top-level usage.
When no image is produced, candidatesTokenCount is usually 0; ordinary unpaid failures do not return usageMetadata.