Skip to content

[Bug]: gemini 3 pro image preview, signature not returned #17184

@huiwy

Description

@huiwy

What happened?

https://ai.google.dev/gemini-api/docs/gemini-3?thinking=high#image_generation
Thought signature is required in interactive image editing in gemini 3 pro image preview, but it is not returned in either streaming or non streaming response.

Example Code:

client = AsyncOpenAI(
    api_key=API_KEY,
    base_url=API_BASE,
    max_retries=3
)

model = "vertex_ai_global/gemini-3-pro-image-preview"
messages = [{"role": "user", "content": prompt}]

extra_body = {}
if aspect_ratio or image_size:
    image_config = {}
    if aspect_ratio:
        image_config["aspectRatio"] = aspect_ratio
    if image_size:
        image_config["imageSize"] = image_size
    extra_body["imageConfig"] = image_config

try:
    create_params = {
        "model": model,
        "messages": messages,
    }
    if extra_body:
        create_params["extra_body"] = extra_body
        
    response = await client.chat.completions.create(**create_params)

response:

{
    "id":"...",
    "choices": [
        {
            "finish_reason":"stop",
            "index":0,
            "logprobs":null,
            "message":{
                "content":null,
                "refusal":null,
                "role":"assistant",
                "annotations":null,
                "audio":null,
                "function_call":null,
                "tool_calls":null,
                "images":[
                    {
                        "image_url":{
                            "url":"data:image/png;base64,..."
                        }
                    }
                ],
                "created":1764228089,
                "model":"gemini-3-pro-image-preview",
                "object":"chat.completion",
                "service_tier":null,
                "system_fingerprint":null,
                "usage": {}
            }
        }
    ]
}

Relevant log output

Are you a ML Ops Team?

No

What LiteLLM version are you on ?

38bac31

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions