Image generation
POST/api/v1/images/generations creates an image from a prompt with the OpenAI request shape. The call is synchronous: the image is in the response.

bytedance/seedream-5-0-prothrough AI Hub.Cover prompt and settings
16:9 cinematic dark creative studio with flowing electric-cyan and warm-magenta light ribbons converging around a clean central illuminated sign. The sign must read exactly BELIVE TOKENHUB in large crisp uppercase sans-serif letters, correctly spelled, no other text or logos. Balanced negative space and strong legibility at thumbnail size.
Model: bytedance/seedream-5-0-pro. Output: one 2048×1152 image. The BELIVE TOKENHUB title is part of the generated image.
Models and features
Every image model is called with POST /api/v1/images/generations. The tables list each model's ratios and tiers, the references it takes and what it is priced on; amounts are in each model's tokenhub_price_table and on the Models page. Jump to sizes, ratios and tiers, references and edits, quality, count and output or provider notes.
Ratios and tiers
| Model | Ratios | Tiers | Default size | With provider.only |
|---|---|---|---|---|
| Seedream | ||||
bytedance/seedream-5-0-pro | 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9 | 1K, 2K | 2048x2048 | Same |
bytedance/seedream-5-0-lite | 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9 | 2K, 4K | 2048x2048 | Same |
bytedance/seedream-5-0-flash | 1:1 | 2K | 2048x2048 | Same |
bytedance/seedream-4.5 | 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9 | 2K, 4K | 2048x2048 | Same |
bytedance/seedream-4.0 | 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9 | 1K, 2K, 4K | 2048x2048 | Same |
| Qwen Image | ||||
qwen/qwen-image-3.0 | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:9, 1:4, 4:1, 1:8, 8:1 | 1K, 2K | 2048x2048 | Same |
qwen/qwen-image-3.0-pro | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:9, 1:4, 4:1, 1:8, 8:1 | 1K, 2K | 2048x2048 | Same |
qwen/qwen-image-2.1-pro | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:9 | 1K, 2K | 2048x2048 | Same |
qwen/qwen-image-2.1-turbo | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:9 | 1K, 2K | 2048x2048 | Same |
| Wan | ||||
alibaba/wan2.7-image | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:9, 1:4, 4:1, 1:8, 8:1 | 1K, 2K | 2048x2048 | Same |
alibaba/wan2.7-image-pro | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:9, 1:4, 4:1, 1:8, 8:1 | 1K, 2K, 4K | 2048x2048 | Same |
| Hunyuan and Vidu | ||||
tencent/hy-image-3.5-preview | 1:1, 16:9, 9:16, 4:3, 3:4 | 1K, 2K, 4K | 1024x1024 | Same |
vidu/vidu-image-q2 | 1:1, 16:9, 9:16, 4:3, 3:4 | 1K, 2K, 4K | 1024x1024 | Same |
References, options and price basis
| Model | input_references | Other options | Price basis |
|---|---|---|---|
| Seedream | |||
bytedance/seedream-5-0-pro | 0 to 10 | None | Per request, by tier and number of references |
bytedance/seedream-5-0-lite | 0 to 10 | None | Per request |
bytedance/seedream-5-0-flash | No | None | Per image |
bytedance/seedream-4.5 | 0 to 10 | None | Per request |
bytedance/seedream-4.0 | 0 to 10 | None | Per request |
| Qwen Image | |||
qwen/qwen-image-3.0 | No | None | Per image, by tier |
qwen/qwen-image-3.0-pro | No | None | Per image, by tier |
qwen/qwen-image-2.1-pro | No | None | Per image |
qwen/qwen-image-2.1-turbo | No | None | Per image |
| Wan | |||
alibaba/wan2.7-image | No | None | Per image |
alibaba/wan2.7-image-pro | No | None | Per image |
| Hunyuan and Vidu | |||
tencent/hy-image-3.5-preview | No | None | Per image, by tier |
vidu/vidu-image-q2 | 0 to 7 | None | Per image, by tier and number of references |
Generate an image
Send one POST /api/v1/images/generations request. The response includes the generated image as base64 in data[0].b64_json; decode it to save the image. This is a synchronous request, so allow enough time for generation to finish.
import base64 import json import os import urllib.request body = { "model": "qwen/qwen-image-2.1-pro", "prompt": "An intricate miniature greenhouse inside a luminous glass sphere, tiny ferns and orchids surrounding a copper spiral staircase, hovering above a dark teal reflecting pool, warm amber light from within, cinematic macro product photography, exquisite material detail, no people, no text, no logos.", "n": 1, "size": "2048x2048", "response_format": "b64_json" } request = urllib.request.Request( "https://tokenhub-api.belive.sg/api/v1/images/generations", data=json.dumps(body).encode("utf-8"), headers={ "Authorization": f"Bearer {os.environ['TOKENHUB_API_KEY']}", "Content-Type": "application/json", }, ) with urllib.request.urlopen(request, timeout=180) as response: result = json.load(response) with open("qwen-image.png", "wb") as image: image.write(base64.b64decode(result["data"][0]["b64_json"]))
const response = await fetch("https://tokenhub-api.belive.sg/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer " + process.env.TOKENHUB_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify({ "model": "qwen/qwen-image-2.1-pro", "prompt": "An intricate miniature greenhouse inside a luminous glass sphere, tiny ferns and orchids surrounding a copper spiral staircase, hovering above a dark teal reflecting pool, warm amber light from within, cinematic macro product photography, exquisite material detail, no people, no text, no logos.", "n": 1, "size": "2048x2048", "response_format": "b64_json" }), }); if (!response.ok) throw new Error("Image request failed: " + response.status); const result = await response.json(); await import("node:fs/promises").then(({ writeFile }) => writeFile("qwen-image.png", Buffer.from(result.data[0].b64_json, "base64")), );
curl --fail-with-body -sS 'https://tokenhub-api.belive.sg/api/v1/images/generations' \ -H "Authorization: Bearer $TOKENHUB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen/qwen-image-2.1-pro", "prompt": "An intricate miniature greenhouse inside a luminous glass sphere, tiny ferns and orchids surrounding a copper spiral staircase, hovering above a dark teal reflecting pool, warm amber light from within, cinematic macro product photography, exquisite material detail, no people, no text, no logos.", "n": 1, "size": "2048x2048", "response_format": "b64_json" }' \ | jq -r '.data[0].b64_json' \ | python3 -c 'import base64, sys; sys.stdout.buffer.write(base64.b64decode(sys.stdin.buffer.read()))' \ > qwen-image.png
Response
The OpenAI-compatible route returns a creation timestamp and image data. This excerpt omits the base64 bytes.
{ "created": 1791715816, "data": [{ "b64_json": "[base64 image data omitted]" }] }
If your client stops waiting, generation may still finish. Set a generous timeout before retrying a request.
For permitted alternatives after a failure, read media offers and manual reruns. A rerun is a newly confirmed paid request. Keep the original settings and use the selected estimate's tokenhub_quote with one provider.only entry; do not automatically resubmit an uncertain image.
Options and model discovery
| Field | Notes |
|---|---|
model | Required. Use an ID listed by GET /v1/images/models. |
prompt | Required. Sent to the provider exactly as written. |
n | Number of images; 1 on every model. |
aspect_ratio, resolution | Optional. aspect_ratio is the shape as W:H, for example 16:9 or 9:16; resolution is 1K, 2K or 4K. Each model offers its own pairs, listed in tokenhub_image_options with the exact pixel size of each. Omit both for the model's default size. A pair the model does not offer, or a size that disagrees with it, returns 400 unsupported_parameter naming the field. |
size, quality | Supported only by some models. An unsupported value returns 400 invalid_request before the provider is called. |
input_references | Reference images, on the models marked in the tables above. |
response_format | Defaults to b64_json, the base64-encoded image bytes. |
provider | order, only and allow_fallbacks are accepted. Some image models have more than one provider; order tries the named providers first and only keeps just them. allow_fallbacks: false limits attempts to ordered providers, or to the first eligible provider when no order is given. tokenhub_image_options lists the first provider's pairs, and aspect_ratio and resolution are validated for the provider the request reaches. Any other key is 400 unsupported_parameter. |
GET /v1/images/models lists public image models and their supported parameters. Each entry's tokenhub_image_options lists its aspect_ratios, resolutions, the default and the size of every pair. The general GET /v1/models catalogue also includes image models; image pricing is listed in each model's tokenhub_price_table.
{ "model": "bytedance/seedream-5-0-pro", "prompt": "A ceramic teapot on a wooden table by a window", "aspect_ratio": "16:9", "resolution": "2K" }
Additional image route
POST /api/v1/images is another image route. It accepts model,prompt, size, resolution and aspect_ratio, validated against the same tokenhub_image_options. size may also be 1K, 2K or 4K, read as resolution. With no resolution, this route uses the 2K size where the model offers one at the chosen ratio. The response adds an image media_type and a usage object with the request cost in USD.
{ "created": 1788393600, "data": [{ "b64_json": "iVBORw0KGgo…", "media_type": "image/png" }], "usage": { "cost": 0.03, "tokenhub_cost": "0.03000000" } }
Sizes, ratios and tiers
Pick the shape with aspect_ratio and the tier with resolution (1K, 2K or 4K), or send the exact size from the model's tokenhub_image_options. Omit all three for the model's default size. The tables above list the ratios and tiers of each model.
- A ratio or tier the model does not offer is
400 unsupported_parameter, and the message lists the ones it does, for example`aspect_ratio` must be one of 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:9. Asizethat disagrees with the ratio or tier is400 unsupported_parametertoo. - A request with no
provideruses the model's default route, andtokenhub_image_optionslists that route's options. A model with more than one provider can offer more ratios and tiers on another: pin one withprovider.onlyand the request is validated for that provider's table. POST /api/v1/imagesreadssize: "2K"asresolution, and with noresolutionit uses the2Ksize where the model offers one.
Reference images and edits
input_references holds image_url items: [{"type": "image_url", "image_url": {"url": "…"}}], each a public https URL or a base64 image data: URI (PNG, JPEG or WebP). Without references the request is text to image. A model that takes no references answers 400 unsupported_parameter, and the edit models require them.
| Model | References | Price |
|---|---|---|
bytedance/seedream-5-0-pro | 0 to 10 | Each reference image after the first adds USD 0.002857 at list on the white-label route and USD 0.003 on BytePlus. |
bytedance/seedream-5-0-lite, bytedance/seedream-4.5, bytedance/seedream-4.0 | 0 to 10 | Unchanged; references add no charge. |
vidu/vidu-image-q2 | 0 to 7 | The price follows the number of references: none, 1 to 3, or 4 to 7. |
import { writeFile } from "node:fs/promises"; const body = { "model": "bytedance/seedream-5-0-pro", "prompt": "Put the product from the reference image on a marble kitchen counter in soft morning light, keep its shape and label, photorealistic", "n": 1, "size": "2048x2048", "input_references": [ { "type": "image_url", "image_url": { "url": "https://example.com/product.png" } } ] }; const response = await fetch("https://tokenhub-api.belive.sg/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer " + process.env.TOKENHUB_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify(body), }); if (!response.ok) throw new Error("Image request failed: " + response.status); const result = await response.json(); await writeFile( "seedream-reference.jpg", Buffer.from(result.data[0].b64_json, "base64"), );
curl --fail-with-body -sS 'https://tokenhub-api.belive.sg/api/v1/images/generations' \ -H "Authorization: Bearer $TOKENHUB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "bytedance/seedream-5-0-pro", "prompt": "Put the product from the reference image on a marble kitchen counter in soft morning light, keep its shape and label, photorealistic", "n": 1, "size": "2048x2048", "input_references": [ { "type": "image_url", "image_url": { "url": "https://example.com/product.png" } } ] }' \ | jq -r '.data[0].b64_json' \ | python3 -c 'import base64, sys; sys.stdout.buffer.write(base64.b64decode(sys.stdin.buffer.read()))' \ > seedream-reference.jpg
Quality, count and output
nis 1 on every model; a larger value is400 invalid_request. Send several requests for several images.qualityis not taken by the models in the tables above: it is400 unsupported_parameter.seed,negative_prompt,output_format,style,watermarkandstream: trueare refused with400 unsupported_parameteron every image model.- The image comes back as
b64_json, in the format the provider produced: PNG from Qwen Image, JPEG from Seedream.POST /api/v1/imagesreports themedia_type.
Provider notes
Seedream
- Seedream 5.0 Pro offers 1K and 2K tiers; 5.0 Lite and 4.5, 2K and 4K; 4.0, all three; 5.0 Flash makes one 2048 × 2048 square. The provider adds a small "AI生成" mark at the bottom right of the image.
- Seedream 5.0 Pro is priced by tier and by the number of reference images; the other Seedream models are priced per request.
Qwen Image and Wan
- Qwen Image 3.0 and 3.0 Pro and Wan 2.7 offer 15 ratios, from 1:8 to 8:1; Qwen Image 2.1 offers 11. Qwen Image 3.0 and 3.0 Pro are priced by tier.
Hunyuan Image and Vidu Image
- Both models take the ratios 1:1, 16:9, 9:16, 4:3, 3:4 at 1K, 2K and 4K. Hy Image 3.5 Preview is priced per image at USD 0.024 (1K and 2K) and USD 0.032 (4K); Vidu Image Q2 at USD 0.03, 0.04 and 0.05 for 1K, 2K and 4K without references, and more with them. Vidu Image Q2 returns its own sizes: 4:3 at 2K came back 2208 × 1648.
- Pixel sizes for each ratio and tier are in
tokenhub_image_optionsfromGET /v1/images/models. Each model takes one image per request (n: 1). - Vidu Image runs its task inside the request, up to 300 seconds, and returns the image; you never receive a task id. A task still running at the deadline is not costed. Prompts are accepted up to 2,000 characters.
- AI Hub returns the image directly as
b64_json.sizeis a AI Hub size (seetokenhub_image_options), not any width and height; there is no 1.5K tier. - Hy Image 3.5 Preview takes a text prompt only: no multi-turn messages or image input.
Example images
Qwen Image
Both examples below were generated through AI Hub on 2026-10-19 with the prompt and settings shown. The original response contained a 2048 × 2048 PNG; each image here is a smaller WebP display copy.
Prompt: An intricate miniature greenhouse inside a luminous glass sphere, tiny ferns and orchids surrounding a copper spiral staircase, hovering above a dark teal reflecting pool, warm amber light from within, cinematic macro product photography, exquisite material detail, no people, no text, no logos. Settings: one image, size: "2048x2048", response_format: "b64_json".
Qwen Image 2.1 Pro
qwen/qwen-image-2.1-pro
Qwen Image 2.1 Turbo
qwen/qwen-image-2.1-turbo
Seedream 5.0 Pro
These six images were generated through AI Hub on 2026-10-15 with bytedance/seedream-5-0-pro. Each request sent one image at size: "2048x2048". The original responses are 2048 × 2048 JPEG files; the images here are 1024 × 1024 WebP copies. The provider adds a small "AI生成" (AI-generated) mark at the bottom right of each image. Each new generation produces a different result.
Sneaker hero shot
bytedance/seedream-5-0-pro
Request
import { writeFile } from "node:fs/promises"; const body = { "model": "bytedance/seedream-5-0-pro", "prompt": "E-commerce hero shot of a bold orange and teal running sneaker floating mid-air above a glossy pastel podium, splashes of colour powder, vibrant gradient background, crisp studio lighting, ultra detailed product photography.", "n": 1, "size": "2048x2048" }; const response = await fetch("https://tokenhub-api.belive.sg/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer " + process.env.TOKENHUB_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify(body), }); if (!response.ok) throw new Error("Image request failed: " + response.status); const result = await response.json(); await writeFile( "sneaker-hero.jpg", Buffer.from(result.data[0].b64_json, "base64"), );
curl --fail-with-body -sS 'https://tokenhub-api.belive.sg/api/v1/images/generations' \ -H "Authorization: Bearer $TOKENHUB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "bytedance/seedream-5-0-pro", "prompt": "E-commerce hero shot of a bold orange and teal running sneaker floating mid-air above a glossy pastel podium, splashes of colour powder, vibrant gradient background, crisp studio lighting, ultra detailed product photography.", "n": 1, "size": "2048x2048" }' \ | jq -r '.data[0].b64_json' \ | python3 -c 'import base64, sys; sys.stdout.buffer.write(base64.b64decode(sys.stdin.buffer.read()))' \ > sneaker-hero.jpg
Skincare flat lay
bytedance/seedream-5-0-pro
Request
import { writeFile } from "node:fs/promises"; const body = { "model": "bytedance/seedream-5-0-pro", "prompt": "Vibrant flat lay of a premium skincare set: serum bottle, cream jar and sheet mask on a sunny yellow background with fresh citrus slices and green leaves, hard shadows, bright commercial photography.", "n": 1, "size": "2048x2048" }; const response = await fetch("https://tokenhub-api.belive.sg/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer " + process.env.TOKENHUB_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify(body), }); if (!response.ok) throw new Error("Image request failed: " + response.status); const result = await response.json(); await writeFile( "skincare-flatlay.jpg", Buffer.from(result.data[0].b64_json, "base64"), );
curl --fail-with-body -sS 'https://tokenhub-api.belive.sg/api/v1/images/generations' \ -H "Authorization: Bearer $TOKENHUB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "bytedance/seedream-5-0-pro", "prompt": "Vibrant flat lay of a premium skincare set: serum bottle, cream jar and sheet mask on a sunny yellow background with fresh citrus slices and green leaves, hard shadows, bright commercial photography.", "n": 1, "size": "2048x2048" }' \ | jq -r '.data[0].b64_json' \ | python3 -c 'import base64, sys; sys.stdout.buffer.write(base64.b64decode(sys.stdin.buffer.read()))' \ > skincare-flatlay.jpg
Summer sale fashion photo
bytedance/seedream-5-0-pro
Request
import { writeFile } from "node:fs/promises"; const body = { "model": "bytedance/seedream-5-0-pro", "prompt": "Fashion marketing photo of a smiling young Southeast Asian woman in a colourful summer dress holding shopping bags, bright pink and blue backdrop, confetti in the air, joyful energy, magazine-quality lighting.", "n": 1, "size": "2048x2048" }; const response = await fetch("https://tokenhub-api.belive.sg/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer " + process.env.TOKENHUB_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify(body), }); if (!response.ok) throw new Error("Image request failed: " + response.status); const result = await response.json(); await writeFile( "model-summer-sale.jpg", Buffer.from(result.data[0].b64_json, "base64"), );
curl --fail-with-body -sS 'https://tokenhub-api.belive.sg/api/v1/images/generations' \ -H "Authorization: Bearer $TOKENHUB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "bytedance/seedream-5-0-pro", "prompt": "Fashion marketing photo of a smiling young Southeast Asian woman in a colourful summer dress holding shopping bags, bright pink and blue backdrop, confetti in the air, joyful energy, magazine-quality lighting.", "n": 1, "size": "2048x2048" }' \ | jq -r '.data[0].b64_json' \ | python3 -c 'import base64, sys; sys.stdout.buffer.write(base64.b64decode(sys.stdin.buffer.read()))' \ > model-summer-sale.jpg
Iced coffee product shot
bytedance/seedream-5-0-pro
Request
import { writeFile } from "node:fs/promises"; const body = { "model": "bytedance/seedream-5-0-pro", "prompt": "Iced coffee in a clear cup with condensation, splashing coffee and ice cubes, vivid turquoise background, tropical leaves, high-speed commercial beverage photography, saturated colours.", "n": 1, "size": "2048x2048" }; const response = await fetch("https://tokenhub-api.belive.sg/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer " + process.env.TOKENHUB_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify(body), }); if (!response.ok) throw new Error("Image request failed: " + response.status); const result = await response.json(); await writeFile( "coffee-product.jpg", Buffer.from(result.data[0].b64_json, "base64"), );
curl --fail-with-body -sS 'https://tokenhub-api.belive.sg/api/v1/images/generations' \ -H "Authorization: Bearer $TOKENHUB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "bytedance/seedream-5-0-pro", "prompt": "Iced coffee in a clear cup with condensation, splashing coffee and ice cubes, vivid turquoise background, tropical leaves, high-speed commercial beverage photography, saturated colours.", "n": 1, "size": "2048x2048" }' \ | jq -r '.data[0].b64_json' \ | python3 -c 'import base64, sys; sys.stdout.buffer.write(base64.b64decode(sys.stdin.buffer.read()))' \ > coffee-product.jpg
Headphones lifestyle image
bytedance/seedream-5-0-pro
Request
import { writeFile } from "node:fs/promises"; const body = { "model": "bytedance/seedream-5-0-pro", "prompt": "Lifestyle advertising image of a young man wearing sleek red wireless headphones, eyes closed enjoying music, neon purple and blue city lights bokeh behind him, vibrant cinematic look.", "n": 1, "size": "2048x2048" }; const response = await fetch("https://tokenhub-api.belive.sg/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer " + process.env.TOKENHUB_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify(body), }); if (!response.ok) throw new Error("Image request failed: " + response.status); const result = await response.json(); await writeFile( "headphones-lifestyle.jpg", Buffer.from(result.data[0].b64_json, "base64"), );
curl --fail-with-body -sS 'https://tokenhub-api.belive.sg/api/v1/images/generations' \ -H "Authorization: Bearer $TOKENHUB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "bytedance/seedream-5-0-pro", "prompt": "Lifestyle advertising image of a young man wearing sleek red wireless headphones, eyes closed enjoying music, neon purple and blue city lights bokeh behind him, vibrant cinematic look.", "n": 1, "size": "2048x2048" }' \ | jq -r '.data[0].b64_json' \ | python3 -c 'import base64, sys; sys.stdout.buffer.write(base64.b64decode(sys.stdin.buffer.read()))' \ > headphones-lifestyle.jpg
Food delivery banner
bytedance/seedream-5-0-pro
Request
import { writeFile } from "node:fs/promises"; const body = { "model": "bytedance/seedream-5-0-pro", "prompt": "Colourful food delivery marketing image: a smiling delivery rider in a green jacket handing over a bag of food to a happy customer at a bright doorway, sunny day, vivid colours, friendly commercial style.", "n": 1, "size": "2048x2048" }; const response = await fetch("https://tokenhub-api.belive.sg/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer " + process.env.TOKENHUB_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify(body), }); if (!response.ok) throw new Error("Image request failed: " + response.status); const result = await response.json(); await writeFile( "food-delivery-banner.jpg", Buffer.from(result.data[0].b64_json, "base64"), );
curl --fail-with-body -sS 'https://tokenhub-api.belive.sg/api/v1/images/generations' \ -H "Authorization: Bearer $TOKENHUB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "bytedance/seedream-5-0-pro", "prompt": "Colourful food delivery marketing image: a smiling delivery rider in a green jacket handing over a bag of food to a happy customer at a bright doorway, sunny day, vivid colours, friendly commercial style.", "n": 1, "size": "2048x2048" }' \ | jq -r '.data[0].b64_json' \ | python3 -c 'import base64, sys; sys.stdout.buffer.write(base64.b64decode(sys.stdin.buffer.read()))' \ > food-delivery-banner.jpg
Hunyuan Image and Vidu Image
Generated through BeLive AI Hub on 2026-10-19. The images are smaller WebP display copies of the original responses. Each new generation produces a different result.
Hy Image 3.5 Preview, 16:9 at 4K
tencent/hy-image-3.5-preview
Request
import { writeFile } from "node:fs/promises"; const body = { "model": "tencent/hy-image-3.5-preview", "prompt": "Epic cinematic landscape of a giant glowing jellyfish-shaped sky island floating above a vivid emerald rainforest canyon at golden hour, waterfalls of luminous pink and turquoise light pouring down, a flock of colourful macaws flying in the foreground, volumetric sun rays, rich saturated colours, ultra detailed, wide angle, no text", "n": 1, "aspect_ratio": "16:9", "resolution": "4K" }; const response = await fetch("https://tokenhub-api.belive.sg/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer " + process.env.TOKENHUB_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify(body), }); if (!response.ok) throw new Error("Image request failed: " + response.status); const result = await response.json(); await writeFile( "hy-image-3-5-preview-sky-island.png", Buffer.from(result.data[0].b64_json, "base64"), );
curl --fail-with-body -sS 'https://tokenhub-api.belive.sg/api/v1/images/generations' \ -H "Authorization: Bearer $TOKENHUB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "tencent/hy-image-3.5-preview", "prompt": "Epic cinematic landscape of a giant glowing jellyfish-shaped sky island floating above a vivid emerald rainforest canyon at golden hour, waterfalls of luminous pink and turquoise light pouring down, a flock of colourful macaws flying in the foreground, volumetric sun rays, rich saturated colours, ultra detailed, wide angle, no text", "n": 1, "aspect_ratio": "16:9", "resolution": "4K" }' \ | jq -r '.data[0].b64_json' \ | python3 -c 'import base64, sys; sys.stdout.buffer.write(base64.b64decode(sys.stdin.buffer.read()))' \ > hy-image-3-5-preview-sky-island.png
Vidu Image Q2, 16:9 at 2K
vidu/vidu-image-q2
Request
import { writeFile } from "node:fs/promises"; const body = { "model": "vidu/vidu-image-q2", "prompt": "Cinematic wide shot of a floating night market city at dusk, hundreds of glowing paper lanterns in magenta and gold, turquoise canals with boats, hot-air balloons drifting in a vivid teal and orange sky, warm rim lighting, rich saturated colours, ultra detailed, no text, no people close up", "n": 1, "aspect_ratio": "16:9", "resolution": "2K" }; const response = await fetch("https://tokenhub-api.belive.sg/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer " + process.env.TOKENHUB_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify(body), }); if (!response.ok) throw new Error("Image request failed: " + response.status); const result = await response.json(); await writeFile( "vidu-image-q2-text.png", Buffer.from(result.data[0].b64_json, "base64"), );
curl --fail-with-body -sS 'https://tokenhub-api.belive.sg/api/v1/images/generations' \ -H "Authorization: Bearer $TOKENHUB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "vidu/vidu-image-q2", "prompt": "Cinematic wide shot of a floating night market city at dusk, hundreds of glowing paper lanterns in magenta and gold, turquoise canals with boats, hot-air balloons drifting in a vivid teal and orange sky, warm rim lighting, rich saturated colours, ultra detailed, no text, no people close up", "n": 1, "aspect_ratio": "16:9", "resolution": "2K" }' \ | jq -r '.data[0].b64_json' \ | python3 -c 'import base64, sys; sys.stdout.buffer.write(base64.b64decode(sys.stdin.buffer.read()))' \ > vidu-image-q2-text.png
Vidu Image Q2 with a reference image
vidu/vidu-image-q2
Replace the reference URL below with your own accessible image URL or a base64 data: URI.
Request
import { writeFile } from "node:fs/promises"; const body = { "model": "vidu/vidu-image-q2", "prompt": "Restyle this scene as a hand-painted watercolour and ink illustration, keep the composition, vivid pastel palette, no text", "n": 1, "aspect_ratio": "16:9", "resolution": "2K", "input_references": [ { "type": "image_url", "image_url": { "url": "https://aihub.belive.sg/docs/examples/hy-image-3-0-night-market.webp" } } ] }; const response = await fetch("https://tokenhub-api.belive.sg/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer " + process.env.TOKENHUB_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify(body), }); if (!response.ok) throw new Error("Image request failed: " + response.status); const result = await response.json(); await writeFile( "vidu-image-q2-reference.png", Buffer.from(result.data[0].b64_json, "base64"), );
curl --fail-with-body -sS 'https://tokenhub-api.belive.sg/api/v1/images/generations' \ -H "Authorization: Bearer $TOKENHUB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "vidu/vidu-image-q2", "prompt": "Restyle this scene as a hand-painted watercolour and ink illustration, keep the composition, vivid pastel palette, no text", "n": 1, "aspect_ratio": "16:9", "resolution": "2K", "input_references": [ { "type": "image_url", "image_url": { "url": "https://aihub.belive.sg/docs/examples/hy-image-3-0-night-market.webp" } } ] }' \ | jq -r '.data[0].b64_json' \ | python3 -c 'import base64, sys; sys.stdout.buffer.write(base64.b64decode(sys.stdin.buffer.read()))' \ > vidu-image-q2-reference.png
Support and limits
Choose a model, then read its ratios, tiers, references and options in the tables above and its tokenhub_image_options. The response is the image as JSON; it is not Chat streaming. Retrieve output before its link expires.
Gateway validation, defaults and response forms are in the operation index and the OpenAPI schemas.
Error codes and recovery are in Errors and recovery. Keep the request or job ID from each response: it identifies the call in Activity and for support.