AnyInt Docs
Models

Image Generation

AnyInt publishes Gemini-native, DashScope, and Transtreams Kling image-generation paths. They overlap in outcome, but the request bodies and strengths are different.

AnyInt publishes Gemini-native, DashScope, and Transtreams Kling image-generation paths. They overlap in outcome, but the request bodies and strengths are different.

Published routes

RouteNotes
/gemini/v1beta/models/gemini-3.1-flash-image-preview:generateContentRequires responseModalities to include TEXT and IMAGE
/dashscope/v1/services/aigc/multimodal-generation/generationPrompt-driven image generation with parameters such as size, negative_prompt, and watermark
/transtreams/kling/v1/images/generationsKling v2.1 image generation task route
/transtreams/kling/v1/images/omni-imageKling V3 Omni image generation task route

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

Use Kling when

  • you want kling-v2-1, displayed as Kling: Image v2.1
  • you want the Omni image route for kling-v3-omni
  • you are building an async image workflow and can poll task results

Gemini example

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

DashScope example

curl https://gateway.api.anyint.ai/dashscope/v1/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"
    }
  }'

Kling v2.1 example

Create a task with kling-v2-1, then poll /transtreams/kling/v1/images/generations/{task_id}.

curl -X POST "https://gateway.api.anyint.ai/transtreams/kling/v1/images/generations" \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "kling-v2-1",
    "model": "kling-v2-1",
    "prompt": "A cyberpunk city street at dusk, premium concept art.",
    "negative_prompt": "blurry, low quality",
    "resolution": "2k",
    "n": 1,
    "aspect_ratio": "3:4"
  }'

Kling V3 Omni image example

The Omni image route is separate from the older Kling image-generation route.

curl -X POST "https://gateway.api.anyint.ai/transtreams/kling/v1/images/omni-image" \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "kling-v3-omni",
    "model": "kling-v3-omni",
    "prompt": "A blue glass cube on a white background, premium product photography.",
    "aspect_ratio": "1:1"
  }'

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
  • Store task IDs for Kling routes so users can resume polling if the page reloads

On this page