Skip to main content
Jimeng (即梦) is a series of high-quality image generation models available through Fhddos. Jimeng models are fully compatible with the OpenAI image API, so you can integrate them using any OpenAI SDK or standard HTTP client without changing your existing image-generation code. Point your client at https://aiapi.fhddos.com, set your Fhddos token, and start generating.

Authentication

Add your Fhddos token as a Bearer credential to every request:
Authorization: Bearer YOUR_API_KEY
Base URL: https://aiapi.fhddos.com

Available models

ModelBest forSupported endpoints
jimeng-4.0High-quality creative images with rich detailText-to-image, Image-to-image
jimeng-3.0General use, speed-optimised, cost-efficientText-to-image, Image-to-image
jimeng-agentMulti-turn dialog-driven generation with context awarenessText-to-image, Image-to-image
Jimeng models (4.0 / 3.0 / agent) are billed per request. Each successful call generates 4 images regardless of the n parameter value.

Endpoints

OperationMethodPath
Text-to-imagePOST/v1/images/generations
Image-to-imagePOST/v1/images/edits

Text-to-image

Generate images from a text prompt. Use size to control the output dimensions and n to request multiple images in one call.

cURL

curl -X POST "https://aiapi.fhddos.com/v1/images/generations" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jimeng-4.0",
    "prompt": "A futuristic city at night with neon lights",
    "n": 1,
    "size": "1024x1024"
  }'

Multiple images

curl https://aiapi.fhddos.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "model": "jimeng-3.0",
    "prompt": "Futuristic cityscape at night, cyberpunk style",
    "n": 4,
    "size": "1792x1024"
  }'

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://aiapi.fhddos.com/v1"
)

response = client.images.generate(
    model="jimeng-4.0",
    prompt="A cute panda reading in a library",
    size="1024x1024"
)

print(response.data[0].url)

Image-to-image

Edit or transform an existing image by uploading it as a form field alongside your prompt. The request uses multipart/form-data.

cURL

curl -X POST "https://aiapi.fhddos.com/v1/images/edits" \
  -H "Authorization: Bearer $TOKEN" \
  -F "model=jimeng-3.0" \
  -F "prompt=Make it look like a watercolor painting" \
  -F "image=@input.png"

Add sci-fi elements to an existing image

curl https://aiapi.fhddos.com/v1/images/edits \
  -H "Authorization: Bearer $TOKEN" \
  -F "image=@original.png" \
  -F "model=jimeng-4.0" \
  -F "prompt=Add sci-fi elements and neon light effects" \
  -F "n=1"

Python (OpenAI SDK)

with open("input.png", "rb") as image_file:
    response = client.images.edit(
        image=image_file,
        model="jimeng-4.0",
        prompt="Add sci-fi elements"
    )

print(response.data[0].url)

Python SDK examples

Batch generation

Generate images for multiple prompts in sequence:
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://aiapi.fhddos.com/v1"
)

prompts = [
    "A panda reading in a library",
    "A panda strolling in a park",
    "A panda resting in a bamboo grove"
]

for prompt in prompts:
    response = client.images.generate(
        model="jimeng-3.0",
        prompt=prompt,
        n=1
    )
    print(f"{prompt}: {response.data[0].url}")

Download a generated image

import requests
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://aiapi.fhddos.com/v1"
)

response = client.images.generate(
    model="jimeng-4.0",
    prompt="A cute panda",
    n=1
)

image_url = response.data[0].url

img_data = requests.get(image_url).content
with open("output.png", "wb") as f:
    f.write(img_data)

Error handling

from openai import OpenAI, APIError, RateLimitError

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://aiapi.fhddos.com/v1"
)

try:
    response = client.images.generate(
        model="jimeng-4.0",
        prompt="Test image",
        n=1
    )
    print(response.data[0].url)

except RateLimitError:
    print("Rate limit reached — back off and retry.")

except APIError as e:
    print(f"API error: {e}")

Model selection guide

jimeng-4.0

Best for: commercial design, high-quality posters, detailed creative work.Highest output quality with the richest detail.

jimeng-3.0

Best for: rapid prototyping, batch generation, cost-sensitive workflows.Faster generation speed at a lower cost per image.

jimeng-agent

Best for: iterative, multi-turn creative sessions where context from earlier turns informs each new image.Intelligently incorporates conversation history.
Use caseRecommended modelReason
Commercial design, high-quality postersjimeng-4.0Best quality, richest detail
Rapid prototyping, bulk generationjimeng-3.0Fast, cost-efficient
Multi-turn dialog-driven creationjimeng-agentContext-aware across turns

Supported sizes

Use the size parameter on POST /v1/images/generations to control output dimensions. Common values:
SizeAspect ratioTypical use
1024x10241:1 (square)Profile images, product shots
1792x102416:9 (landscape)Banners, wallpapers, cinematic
1024x17929:16 (portrait)Mobile wallpapers, story cards
The n parameter specifies how many images you request, but Jimeng models always generate 4 images per billable call. Set n=4 to retrieve all generated variants, or n=1 to receive a single URL from the batch.