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-preview-06-06
    • imagen-4.0-generate-preview-06-06
    • imagen-4.0-ultra-generate-exp-05-20
    • imagen-4.0-generate-preview-05-20
    • imagen-3.0-generate-002
    • flux-kontext-max
    • flux-kontext-pro
    • ideogram/V3
    • stability/Stable-Diffusion-3-5-Large
  • 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-preview-06-06
  • imagen-4.0-generate-preview-06-06
  • imagen-4.0-ultra-generate-exp-05-20
  • imagen-4.0-generate-preview-05-20
  • imagen-3.0-generate-002
Gemini series models are not supported

Usage:

curl https://aihubmix.com/v1/models/google/imagen-3.0-generate-002/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
  • All flux models use asynchronous endpoints and require a 2-step request process.
  • 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:

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.***"}]}%      
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

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
  }
}'