Loading models…
Loading models…
op-inference/black-forest-labs/flux-1-dev1 provider serves this model. Our price is the provider's rate plus our 4.5% fee.
| Provider | Our price | Provider's price | Your data |
|---|---|---|---|
| Runware | $0.001986per image | $0.0019 | May train on inputs |
Every request carries a key as a bearer token. Create a key, then put it in your environment.
export OP_API_KEY="<your key>"Nothing to install: curl ships with your shell, and fetch is built into Node 18 and later.
POST /v1/images/generations answers 202 with a job as soon as the request is accepted.
curl https://api.opinference.com/v1/images/generations \
-H "Authorization: Bearer $OP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "op-inference/black-forest-labs/flux-1-dev",
"prompt": "a paper boat drifting down a rain gutter"
}'The job is queued, then processing, then finishes: it succeeds, fails or is canceled. Ask for it until it finishes, as the Python and TypeScript examples do, or add a webhook and we send it to you, signed, the moment it finishes.
GET /v1/jobs/{id} returns the job as it is now.
The job once it has succeeded. Each output link is signed and issued again on every read, so fetch the job for a fresh one rather than storing the link.
{
"id": "job_01J9K2…",
"generation_id": "gen_01J9K2…",
"object": "job",
"state": "succeeded",
"modality": "image",
"model": "black-forest-labs/flux-1-dev",
"created_at": "2026-09-30T08:00:00Z",
"started_at": "2026-09-30T08:00:04Z",
"completed_at": "2026-09-30T08:01:12Z",
"output": [
{
"url": "https://…?X-Amz-Signature=…",
"url_expires_at": "2026-09-30T09:01:12Z",
"type": "image/png",
"bytes": 1482113,
"checksum_sha256": "…"
}
],
"usage": {
"units": {
"image": 1
}
}
}The request body for POST /v1/images/generations. A key not listed here is refused, and the error names it.
modelstringrequiredThe id of this model.
promptstringrequiredWhat the image should show.
guidancenumberHow closely the image follows the prompt.
heightintegerOutput height in pixels.
imageURL (image)An image to edit or transform.
maskURL (image)Marks the area of the input image to change.
nintegerHow many images to generate.
negative_promptstringWhat the image should not show.
output_formatenumFile format of the generated image.
seedintegerFixes the random seed, so the same request can reproduce an image.
stepsintegerNumber of denoising steps. More steps trade speed for detail.
widthintegerOutput width in pixels.
modelsstring[]Other model ids to try, in order, if this one is unavailable. Up to 5.
providerobjectWhere and how the request may run: region, zdr for zero data retention, data_collection, sort, and max_price, the most you will pay.
opobjectOptions for this request: retention, which can only be stricter than your key allows, tags, and session_id to group requests.
A job resource.
idThe job id. Poll GET /v1/jobs/{id} with it.
generation_idThe generation this job belongs to.
objectAlways "job".
statequeued, processing, succeeded, failed or canceled. The last three are final.
modalityThe kind of output.
modelThe model id that was asked for.
created_atWhen the job was accepted.
started_atWhen work began. Absent while queued.
completed_atWhen the job reached a final state.
progress.percentPercent complete, 0 to 100, or null when not reported.
progress.phasequeued, running or done.
progress.queue_positionAlways null today.
output[]The files produced: url (signed, re-issued on every read), url_expires_at, type, bytes, checksum_sha256.
usageThe billable units the job consumed.
usage.costAn estimate from the published price: billing_usd, cost_source, cost_status ("estimated") and price_version. Your balance is charged the settled amount.
op_metadataWhat applied when the job was accepted: generation_id, requested_model, retention_class, region and policy[].
errorOn failure: code, kind and a fixed message for the code.