Skip to main content
POST
This endpoint is asynchronous. A successful submission returns a task_id. Use task queries to retrieve status and images. Stop polling when the status is completed or failed. Generating at 4k may take several minutes; a total wait timeout of 10 minutes is recommended.

Request headers

string
required
Bearer authentication in the format Bearer <token>, where <token> is your APIMart API Key.

Request parameters

string
required
Must be flux-3-image.
string
required
A scene description for text-to-image, or image editing instructions. Negative prompts are not supported; describe what you want to see instead.Use tags and bbox JSON within prompt to specify layouts or local editing regions. See the examples below.
string[]
Reference image list, up to 10 images. Supports publicly accessible HTTP(S) URLs or Base64 input.Omit for text-to-image. Provide one image for single-image editing or multiple images for multi-image reference.
string
default:"auto"
Output aspect ratio. Supported values:21:9, 2:1, 16:9, 3:2, 7:5, 4:3, 5:4, 1:1, 4:5, 3:4, 5:7, 2:3, 9:16, 1:2, 9:21, or auto.Ratio formats such as 16x9 are also accepted. With auto:
  • Editing or multiple reference images: follows the aspect ratio of the first reference image.
  • Text-to-image: determined by the prompt; falls back to 1:1 if no aspect ratio is determined.
string
Compatibility parameter for the aspect ratio. Can replace aspect_ratio and accepts the same values. Use only one of these fields.Pixel dimensions such as 1024x1024 are not supported and return HTTP 400. Use resolution to select the output resolution.
string
default:"1k"
Output resolution tier. Supports 768sq, 1k, 1.5k, 2k, and 4k, case-insensitively. 768 is equivalent to 768sq.This parameter determines the billing tier. If omitted, generation and billing use 1k. Unsupported values such as 3k return HTTP 400.
integer
default:"2"
Content safety tolerance, from 0–4. 0 is the strictest.
boolean
default:"true"
Whether to allow web or image searches before generation. Set to false to disable.Must be a boolean, not the strings "false" or "true".
integer
default:"1"
Each request generates 1 image; only 1 is supported. Submit separate tasks for multiple images. Values above 1 return HTTP 400.

Unsupported parameters

The following parameters return HTTP 400 when provided; they are not silently ignored:
  • width, height
  • Pixel dimensions in size, such as 1024x1024
  • seed, steps, guidance
  • output_format, negative_prompt, prompt_upsampling, mask_url
Use resolution for higher resolution and aspect_ratio for a specific aspect ratio.

Edit a reference image

Replace the example URL with a publicly accessible image URL. For multiple references, provide multiple URLs in image_urls, up to 10 images in total.

Multiple reference images

Editing, local editing, and layout use the same endpoint and model on this page, billed by resolution. References are numbered in order: ref_image_0 for the first, ref_image_1 for the second. You can also use Image 1 / Image 2 in the prompt.

Local editing (bounding box)

Start prompt with natural-language editing instructions and refer to elements using <tags>, such as <car_1>. Append a JSON array within the same string, with one object per box. The bbox is not a separate request parameter. All box fields (src_bbox, tgt_bbox, bbox) use [top, left, bottom, right], that is, [y1, x1, y2, x2], on a 0–1000 normalized grid: top-left is [0,0] and bottom-right is [1000,1000]. These are not pixel coordinates. This example turns the boxed car red and describes the background to preserve. The URL and box positions are illustrative; replace them to match your image.

Move an element

Place the following object in the bbox array at the end of the prompt. from identifies the source image, src_bbox the original position, and tgt_bbox the new position. Also use the matching <knight_1> tag in the natural-language instruction.

Text-to-image layout

Layouts also work without reference images. Each box uses id, bbox, and desc. Set aspect_ratio explicitly because the coordinate grid stretches with the aspect ratio.

Usage notes

  • The bbox JSON is part of the prompt string. When writing request JSON manually, escape its internal double quotes as \". SDKs or JSON serialization methods can handle this automatically.
  • Also list regions that should remain unchanged and describe what to preserve in desc.
  • Element tags in the prompt must match JSON id values one-to-one. Reference identifiers such as <ref_image_0> point to input images.
  • This model has no mask parameter and does not support mask_url; providing mask_url returns HTTP 400. Bbox editing does not use a mask upload parameter.

Submission response

integer
Response status code. 200 indicates success.
array
Task submission result.

Query task results

Example success response (the image URL is a placeholder):
Read image links from the data.result.images[0].url array. If the task status is failed, inspect the returned error message instead of continuing to wait for an image.

Resolution and billing

Billed per image. The unit price depends only on resolution, not the aspect ratio or number of reference images. Reference images incur no extra charge. Output sizes are approximate; actual pixel dimensions depend on the returned image. Refer to model pricing for each tier. Tasks that fail or are blocked by content moderation receive a full refund.

Common parameter errors