API Overview

To simplify the integration of different image generation models, Aihubmix provides a unified image API that supports the following mainstream models: API Specification:
Curl
curl https://aihubmix.com/v1/models/<model_path>/predictions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
    -d '{
  "input": {
    "prompt": "your prompt"
  }
}'
Where:
  • https://aihubmix.com/v1/models/ is the fixed prefix
  • <model_path> is the model path, available models:
    • opanai/gpt-image-1
    • opanai/dall-e-3
    • imagen-4.0-ultra-generate-001
    • imagen-4.0-generate-001
    • imagen-4.0-fast-generate-001
    • imagen-4.0-fast-generate-preview-06-06
    • imagen-3.0-generate-002
    • flux-kontext-max
    • flux-kontext-pro
    • FLUX.1-Kontext-pro
    • FLUX-1.1-pro
    • Qwen-Image
    • Qwen-Image-Edit
    • doubao-seedream-4-0-250828
    • ideogram/V3
    • stability/Stable-Diffusion-3-5-Large
    • irag-1.0
    • ernie-irag-edit
  • sk-*** is your API Key generated in Aihubmix

Below are the calling methods for each model.

OpenAI

Supported Models:

  • gpt-image-1
  • dall-e-3
The 2 reverse-engineered models gpt-4o-image-vip and gpt-4o-image are not supported

Usage:

curl https://aihubmix.com/v1/models/opanai/gpt-image-1/predictions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
    -d '{
  "input": {
    "prompt": "A deer drinking in the lake, Sakura petals falling, green and clean water, japanese temple, dappled sunlight, cinematic lighting, expansive view, peace",
    "size": "1024x1024", 
    "n": 1,
    "quality": "high",
    "moderation": "low",
    "background": "auto"
  }
}'

Google Imagen

Supported Models:

  • imagen-4.0-ultra-generate-001
  • imagen-4.0-generate-001
  • imagen-4.0-fast-generate-001
  • imagen-4.0-fast-generate-preview-06-06
  • imagen-3.0-generate-002
Gemini series models are not supported

Usage:

curl https://aihubmix.com/v1/models/google/imagen-4.0-fast-generate-001/predictions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
    -d '{
  "input": {
    "prompt": "A deer drinking in the lake, Sakura petals falling, green and clean water, japanese temple, dappled sunlight, cinematic lighting, expansive view, peace",
    "numberOfImages": 1
  }
}'

Flux

Supported Models:

  • flux-kontext-max
  • flux-kontext-pro
  • FLUX.1-Kontext-pro
  • FLUX-1.1-pro
  • flux-kontext-max and flux-kontext-pro use asynchronous endpoints and require a 2-step request process.
  • FLUX.1-Kontext-pro and FLUX-1.1-pro use unified endpoints that supports one-step generation.
  • Lightning fast responses—almost instant.
  • flux-kontext-max supports both text-to-image and image-to-image generation; flux-Kontext-pro only supports text-to-image.
  • The supported aspect_ratio range is from 21:9 to 9:21.
  • The safety_tolerance parameter ranges from 0 (strictest) to 6 (most lenient). For image-to-image tasks, the max allowed is 2.
  • Reference images can be provided via URL or Base64—URL is recommended.
  • For more details, see: FLUX API Reference

Usage:

FLUX One-step generation: for FLUX.1-Kontext-pro and FLUX-1.1-pro
curl 'https://aihubmix.com/v1/images/generations' \
  -H 'accept: */*' \
  -H 'accept-language: zh-CN' \
  -H 'authorization: Bearer sk-***' \
  -H 'content-type: application/json' \
  --data-raw '{"prompt":"a cat in the garden, cute cartoon","model":"FLUX.1-Kontext-pro","safety_tolerance":6}' \
