Skip to content

Image model (gemini-3.1-flash-image) returns empty content in Anthropic format #447

@stephenpham68

Description

@stephenpham68

Description

When using gemini-3.1-flash-image via the Anthropic /v1/messages endpoint, the model generates an image successfully (output_tokens > 0) but the response content field is null or empty.

Steps to Reproduce

curl -X POST http://localhost:8317/api/provider/agy/v1/messages \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: <key>' \
  -d '{
    "model": "gemini-3.1-flash-image",
    "max_tokens": 4096,
    "messages": [{"role": "user", "content": "Draw a red circle on white background."}]
  }'

Actual Result

{
  "content": null,
  "usage": {"input_tokens": 14, "output_tokens": 1376}
}
  • Non-streaming: content: null despite output_tokens: 1376
  • Streaming: message_start sent with token count, but no content_block_start/content_block_delta events follow

Expected Result

The generated image should be returned as a base64-encoded content block, e.g.:

{
  "content": [
    {
      "type": "image",
      "source": {
        "type": "base64",
        "media_type": "image/png",
        "data": "..."
      }
    }
  ]
}

Analysis

The Gemini API returns the image data successfully (tokens are consumed), but it appears the Gemini-to-Anthropic response translator drops inline image blocks since the standard Anthropic message format only defines text and tool_use content block types.

Environment

  • CLIProxy version: v6.8.53-0
  • Provider: Antigravity (agy)
  • Model: gemini-3.1-flash-image
  • Account tier: G1-ULTRA-TIER (model is registered and available in quota)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions