Skip to main content
POST
Estimate the price of a text-to-image generation request
Estimate the cost of an image generation job before submitting it. Request body mirrors the fields used by /api/v2/images/generations.

Authorizations

Authorization
string
header
required

Sanctum personal access token, sent as Authorization: Bearer <token>. The token is opaque — it carries no claims and no embedded expiry, so do not attempt to decode it. Issue and revoke tokens from your account dashboard.

Headers

Accept
enum<string>
default:application/json
required
Available options:
application/json

Body

application/json

Image generation parameters

Every example in this schema is a working set for the model example shown — they are not defaults and not portable. Sizes, step counts, frame counts and frame rates are all per-model: read info.limits and info.defaults for the model you actually intend to use from GET /api/v2/models. Substituting a different model while keeping these values is the most common source of a 422.

prompt
string
required

The main prompt for image generation

Example:

"A beautiful sunset over mountains"

model
string
required

The model to use for image generation. Available models can be retrieved via the GET /api/v2/models endpoint.

Example:

"Flux1schnell"

width
integer
required

Width of the generated image in pixels. The accepted range is model-specific — read info.limits.min_width/max_width and min_height/max_height for your model from GET /api/v2/models. Some models also publish dimension_multiple or resolution_step: values are snapped DOWN to that grid before validation, so an off-grid size is silently reduced rather than rejected. max_pixels and max_ratio, where present, cap total area and aspect ratio on top of the per-side bounds.

Example:

512

height
integer
required

Height of the generated image in pixels. The accepted range is model-specific — read info.limits.min_width/max_width and min_height/max_height for your model from GET /api/v2/models. Some models also publish dimension_multiple or resolution_step: values are snapped DOWN to that grid before validation, so an off-grid size is silently reduced rather than rejected. max_pixels and max_ratio, where present, cap total area and aspect ratio on top of the per-side bounds.

Example:

512

seed
integer
required

Random seed for generation

Example:

42

negative_prompt
string | null

Elements to avoid in the generated image

Example:

"blur, darkness, noise"

loras
object[]

Array of LoRA models to apply. Accepted only by models that publish a loras array in GET /api/v2/models — a LoRA not listed for the selected model is rejected with a 422. The example below belongs to the model example shown and is not portable to another model.

guidance
number

Guidance scale. Required only when the model declares info.features.supports_guidance; for a model that does not, the value is accepted and ignored. Bounds are info.limits.min_guidance / max_guidance, from GET /api/v2/models.

Example:

7.5

steps
integer

Number of inference steps. Required when the model publishes step bounds: send it if info.limits.min_steps / max_steps or info.defaults.steps is present for your model in GET /api/v2/models, and stay inside that range. Key off those fields rather than info.features.supports_steps, which some models omit while still using steps.

Example:

4

quality
string | null

Quality tier, for models that support one (e.g. gpt-image: low/medium/high/auto). Only the values listed in that model's available options are accepted; ignored for models without a quality tier. Accepted values are model-specific — read info.limits.quality_options for your model from GET /api/v2/models. A model with an empty or absent list does not support a quality tier and ignores the field.

Example:

"medium"

Response

Calculated price for text2img inference.

data
object