Capabilities

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.

BELIVE TOKENHUB sign surrounded by cyan and magenta light ribbons in a dark studio
Original 16:9 image generated with 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

ModelRatiosTiersDefault sizeWith provider.only
Seedream
bytedance/seedream-5-0-pro1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:91K, 2K2048x2048Same
bytedance/seedream-5-0-lite1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:92K, 4K2048x2048Same
bytedance/seedream-5-0-flash1:12K2048x2048Same
bytedance/seedream-4.51:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:92K, 4K2048x2048Same
bytedance/seedream-4.01:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:91K, 2K, 4K2048x2048Same
Qwen Image
qwen/qwen-image-3.01: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:11K, 2K2048x2048Same
qwen/qwen-image-3.0-pro1: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:11K, 2K2048x2048Same
qwen/qwen-image-2.1-pro1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:91K, 2K2048x2048Same
qwen/qwen-image-2.1-turbo1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:91K, 2K2048x2048Same
Wan
alibaba/wan2.7-image1: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:11K, 2K2048x2048Same
alibaba/wan2.7-image-pro1: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:11K, 2K, 4K2048x2048Same
Hunyuan and Vidu
tencent/hy-image-3.5-preview1:1, 16:9, 9:16, 4:3, 3:41K, 2K, 4K1024x1024Same
vidu/vidu-image-q21:1, 16:9, 9:16, 4:3, 3:41K, 2K, 4K1024x1024Same

References, options and price basis

Modelinput_referencesOther optionsPrice basis
Seedream
bytedance/seedream-5-0-pro0 to 10NonePer request, by tier and number of references
bytedance/seedream-5-0-lite0 to 10NonePer request
bytedance/seedream-5-0-flashNoNonePer image
bytedance/seedream-4.50 to 10NonePer request
bytedance/seedream-4.00 to 10NonePer request
Qwen Image
qwen/qwen-image-3.0NoNonePer image, by tier
qwen/qwen-image-3.0-proNoNonePer image, by tier
qwen/qwen-image-2.1-proNoNonePer image
qwen/qwen-image-2.1-turboNoNonePer image
Wan
alibaba/wan2.7-imageNoNonePer image
alibaba/wan2.7-image-proNoNonePer image
Hunyuan and Vidu
tencent/hy-image-3.5-previewNoNonePer image, by tier
vidu/vidu-image-q20 to 7NonePer 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"]))

Response

The OpenAI-compatible route returns a creation timestamp and image data. This excerpt omits the base64 bytes.

json (truncated response excerpt)
{
  "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

FieldNotes
modelRequired. Use an ID listed by GET /v1/images/models.
promptRequired. Sent to the provider exactly as written.
nNumber of images; 1 on every model.
aspect_ratio, resolutionOptional. 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, qualitySupported only by some models. An unsupported value returns 400 invalid_request before the provider is called.
input_referencesReference images, on the models marked in the tables above.
response_formatDefaults to b64_json, the base64-encoded image bytes.
providerorder, 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.

json (request excerpt)
{
  "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.

json
{
  "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. A size that disagrees with the ratio or tier is 400 unsupported_parameter too.
  • A request with no provider uses the model's default route, and tokenhub_image_options lists that route's options. A model with more than one provider can offer more ratios and tiers on another: pin one with provider.only and the request is validated for that provider's table.
  • POST /api/v1/images reads size: "2K" as resolution, and with no resolution it uses the 2K size 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.

ModelReferencesPrice
bytedance/seedream-5-0-pro0 to 10Each 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.00 to 10Unchanged; references add no charge.
vidu/vidu-image-q20 to 7The 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"),
);

Quality, count and output

  • n is 1 on every model; a larger value is 400 invalid_request. Send several requests for several images.
  • quality is not taken by the models in the tables above: it is 400 unsupported_parameter.
  • seed, negative_prompt, output_format, style, watermark and stream: true are refused with 400 unsupported_parameter on 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/images reports the media_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_options from GET /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. size is a AI Hub size (see tokenhub_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-proA miniature greenhouse in a glowing glass sphere, with ferns and a copper staircase above a dark teal pool.
Original image: 2048 × 2048 PNG. This preview is smaller for faster loading.

Qwen Image 2.1 Turbo

qwen/qwen-image-2.1-turboA luminous glass sphere containing a miniature greenhouse with orchids, a copper staircase and warm amber light.
Original image: 2048 × 2048 PNG. This preview is smaller for faster loading.

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-proAn orange and teal running sneaker floating above a pastel podium, with orange and teal colour powder around it.
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.
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"),
);

Skincare flat lay

bytedance/seedream-5-0-proA serum bottle, a cream jar and a sheet mask pack on a yellow surface, surrounded by citrus slices and green leaves.
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.
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"),
);

Summer sale fashion photo

bytedance/seedream-5-0-proA smiling woman in a colourful summer dress holding shopping bags in front of a pink and blue backdrop, with confetti in the air.
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.
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"),
);

Iced coffee product shot

bytedance/seedream-5-0-proA clear cup of iced coffee with ice cubes and a coffee splash, against a turquoise background with tropical leaves.
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.
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"),
);

Headphones lifestyle image

bytedance/seedream-5-0-proA young man with his eyes closed wearing red wireless headphones, with purple and blue city lights blurred behind him.
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.
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"),
);

Food delivery banner

bytedance/seedream-5-0-proA delivery rider in a green jacket and helmet handing a bag of food to a customer at a doorway on a sunny day.
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.
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"),
);

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
A luminous jellyfish-shaped island floating above a rainforest canyon with colourful birds.
Pick the shape with aspect_ratio and the tier with resolution (1K, 2K or 4K), or send the size from tokenhub_image_options.
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"),
);

Vidu Image Q2, 16:9 at 2K

vidu/vidu-image-q2
A lantern-lit night market beside turquoise canals at dusk, with hot-air balloons overhead.
Vidu's tiers are 1K (1920 × 1080 at 16:9), 2K and 4K; send 1K, 2K or 4K as resolution. The exact sizes are in tokenhub_image_options.
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"),
);

Vidu Image Q2 with a reference image

vidu/vidu-image-q2
The lantern market restyled as a watercolour and ink illustration.
Zero to seven reference images, as https URLs or base64 data: URIs. The price follows the number of references.

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"),
);

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.