Which plans include the API?
Which plans include the API?
API access is a plan feature. If your organization’s plan does not include it,
requests return
403 plan_upgrade_required. See
API keys and permissions.Why did my request return 202 with no images?
Why did my request return 202 with no images?
Generation is asynchronous. A
202 Accepted means the job was accepted and is
running; the images appear when you poll the resource to completed. See
Jobs and lifecycle and
Polling.Do I have to pick an audience?
Do I have to pick an audience?
For ad campaigns and UGC videos, yes:
audience_id is required. Send a saved
audience, or null for a deliberately broad video or campaign. Audiences are
generated automatically for every product; see
Audiences.How do I control what a request can spend?
How do I control what a request can spend?
Send
max_credits on any request that starts generation. If the job would
cost more, the request is refused with 422 credit_limit_exceeded and nothing
is charged. You can also set a monthly credit budget on an API key. See
Credits and spending.What happens to credits when a job fails?
What happens to credits when a job fails?
Failed jobs and failed items are refunded:
credits_charged counts only what
completed. A request refused outright is never charged. See
Jobs and lifecycle.Can I call the API from the browser?
Can I call the API from the browser?
No. The key would be exposed to anyone who opens the page. Call the API from
your server, and keep the key in an environment variable. See
Authentication.
How do I see what an operation costs?
How do I see what an operation costs?
GET /pricing returns the credit cost of every operation, and GET /account
returns your balance and key budget. See
Credits and spending.Why does my key get 403?
Why does my key get 403?
Three common reasons: the key lacks the permission the endpoint requires
(
insufficient_permission), the organization’s plan does not include API
access (plan_upgrade_required), or the organization is suspended
(org_suspended). See Errors and retries.How do I get audiences for an existing product?
How do I get audiences for an existing product?
Audiences are generated and saved automatically when a product is created:
GET /products/{product_id}/audiences lists them. If generation is still
running, its generation_status is generating; poll until it is ready.
See Audiences.A retry created a duplicate job. How do I prevent that?
A retry created a duplicate job. How do I prevent that?
Send an
Idempotency-Key on every request that spends credits. A retry with
the same key and body returns the original job instead of starting a second
one. See Idempotent requests.Why was my photoshoot request rejected with missing_product_images?
Why was my photoshoot request rejected with missing_product_images?
The product must have
status: "ready" with at least one image before it can
be shot. Create it from a URL or images and poll until it is ready. See
Products.Can I animate any image?
Can I animate any image?
Animations start from a completed Quick Shoot photo, or a video made from one.
See Animate a photo.