Run a model: Pictures

On this page

Run a model (queued) #

Pictures, clips, voice and music run in the background. Each model has its own path: send the body, get a ticket at once, then poll the job (see Jobs). The charge is taken when we accept the job and refunded if it fails.

Errors any model in this group can return
Errors any model in this group can return
HTTPCodeWhat happenedWhat to doCredits
400invalid_requestThe request is malformed or breaks the model's input rules: the body is not JSON, a field is missing, has the wrong type or is out of bounds, or the Idempotency-Key header is missing. Extra fields: detail, which names what is wrong, such as "Idempotency-Key header is required" or "input must have required property 'prompt'".Fix the request using detail and the Alias's input_schema from GET /v1/models, then send it again. You can keep the same retry key: nothing was created.Not charged.
401invalid_keyThe API key is missing, mistyped, revoked, or past the overlap after a rotation. The answer is the same in every case.Send Authorization: Bearer oneup_live_… with a current key. You can make a new key on your account page.Not charged.
402out_of_creditsYour balance is smaller than the price of this request. Extra fields: topup_url, your account page; required, the price of this request in credits; packs, the credit packs you can buy there, each with its credits and price_cents (an empty list when none is on sale).Add credits from your account page, or wait for your plan's next month of credits. Then send the same request with the same retry key.Not charged.
403account_disabledThe account is disabled: its sign-in was removed or blocked. Every key and session of the account answers this.Write to video@oneupai.com.Not charged. The account's credits stay.
403account_frozenThe account is frozen for now, for example while a payment dispute is open. Extra fields: account_url.See your account page. Reading your results still works.Not charged.
403credit_debtYou have credit debt: a payment for credits you already spent was reversed. Extra fields: account_url.Settle it from your account page; new work is accepted again once it is paid.Not charged.
403entitlement_requiredYour subscription has ended: it was canceled, or a payment failed and the seven days of grace have passed. Extra fields: account_url.Renew on your account page; the same keys work again. Checking status, reading results and downloading your files still work in the meantime.Not charged.
403plan_requiredThis key belongs to an account that is no longer on an API plan, Concierge or Concierge Plus. Only keys of accounts on those plans can start work through the API. Extra fields: account_url.Move the account back to Concierge or Concierge Plus; the key works again.Not charged.
403storage_quota_exceededYour account has reached its storage quota, so new uploads, new jobs and new Timeline versions are refused. Extra fields: account_url on most calls.Delete assets, uploads or Projects you no longer need, or release a hold. Work you already paid for is never deleted because of this.Not charged.
404unknown_modelNo Alias by that name is available to you.Check the name, including the oneup/ part, against GET /v1/models.Not charged.
409idempotency_conflictYou sent a retry key again with a different request.Make a new retry key for each new request. To retry the first request, send exactly the same body.This request is not charged; the first one stands.
410model_retiredThis Alias was replaced, and its notice period has ended. Extra fields: replacement, the Alias to use instead (or null).Send your request to the replacement.Not charged.
413payload_too_largeThe request body is over 1 MB.Upload files first and send their file_url, instead of putting file contents in the body.Not charged.
422invalid_inputWe accepted the request, but the input could not be used: the model refused it, or the page you asked us to read could not be read. Extra fields: detail, a short reason. The page readers use these codes: listing_unreadable and listing_unreachable for a property listing; page_paywalled, page_not_article, page_unreadable and page_unreachable for an article.Change the input and send it with a new retry key.Refunded.
429daily_limit_reachedThis request would take the credits your account spent today past its daily credit limit. The count starts again at 00:00 UTC. Extra fields: limit, the daily limit in credits; renews_at, when the count starts again (the next 00:00 UTC); and the Retry-After header, the seconds until then.Send it again after renews_at, with the same retry key. Nothing ran.Not charged.
429rate_limitedYou sent requests faster than your plan's rate limit, reached a limit a feature counts on its own, or have two Previews running already. The daily credit limit has its own code, daily_limit_reached. Extra fields: the Retry-After header, in seconds.Wait that long, then send the same request with the same retry key.Not charged.
500internal_errorSomething went wrong on our side that we did not expect. The answer says nothing about the cause. Extra fields: request_id, the same id as the x-request-id header. It names the exact request in our logs.Send the same request again with the same retry key. If it keeps failing, send us the request_id.Never charged twice. If we accepted the work before the failure, the same retry key returns it instead of charging again.
502upstream_errorThe work failed on our side. GET /v1/queue/result/{ticket} also answers this for a generation that ended FAILED. Extra fields: detail is replay_of_failed when you sent a retry key again whose sync run had already failed: nothing ran again and nothing was charged. A failure as it happens has no detail.Try again with a new retry key. The same key would return the same failed generation.Refunded.
503unavailableWe are not taking this kind of request for a moment: during maintenance, when a safety limit trips, or when a service we depend on is down. Extra fields: sometimes a Retry-After header, and a request_id when a service we depend on did not answer.Wait, then send the same request with the same retry key.Not charged; if it comes after we accepted the work, the charge is refunded.

