OpenLux

Image generation gemini-3-pro-image controls aspect ratio + clarity

Endpoint: POST https://api.openlux.ai/v1beta/models/gemini-3-pro-image:generateContent

Official documentation: https://ai.google.dev/gemini-api/docs/image-generation?hl=zh-cn#gemini-image-editing

Parameters

  • key (query, string, required): API Key (Authorization: Bearer also supported)
  • Content-Type (header, string, required): Request body content type, usually application/json

Request body (application/json)

  • contents (array<object>, required): List of conversation contents; each item has parts (text/image/etc.)
  • generationConfig (object, required): Generation config (modalities, image size, speech, etc.)
  • response_format (string): Fill in the url and return the url, if not fill in the default base64

Request example

{
  "contents": [
    {
      "parts": [
        {
          "text": "'Hi, This is a picture of me. Can you add a llama next to me"
        },
        {
          "inline_data": {
            "data": "iVBORw0KGgoAAAANSUhEUgAABAAAAAKoCAIA...",
            "mime_type": "image/jpeg"
          }
        }
      ],
      "role": "user"
    }
  ],
  "generationConfig": {
    "responseModalities": [
      "TEXT",
      "IMAGE"
    ]
  },
  "response_format": "url"
}