Skip to main content
POST

Authorizations

string
default:"Bearer ${YOUR_API_KEY}"
required
Neural4D API key using the Bearer scheme.

Body application/json

Omitted optional parameters use the selected model’s current defaults. Values outside its supported resolutions or aspect ratios return unsupported_resolution or unsupported_aspect_ratio. Each reference image must be at most 10 MiB, whether supplied by file_id or url.
enum<string>
required
GPT Image 2 model identifier.Available option: openai/gpt-image-2.
string
required
Text instruction describing the image to generate or edit.Required string length: 1 - 500.
object[]
Optional reference images. Set file_id to the id returned by POST /openapi/v1/files, or provide the image’s public HTTPS URL directly in url. Only JPG, JPEG, PNG, and WEBP images are supported, up to 10 MiB per image. Images must pass content moderation.Allowed array length: 0 - 6 elements in total. You can mix file IDs and URLs; reference order is preserved. Each item must contain exactly one of file_id or url.
integer
default:1
Number of image generation tasks to create.Required range: 1 <= x <= 4.
enum<string>
default:"2K"
Named output resolution.Available options: 1K, 2K, 4K.
enum<string>
default:"1:1"
Target image width-to-height ratio.Available options: 1:1, 16:9, 9:16, 4:3, 3:4.

Response

Identify errors by error.code, not by matching message text.
Generation tasks accepted
string
required
Batch task ID returned by the generation request.Example: "normal-image-c50fe63e-699d-4d61-93f5-2099ab159d6d".
object[]
required
Generated child items created by the request.Allowed array length: at least 1 element.
enum<string>
required
Current status shared by the submitted image tasks.Available options: queued, processing, succeeded, failed.
integer<int64>
required
Unix timestamp in seconds when the batch task was created.
enum<string>
required
Image generation mode shared by the submitted tasks.Available options: text_to_image, image_to_image.
enum<string>
required
Image generation model used by the submitted tasks.Available options: openai/gpt-image-2, google/nano-banana-pro, bytedance/seedream-4.5, black-forest-labs/flux-2-pro, google/nano-banana-2-lite.
object
Total credits charged for the submitted tasks when available.