POST /v1/queue/submit/oneup/image-depth #

Measure how far away everything is

Measures how far away everything in a photograph is, so a still can be moved through like a filmed shot. Params: image_url. 1 credit, charged once per photograph. Live price: GET /v1/models. Charged when accepted; refunded if it fails.

Key: API key · Credits: 1 credit · Queued: poll for the result

Parameters

Parameters
NameInRequiredTypeDescription
Idempotency-Keyheaderyestext, 1–∞ charactersA unique value you make for each new job (a UUID works). Sending the same key with the same body again returns the same job and never charges twice; the same key with a different body is idempotency_conflict.

Request body

Request body
FieldRequiredTypeDescription
image_urlyestext, 1–2048 charactersThe photograph to measure: an uploaded file_url from /v1/uploads or an external image URL (https).
labelnotextOptional. A name for this job and every file it makes, shown on your account page and used as the download name. Never sent to the model.

Request

curl -X POST "https://api.oneupai.com/v1/queue/submit/oneup/image-depth" \
  -H "Authorization: Bearer $ONEUP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "image_url": "https://media.oneupai.com/u/…/uploads/oneup_upload_…"
}'

Response (200)

{
  "ticket": "oneup_req_SuaNFGGC0b4MGIeOrp78KFRXfR",
  "status": "QUEUED"
}

Errors: the same as every endpoint in this group, listed above.

POST /v1/queue/submit/oneup/image-edit #

Edit an image

Reference-guided image editing: describe the change, no masks. Params: prompt, image_urls (1–2 references), image_size?, output_format?. 13 credits for the first megapixel + 4 per additional (max 4 MP). Live price: GET /v1/models. Charged when accepted; refunded if it fails.

Key: API key · Credits: 13 credits (first megapixel) + 4 per additional · Queued: poll for the result

Parameters

Parameters
NameInRequiredTypeDescription
Idempotency-Keyheaderyestext, 1–∞ charactersA unique value you make for each new job (a UUID works). Sending the same key with the same body again returns the same job and never charges twice; the same key with a different body is idempotency_conflict.

Request body

Request body
FieldRequiredTypeDescription
promptyestext, 1–2000 charactersWhat to change, in plain language (no masks needed).
image_urlsyeslistOne or two reference images: uploaded file_urls from /v1/uploads (validated for ownership) or external image URLs. Two at most — reference megapixels are part of the wholesale cost.
image_sizenogroupOutput dimensions; omitted = matched to the reference. Billed megapixels = ceil(width x height / 1e6), capped at 4 MP by unit bounds.
image_size.widthyeswhole number, 256–2048
image_size.heightyeswhole number, 256–2048
output_formatnotext, one of: jpeg, pngFile type of the result; jpeg when omitted.
labelnotextOptional. A name for this job and every file it makes, shown on your account page and used as the download name. Never sent to the model.

Request

curl -X POST "https://api.oneupai.com/v1/queue/submit/oneup/image-edit" \
  -H "Authorization: Bearer $ONEUP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "swap the background for a bright kitchen, keep the product exactly as is",
  "image_urls": [
    "https://example.com/product.jpg"
  ]
}'

Response (200)

{
  "ticket": "oneup_req_SuaNFGGC0b4MGIeOrp78KFRXfR",
  "status": "QUEUED"
}

Errors: the same as every endpoint in this group, listed above.

POST /v1/queue/submit/oneup/image-generate-lite #

Quick image

Fast text-to-image. Params: prompt, image_size?. Priced per megapixel (max 4 MP). Live price: GET /v1/models. Charged when accepted; refunded if it fails.

Key: API key · Credits: 1 credit per megapixel · Queued: poll for the result

Parameters

Parameters
NameInRequiredTypeDescription
Idempotency-Keyheaderyestext, 1–∞ charactersA unique value you make for each new job (a UUID works). Sending the same key with the same body again returns the same job and never charges twice; the same key with a different body is idempotency_conflict.

Request body

Request body
FieldRequiredTypeDescription
promptyestext, 1–2000 charactersWhat to generate.
image_sizenogroupOutput dimensions; omitted = 1024-class square (1 MP). Billed megapixels = ceil(width x height / 1e6), capped at 4 MP by unit bounds.
image_size.widthyeswhole number, 256–2048
image_size.heightyeswhole number, 256–2048
labelnotextOptional. A name for this job and every file it makes, shown on your account page and used as the download name. Never sent to the model.

Request

curl -X POST "https://api.oneupai.com/v1/queue/submit/oneup/image-generate-lite" \
  -H "Authorization: Bearer $ONEUP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "a red bicycle in the rain"
}'

Response (200)

{
  "ticket": "oneup_req_SuaNFGGC0b4MGIeOrp78KFRXfR",
  "status": "QUEUED"
}

Errors: the same as every endpoint in this group, listed above.

POST /v1/queue/submit/oneup/image-generate-pro #

Premium image

Premium text-to-image, highest quality. Params: prompt, image_size?. 7 credits for the first megapixel + 4 per additional (max 4 MP). Live price: GET /v1/models. Charged when accepted; refunded if it fails.

