Image Generation - MyTokenGate
1. Introduction
Image models work in two ways:
- Text-to-image: hand over a prompt and get an image
- Image-to-image: pass one or more reference images along with the prompt, to produce a variant or hold a subject steady
Image-to-image is what you want when the same person or object has to survive a change of scene or pose. It is far steadier than describing that subject in words.
See the Image Generation API for full details.
2. Supported Models
| Model | Notes |
|---|---|
doubao-seedream-5-0-260128 | Seedream 5.0, general text-to-image and multi-reference |
Doubao-Seedream-5.0-Pro | Pro tier of the same family, stronger on detail and in-image text |
qwen-image-3.0 | Qwen image, strong Chinese semantics |
qwen-image-3.0-pro | Pro tier of the same family |
wan2.7-image-pro | Wan 2.7, realistic and commercial work |
gpt-image-2 | Best when instructions and in-image text must be followed precisely |
The model list reports supported aspect ratios and pricing per model; treat that response as authoritative.
3. Request Parameters
| Parameter | Type | Description |
|---|---|---|
model | string | Required, the model ID |
prompt | string | Your prompt |
size | string | Pixel size like 1024x1024, or a tier: 1K, 2K, 3K, 4K. A tier maps to a fixed edge, e.g. 2K is 2048×2048 |
image | string | One reference image, URL or data URI |
images | string[] | Multiple reference images, up to 6. When both are sent, images wins |
watermark | boolean | Whether to watermark; if omitted, the upstream default applies |
n | number | Number of images, currently limited to 1 |
To get several different results, send several requests. An n above 1 is rejected.
4. Prompt Guidance
The more specific the prompt, the more control you have.
- Be concrete: not “a beach at sunset”, but “a quiet beach at sunset, sky turning orange-red, waves lapping the sand, a small boat in the distance”
- Name the mood: words like “warm”, “mysterious”, “energetic” steer style
- State the style when you have one: “impressionist”, “surreal”
- Avoid empty words: “beautiful” and “nice” give the model nothing concrete
- Exclude with negations: “a beach at sunset, but no boats”
- Split complex scenes: generate a base image first, then refine from it
A sample prompt:
A futuristic eco-friendly skyscraper in central Tokyo. The building incorporates lush vertical gardens on every floor, with cascading plants and trees lining glass terraces. Solar panels and wind turbines are integrated into the structure’s design, reflecting a sustainable future. The Tokyo Tower is visible in the background, contrasting the modern eco-architecture with traditional city landmarks.
5. Billing
Image generation is billed per image, with input and output metered separately:
| Meter | Meaning |
|---|---|
image_output_per_image | Charged once per generated image |
image_input_per_image | Charged once per reference image passed in |
Reference images cost money. The same prompt with four reference images costs four input-image units more than with none. Unit prices vary by model; see Billing.
Failed generations are not charged — the pre-authorisation is released.
6. Code Examples
With the OpenAI SDK:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://gateway.mytokengate.com/v1",
)
response = client.images.generate(
model="doubao-seedream-5-0-260128",
prompt="A convenience store glass door on a rainy night, cold white light, realistic",
size="2K",
watermark=False,
)
print(response.data[0].url)Multiple reference images (not an OpenAI standard field, so pass it through extra_body):
response = client.images.generate(
model="doubao-seedream-5-0-260128",
prompt="The same person at the store counter, medium shot, cold white light",
size="2K",
extra_body={
"images": [
"https://example.com/scene.jpg",
"https://example.com/person.jpg",
],
"watermark": False,
},
)Reference images must be reachable over public HTTPS.
7. Try It and Call It
- Try it: sign in to the console and open the Image tab in the Playground
- Call it: see the Image Generation API