| jq -r '.data[0].b64_json' \
| base64 -D > "$HOME/Desktop/image_extract.png"
flux-Step 1: Submit an Image Generation Request
curl https://aihubmix.com/v1/models/bfl/flux-kontext-max/predictions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
    -d '{
  "input": {
    "prompt": "A deer drinking in the lake, Sakura petals falling, green and clean water, japanese temple, dappled sunlight, cinematic lighting, expansive view, peace. reference style as the given image:",
    "aspect_ratio": "2:3",
    "safety_tolerance": 6
  }
}'
Sample Output:
{"output":[{"polling_url":"https://api.us1.bfl.ai/v1/get_result?id=f9821dbf-f134-41c2-aaa8-5405fb665c76","taskId":"api.us1.***"}]}%      
flux-Step 2: Retrieve the Generated Image Link Replace the string after tasks/ with the taskId from Step 1:
Get Image
curl https://api.aihubmix.com/v1/tasks/api.us1.bfl.*** \
    -H "Authorization: Bearer sk-***" \
    -X GET

Qwen

Supported Models:

  • Qwen-Image
  • Qwen-Image-Edit

Usage:

curl https://aihubmix.com/v1/models/qianfan/qwen-image/predictions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
  -d '{
    "input": {
      "prompt": "A beautiful sunset over a calm ocean",
      "refer_image": "",
      "n": 1,
      "size": "1024x1024",
      "guidance": 7.5,
      "watermark": false
    }
  }'

doubao-seedream-4-0-250828

Supported Models:

  • doubao-seedream-4-0-250828

Usage:

curl https://aihubmix.com/v1/models/doubao/doubao-seedream-4-0-250828/predictions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-***" \
  -d '{
    "input": {
      "prompt": "Interstellar, black hole, a vintage train bursting out of the black hole, grabbing visual impact, blockbuster movie, apocalyptic vibe, dynamic, contrasting colors, OC rendering, ray tracing, motion blur, depth of field, surrealism, deep blue, the image shapes the subject and scene through delicate and rich color layers with realistic texture, dark-themed lighting effects creating atmosphere, overall combining artistic fantasy, exaggerated wide-angle perspective, glare, reflections, ultimate lighting and shadows, strong gravity, engulfing.",
      "size": "2K",
      "sequential_image_generation": "disabled",
      "stream": false,
      "response_format": "url",
      "watermark": true
    }
  }'
Sample Output:
{"output":[{"url":"https://ark-content-generation-v2-cn-beijing.tos-cn-beijing.volces.com/doubao-seedream-4-0/021758***"}]}     

Ideogram V3

Supported Models:

  • V3
  1. Versions below V3 (V_2, V_1, etc.) use the legacy API and are currently not supported
  2. The returned links require a proxy network to access

Usage:

curl https://aihubmix.com/v1/models/ideogram/V3/predictions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
    -d '{
  "input": {
    "prompt": "A deer drinking in the lake, Sakura petals falling, green and clean water, japanese temple, dappled sunlight, cinematic lighting, expansive view, peace, in the style of Pixar 3D",
    "rendering_speed": "QUALITY",
    "aspect_ratio": "2x1"
  }
}'

Stability

Supported Models:

  • Stable-Diffusion-3-5-Large

Usage:

curl https://aihubmix.com/v1/models/stability/Stable-Diffusion-3-5-Large/predictions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
    -d '{
  "input": {
    "prompt": "A deer drinking in the lake, Sakura petals falling, green and clean water, japanese temple, dappled sunlight, cinematic lighting, expansive view, peace",
    "n": 1
  }
}'

Baidu

Supported Models:

  • ERNIE iRAG
  • ERNIE iRAG Edit

Usage:

curl https://aihubmix.com/v1/models/qianfan/irag-1.0/predictions\
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
  -d '{
    "input": {
      "prompt": "A beautiful sunset over a calm ocean",
      "refer_image": "",
      "n": 1,
      "size": "1024x1024",
      "guidance": 7.5,
      "watermark": false
    }
  }'