Перейти к содержимому
FlowAPI

Документация

llms.txt

API reference

The FlowAPI API has 7 endpoints under https://useflowapi.com/v1; this reference is generated from openapi.json, the same OpenAPI 3.1 file you can load into Postman, Insomnia or a code generator.

Endpoints

Method Path Summary
POST /v1/generations Submit an image or video generation job
POST /v1/quotes Price a request without creating a job (never charges)
GET /v1/models List models and their flat prices
GET /v1/balance Available balance and trial credit
POST /v1/files Upload a reference file for a later job
GET /v1/jobs/{id} Get a job: status, result files or error
POST /v1/jobs/{id}/cancel Cancel a queued or running job (refunded in full)
GET /v1/jobs List your jobs of the key's mode, newest first (cursor pagination)
GET /v1/jobs/{id}/status Long-poll a job until it finishes or wait seconds pass
GET /v1/models/{vendor}/{model} One model and its flat prices
GET /v1/usage Spend and job counts by day, model and key (the key's live/test mode)

POST /v1/generations

Submit an image or video generation job.

Charges the flat price when the job is accepted; a failed, timed-out or cancelled job is refunded. Rate limit: 120 writes per minute per key. Running jobs per account: 20 image, 5 video. Body ≤ 256 KB.

  • Auth: Bearer API key
  • Operation id: createGeneration
  • Request body: application/json GenerationRequest
Parameter In Required Type Description
Idempotency-Key header Yes string Required. Retrying with the same key and body returns the original job (header idempotent-replayed: true); the same key with a different body returns 409.
Status Meaning Body
202 Job accepted (or replayed) application/json Job
400 FLOW_INVALID_REQUEST application/json Error
401 FLOW_UNAUTHORIZED application/json Error
402 FLOW_INSUFFICIENT_BALANCE application/json Error
403 FLOW_SPEND_LIMIT_EXCEEDED, FLOW_ACCOUNT_RESTRICTED application/json Error
404 FLOW_MODEL_NOT_FOUND, FLOW_JOB_NOT_FOUND, FLOW_FILE_NOT_FOUND application/json Error
409 FLOW_IDEMPOTENCY_CONFLICT application/json Error
422 FLOW_CONTENT_REJECTED, FLOW_UNSUPPORTED_PARAMETER application/json Error
429 FLOW_RATE_LIMITED, FLOW_TOO_MANY_RUNNING_JOBS application/json Error
503 FLOW_MODEL_UNAVAILABLE, FLOW_TEMPORARILY_UNAVAILABLE application/json Error

POST /v1/quotes

Price a request without creating a job (never charges).

Rate limit: 600 quotes per minute per key.

  • Auth: Bearer API key
  • Operation id: createQuote
  • Request body: application/json GenerationRequest
Status Meaning Body
200 Quote application/json Quote
400 FLOW_INVALID_REQUEST application/json Error
401 FLOW_UNAUTHORIZED application/json Error
404 FLOW_MODEL_NOT_FOUND, FLOW_JOB_NOT_FOUND, FLOW_FILE_NOT_FOUND application/json Error
422 FLOW_CONTENT_REJECTED, FLOW_UNSUPPORTED_PARAMETER application/json Error
429 FLOW_RATE_LIMITED, FLOW_TOO_MANY_RUNNING_JOBS application/json Error
503 FLOW_MODEL_UNAVAILABLE, FLOW_TEMPORARILY_UNAVAILABLE application/json Error

GET /v1/models

List models and their flat prices.

Public: no API key needed. Rate-limited per IP.

  • Auth: None
  • Operation id: listModels
Status Meaning Body
200 Model list application/json object
429 FLOW_RATE_LIMITED, FLOW_TOO_MANY_RUNNING_JOBS application/json Error
503 FLOW_MODEL_UNAVAILABLE, FLOW_TEMPORARILY_UNAVAILABLE application/json Error

GET /v1/balance

Available balance and trial credit.

  • Auth: Bearer API key
  • Operation id: getBalance
Status Meaning Body
200 Balance application/json object
401 FLOW_UNAUTHORIZED application/json Error
429 FLOW_RATE_LIMITED, FLOW_TOO_MANY_RUNNING_JOBS application/json Error
503 FLOW_MODEL_UNAVAILABLE, FLOW_TEMPORARILY_UNAVAILABLE application/json Error

POST /v1/files

Upload a reference file for a later job.

Up to 20 MB; kept 24 hours. Pass the returned id as input.references[].file_id.

  • Auth: Bearer API key
  • Operation id: uploadFile
  • Request body: multipart/form-data object
Status Meaning Body
201 Stored application/json File
400 FLOW_INVALID_REQUEST application/json Error
401 FLOW_UNAUTHORIZED application/json Error
429 FLOW_RATE_LIMITED, FLOW_TOO_MANY_RUNNING_JOBS application/json Error
503 FLOW_MODEL_UNAVAILABLE, FLOW_TEMPORARILY_UNAVAILABLE application/json Error

GET /v1/jobs/{id}

Get a job: status, result files or error.

  • Auth: Bearer API key
  • Operation id: getJob
Parameter In Required Type Description
id path Yes string Job id (job_…)
Status Meaning Body
200 Job application/json Job
401 FLOW_UNAUTHORIZED application/json Error
404 FLOW_MODEL_NOT_FOUND, FLOW_JOB_NOT_FOUND, FLOW_FILE_NOT_FOUND application/json Error
429 FLOW_RATE_LIMITED, FLOW_TOO_MANY_RUNNING_JOBS application/json Error
503 FLOW_MODEL_UNAVAILABLE, FLOW_TEMPORARILY_UNAVAILABLE application/json Error

POST /v1/jobs/{id}/cancel

Cancel a queued or running job (refunded in full).

  • Auth: Bearer API key
  • Operation id: cancelJob
Parameter In Required Type Description
id path Yes string Job id (job_…)
Status Meaning Body
200 Job after cancel application/json Job
401 FLOW_UNAUTHORIZED application/json Error
404 FLOW_MODEL_NOT_FOUND, FLOW_JOB_NOT_FOUND, FLOW_FILE_NOT_FOUND application/json Error
429 FLOW_RATE_LIMITED, FLOW_TOO_MANY_RUNNING_JOBS application/json Error
503 FLOW_MODEL_UNAVAILABLE, FLOW_TEMPORARILY_UNAVAILABLE application/json Error

GET /v1/jobs

List your jobs of the key's mode, newest first (cursor pagination).

  • Auth: Bearer API key
  • Operation id: listJobs
Parameter In Required Type Description
limit query No integer
cursor query No string next_cursor from the previous page
status query No queued | running | succeeded | failed | cancelled
model query No string
Status Meaning Body
200 One page of jobs application/json object
400 FLOW_INVALID_REQUEST application/json Error
401 FLOW_UNAUTHORIZED application/json Error
429 FLOW_RATE_LIMITED, FLOW_TOO_MANY_RUNNING_JOBS application/json Error
503 FLOW_MODEL_UNAVAILABLE, FLOW_TEMPORARILY_UNAVAILABLE application/json Error

GET /v1/jobs/{id}/status

Long-poll a job until it finishes or wait seconds pass.

  • Auth: Bearer API key
  • Operation id: waitJob
Parameter In Required Type Description
id path Yes string Job id (job_…)
wait query No number Seconds to hold the request while the job is still running
Status Meaning Body
200 Job application/json Job
400 FLOW_INVALID_REQUEST application/json Error
401 FLOW_UNAUTHORIZED application/json Error
404 FLOW_MODEL_NOT_FOUND, FLOW_JOB_NOT_FOUND, FLOW_FILE_NOT_FOUND application/json Error
429 FLOW_RATE_LIMITED, FLOW_TOO_MANY_RUNNING_JOBS application/json Error
503 FLOW_MODEL_UNAVAILABLE, FLOW_TEMPORARILY_UNAVAILABLE application/json Error

GET /v1/models/{vendor}/{model}

One model and its flat prices.

Public: no API key needed. Rate-limited per IP.

  • Auth: None
  • Operation id: getModel
Parameter In Required Type Description
vendor path Yes string
model path Yes string
Status Meaning Body
200 Model application/json Model
404 FLOW_MODEL_NOT_FOUND, FLOW_JOB_NOT_FOUND, FLOW_FILE_NOT_FOUND application/json Error
429 FLOW_RATE_LIMITED, FLOW_TOO_MANY_RUNNING_JOBS application/json Error
503 FLOW_MODEL_UNAVAILABLE, FLOW_TEMPORARILY_UNAVAILABLE application/json Error

GET /v1/usage

Spend and job counts by day, model and key (the key's live/test mode).

  • Auth: Bearer API key
  • Operation id: getUsage
Parameter In Required Type Description
days query No integer
Status Meaning Body
200 Usage (UTC days; refunded jobs add no spend) application/json object
400 FLOW_INVALID_REQUEST application/json Error
401 FLOW_UNAUTHORIZED application/json Error
429 FLOW_RATE_LIMITED, FLOW_TOO_MANY_RUNNING_JOBS application/json Error
503 FLOW_MODEL_UNAVAILABLE, FLOW_TEMPORARILY_UNAVAILABLE application/json Error

Schemas

UsageCounts

Field Type Required Description
date string No
model string No
api_key_id string | null No
jobs integer Yes
succeeded integer Yes
failed integer Yes
spend object Yes

Money

Field Type Required Description
amount string Yes Decimal USD, up to 6 decimals
currency "USD" Yes

GenerationRequest

Field Type Required Description
model string Yes Model id from GET /v1/models, e.g. google/nano-banana-pro
input object Yes
parameters object No Model parameters (e.g. resolution, aspect_ratio). Images: n 1–4. Video: duration integer seconds 1–60, required.
webhook_url string No https only. Stored with the job.

Quote

Field Type Required Description
object "quote" No
model string No
type image | video No
spec string No
unit image | second No
units integer No
unit_price Money No
price Money No
trial_eligible boolean No
parameters object No

Model

Field Type Required Description
id string No
object "model" No
type image | video No
vendor string No
display_name string No
defaults object No
prices object[] No

Job

Field Type Required Description
id string Yes
object "job" Yes
status queued | running | succeeded | failed | cancelled Yes
model string Yes
mode live | test No
price Money Yes
refunded boolean Yes
created_at integer | null No Unix seconds
completed_at integer | null No Unix seconds
urls object No
result null | object No
error null | object No

File

Field Type Required Description
id string No
object "file" No
filename string | null No
media_type string No
bytes integer No
expires_at integer | null No

Error

Field Type Required Description
error object Yes

Вопросы и ответы

Is there an OpenAPI spec?
Yes. https://useflowapi.com/openapi.json is an OpenAPI 3.1 document covering every live endpoint.
Which endpoints need an API key?
Every endpoint except GET /v1/models needs an Authorization: Bearer key.
Is there a list-jobs endpoint?
No. Fetch jobs one at a time with GET /v1/jobs/{id}; a list endpoint is not available yet.