> For the complete documentation index, see [llms.txt](https://anyint.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anyint.gitbook.io/docs/models-and-modalities/image-generation.md).

# image generation

AnyInt currently publishes two image-generation paths: one Gemini-native route and one DashScope route. They overlap in outcome, but the request bodies and strengths are different.

## Published routes

| Route                                                          | Notes                                                                                             |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `/gemini/v1beta/models/gemini-2.5-flash-image:generateContent` | Requires `responseModalities` to include `TEXT` and `IMAGE`                                       |
| `/v1/dashscope/services/aigc/multimodal-generation/generation` | Prompt-driven image generation with parameters such as `size`, `negative_prompt`, and `watermark` |

## Use Gemini when

* you want a Gemini-native request shape
* you want mixed text-and-image output
* you are already building around Gemini `contents[].parts[]`

## Use DashScope when

* you want parameters such as `size`, `negative_prompt`, or `watermark`
* you are already integrating other DashScope media flows
* you want a more explicitly media-oriented payload instead of a Gemini conversation format

## Gemini example

```bash
curl https://gateway.api.anyint.ai/gemini/v1beta/models/gemini-2.5-flash-image:generateContent \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "parts": [
          {"text": "Generate a launch poster for an AI music product, cinematic and high-contrast."}
        ]
      }
    ],
    "generationConfig": {
      "responseModalities": ["TEXT", "IMAGE"]
    }
  }'
```

## DashScope example

```bash
curl https://gateway.api.anyint.ai/v1/dashscope/services/aigc/multimodal-generation/generation \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-plus",
    "input": {
      "messages": [
        {
          "role": "user",
          "content": [
            {
              "text": "A premium product hero image for a multi-model AI gateway."
            }
          ]
        }
      ]
    },
    "parameters": {
      "negative_prompt": "",
      "prompt_extend": true,
      "watermark": false,
      "size": "1328*1328"
    }
  }'
```

## Implementation advice

* Save the original prompt and returned asset URLs together
* Treat image generation as a product feature with retries and moderation policies
* Validate image size and parameter defaults before exposing them in your UI

## Related pages

* [Gemini Compatible API](/docs/api-reference/gemini-compatible.md)
* [Media APIs](/docs/api-reference/media-apis.md)
