Generate Images
Synchronously generate or edit images.
bearerAuthorizationBearer <token>- body
prompt*stringRequired. Image generation or editing instructions.
size?stringOptional. Output dimensions as `WIDTHxHEIGHT`. Total pixels must be between 512×512 and 2048×2048. Defaults to `2048x2048` for text-to-image, or matches the last input image size for edits.
images?array<>Optional. Reference images for editing, uploaded as multipart files. Up to 3 PNG, JPEG or WebP files, at most 10 MiB each. Omit for text-to-image generation.
items <= 3application/json- response
created?numberCreation time as a Unix timestamp in seconds.
data?array<>1 <= items <= 1consumed?numberCredits consumed by this request (always 0.5).
error?stringError code, if the request could not be submitted. This is returned in the response body alongside HTTP 201, so clients must check this field rather than relying on the HTTP status alone. This field is omitted on success. For detailed error code information, please refer to: [errors](/en/api-specification/errors)
"NO_SUCH_TASK""ASSET_NOT_AVAILABLE""IMAGE_LABEL_LENGTH_TOO_LONG""INVALID_REQUEST""API_NO_ACTIVE_SUBSCRIPTION""API_SUBSCRIPTION_PLAN_TOO_LOW""API_PARALLELISM_LIMIT_REACHED""API_INSUFFICIENT_FUNDS""API_OBJECT_NOT_FOUND_ON_IMAGE""IMAGE_CONTENT_VIOLATION""PERMISSION_DENIED""API_UNKNOWN"message?stringcurl -X POST 'https://api.hyper3d.com/api/v2/images' \ -H 'Content-Type: application/json' \ -d '{ "prompt": "string"}'{ "created": 0, "data": [ { "b64_json": "string", "revised_prompt": "string" } ], "consumed": 0, "error": "NO_SUCH_TASK", "message": "string"}/api/v2/images is a synchronous endpoint. It returns exactly one base64-encoded image immediately (HTTP 201) for 0.5 Credits — no polling or download step needed.
Two input modes are supported on the same path:
| Mode | Content-Type | When to use |
|---|---|---|
| Text-to-image | application/json | Generate an image from a prompt only |
| Image editing | multipart/form-data | Edit or transform one or more reference images |
Input
prompt(required): Image generation or editing instructions.size(optional): Output dimensions asWIDTHxHEIGHT. Total pixels must be between 512×512 and 2048×2048. Defaults to2048x2048for text-to-image, or matches the last input image size for edits.images(optional, multipart only): Up to 3 reference images, each at most 10 MiB. Formats accepted: PNG, JPEG, WebP. Omit for text-to-image.
Text-to-image example
Send the prompt and size as JSON. No files required.
curl --fail-with-body --request POST 'https://api.hyper3d.com/api/v2/images' \
--header "Authorization: Bearer ${RODIN_API_KEY}" \
--header 'Content-Type: application/json' \
--data '{
"prompt": "A majestic snowy owl perched on a frost-covered branch, soft golden hour lighting, hyper-detailed feathers",
"size": "1024x1024"
}'
Image editing example
Upload reference images as multipart files alongside the prompt.
curl --fail-with-body --request POST 'https://api.hyper3d.com/api/v2/images' \
--header "Authorization: Bearer ${RODIN_API_KEY}" \
--form 'prompt=Add a glowing crescent moon behind the castle, atmospheric fog' \
--form 'size=1024x1024' \
--form 'images=@./castle.png'
Response
The successful response arrives immediately and contains the base64 image bytes without a data URL prefix — decode data[0].b64_json to obtain the raw PNG/JPEG/WebP content.
{
"created": 1728547200,
"data": [
{
"b64_json": "iVBORw0KGgoAAAANSUhEUgAA...",
"revised_prompt": "A majestic snowy owl perched on a frost-covered branch, soft golden hour lighting, hyper-detailed feathers, photorealistic, 4k"
}
],
"consumed": 0.5
}
| Field | Description |
|---|---|
created | Unix timestamp (seconds) of the request |
data[0].b64_json | Base64-encoded image bytes — decode to save a file |
data[0].revised_prompt | Model-revised prompt that produced the image (may be absent) |
consumed | Credits consumed by this request (always 0.5) |
error | Application error code if the request failed (absent on success) |
message | Human-readable error description (absent on success) |