Key: API key · Credits: 7 credits (first megapixel) + 4 per additional · Queued: poll for the result

Parameters

Parameters
NameInRequiredTypeDescription
Idempotency-Keyheaderyestext, 1–∞ charactersA unique value you make for each new job (a UUID works). Sending the same key with the same body again returns the same job and never charges twice; the same key with a different body is idempotency_conflict.

Request body

Request body
FieldRequiredTypeDescription
promptyestext, 1–2000 charactersWhat to generate.
image_sizenogroupOutput dimensions; omitted = 1024-class square (1 MP). Billed megapixels = ceil(width x height / 1e6), capped at 4 MP by unit bounds.
image_size.widthyeswhole number, 256–2048
image_size.heightyeswhole number, 256–2048
labelnotextOptional. A name for this job and every file it makes, shown on your account page and used as the download name. Never sent to the model.

Request

curl -X POST "https://api.oneupai.com/v1/queue/submit/oneup/image-generate-pro" \
  -H "Authorization: Bearer $ONEUP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "product shot of a ceramic mug, studio lighting"
}'

Response (200)

{
  "ticket": "oneup_req_SuaNFGGC0b4MGIeOrp78KFRXfR",
  "status": "QUEUED"
}

Errors: the same as every endpoint in this group, listed above.

POST /v1/queue/submit/oneup/image-generate-standard #

Make a detailed picture

Detailed text-to-image at medium quality, sized to your frame (edges up to 2048 px). Params: prompt, quality (medium), image_size?, output_format?. 4 credits per picture. Live price: GET /v1/models. Charged when accepted; refunded if it fails.

Key: API key · Credits: 4 credits · Queued: poll for the result

Parameters

Parameters
NameInRequiredTypeDescription
Idempotency-Keyheaderyestext, 1–∞ charactersA unique value you make for each new job (a UUID works). Sending the same key with the same body again returns the same job and never charges twice; the same key with a different body is idempotency_conflict.

Request body

Request body
FieldRequiredTypeDescription
promptyestext, 1–4000 charactersWhat to generate.
qualityyestext, one of: mediumFixed at medium at this record (the vendor's default, high, costs four times as much).
image_sizenogroupOutput dimensions in multiples of 16, each edge at most 2048; omitted = the vendor's default square. The Agent host passes the video frame's own size so the picture fills it.
image_size.widthyeswhole number, 256–2048
image_size.heightyeswhole number, 256–2048
output_formatnotext, one of: jpeg, png, webppng when omitted; jpeg for a quarter of the bytes.
labelnotextOptional. A name for this job and every file it makes, shown on your account page and used as the download name. Never sent to the model.

Request

curl -X POST "https://api.oneupai.com/v1/queue/submit/oneup/image-generate-standard" \
  -H "Authorization: Bearer $ONEUP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "the riverside lot at Mill Street with survey stakes at dusk",
  "quality": "medium",
  "image_size": {
    "width": 736,
    "height": 1280
  },
  "output_format": "jpeg"
}'

Response (200)

{
  "ticket": "oneup_req_SuaNFGGC0b4MGIeOrp78KFRXfR",
  "status": "QUEUED"
}

Errors: the same as every endpoint in this group, listed above.

POST /v1/queue/submit/oneup/image-upscale #

Sharpen a small picture

Sharpens a small picture to twice its size (a 1024x768 photo becomes 2048x1536), JPEG out. Params: image_url. 3 credits per picture. Live price: GET /v1/models. Charged when accepted; refunded if it fails.

Key: API key · Credits: 3 credits · Queued: poll for the result

Parameters

Parameters
NameInRequiredTypeDescription
Idempotency-Keyheaderyestext, 1–∞ charactersA unique value you make for each new job (a UUID works). Sending the same key with the same body again returns the same job and never charges twice; the same key with a different body is idempotency_conflict.

Request body

Request body
FieldRequiredTypeDescription
image_urlyestext, 1–2048 charactersThe picture to enhance: an uploaded file_url from /v1/uploads or an external image URL (https).
scalenonumber, 2–2The factor. Fixed at 2 at this record (a 1024x768 photo becomes 2048x1536).
modelnotext, one of: standard, detailedstandard — tuned for photographs (the default when omitted); detailed — a stronger restoration.
output_formatnotext, one of: jpeg, pngjpeg when omitted (a quarter of the bytes of png for a photograph).
labelnotextOptional. A name for this job and every file it makes, shown on your account page and used as the download name. Never sent to the model.

Request

curl -X POST "https://api.oneupai.com/v1/queue/submit/oneup/image-upscale" \
  -H "Authorization: Bearer $ONEUP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "image_url": "https://media.oneupai.com/u/…/uploads/oneup_upload_…",
  "scale": 2,
  "model": "standard",
  "output_format": "jpeg"
}'

Response (200)

{
  "ticket": "oneup_req_SuaNFGGC0b4MGIeOrp78KFRXfR",
  "status": "QUEUED"
}

Errors: the same as every endpoint in this group, listed above.