Popcraft API
One API for AI video, images, audio and avatars
Add AI generation to your product through Popcraft’s enterprise API. Review pricing and integration requirements, then request access for your organization.
- Enterprise only
- Discounted offers on volume
- Charged only on success
# one prompt in — a job id back, instantly
POST /v1/videos/generations
{
"model": "seedance-2-5",
"prompt": "a red fox running through snow at dawn",
"duration": 5,
"resolution": "720p"
}
202 Accepted
{ "id": "job_9f2c1a", "status": "queued", "credits_reserved": 210 }From request to result
Popcraft generation jobs run asynchronously. Submit a request, keep the returned job ID, and retrieve the result when the job completes.
1.Enable API access
Request API access for your organization. Once enabled, create an API key in the console and keep it on your server.
2.Submit a generation
Choose a model and supported settings, then submit a generation request. Save the returned job ID so your application can track the job.
3.Track the job
Use the documented status endpoint or configured webhook to track progress until the job reaches a terminal state.
4.Retrieve the result
Read the output from the completed job response and handle failed jobs explicitly. Check the reference for output URL availability and storage requirements.
Open the API reference in the console
Prepare a request
Keep your API key in your server environment. This shell example uses cURL and Python 3. Generate and save the idempotency value once for a logical request; retain it for retries. Do not rerun the key-generation command when recovering the same request.
export POPCRAFT_API_KEY="YOUR_API_KEY"
IDEMPOTENCY_KEY="$(python3 -c 'import uuid; print(uuid.uuid4())')"Check the current model catalog and its supported settings before submitting. This example uses nano-banana with a 1K square image; model access depends on your enabled organization and key.
curl --fail-with-body \
"https://api.popcraft.ai/v1/models?kind=image" \
-H "Authorization: Bearer $POPCRAFT_API_KEY"Submit the generation
Send the request with your API key and saved Idempotency-Key. An accepted submission returns HTTP 202. Save the returned id as your job ID.
curl --fail-with-body \
https://api.popcraft.ai/v1/images/generations \
-H "Authorization: Bearer $POPCRAFT_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
--data '{
"model": "nano-banana",
"prompt": "A red fox in fresh snow at dawn",
"resolution": "1K",
"aspect_ratio": "1:1"
}'The response examples illustrate the backend contract. Job IDs, timestamps, output URLs and credit figures are placeholders. Read the actual quote and values returned for your request.
Accepted response
{
"id": "job_0123456789abcdef0123456789abcdef",
"kind": "image",
"model": "nano-banana",
"created_at": 1794873600.1,
"credits_reserved": 6,
"status": "queued",
"finished_at": null,
"outputs": [],
"queue_position": 0
}Check the individual job
Replace JOB_ID with the ID from your accepted response. Poll this status endpoint until the job is terminal. A successful HTTP status request does not mean that generation itself succeeded.
JOB_ID="job_0123456789abcdef0123456789abcdef"
curl --fail-with-body \
"https://api.popcraft.ai/v1/generations/$JOB_ID" \
-H "Authorization: Bearer $POPCRAFT_API_KEY"The nonterminal states are queued, dispatching and processing. The terminal states are completed, failed and cancelled. A failed job is returned as HTTP 200 with status failed and an error object.
Completed status response
{
"id": "job_0123456789abcdef0123456789abcdef",
"kind": "image",
"model": "nano-banana",
"created_at": 1794873600.1,
"credits_reserved": 6,
"status": "completed",
"finished_at": 1794873620.5,
"outputs": [
{
"gcs_uri": "gs://example-output/job_example.png",
"url": "https://your-returned-output-url.example/result.png",
"filename": "result.png",
"duration": null
}
],
"batch_ai_job_id": "upstream_example",
"credits": {
"job_quote": 6
}
}Failed status response
{
"id": "job_0123456789abcdef0123456789abcdef",
"kind": "image",
"model": "nano-banana",
"created_at": 1794873600.1,
"credits_reserved": 6,
"status": "failed",
"finished_at": 1794873605.2,
"outputs": [],
"error": {
"code": "SUBMIT_ERROR",
"message": "We couldn't complete the generation due to a temporary issue on our end. Please retry in a moment. The job was not charged."
},
"credits": {
"job_quote": 6
}
}These status examples show the member-key credit fields. Organization-scope keys also receive the organization's credit summary. Inspect error.code when a job fails.
Retrieve and store the output
After status is completed, check that outputs contains a usable HTTP output URL. Replace OUTPUT_URL with the returned outputs[i].url, download each available result, and store a copy in your own storage. Do not assume a fixed URL expiry or permanent availability.
OUTPUT_URL="https://your-returned-output-url.example/result.png"
curl --fail --location "$OUTPUT_URL" --output result.pngReceive a completion webhook
Optionally include a public HTTPS webhook_url in the submission. Terminal events are generation.completed, generation.failed and generation.cancelled. Their data object contains the job result; status GET responses additionally include scope-dependent credits. Manage the signing secret in your organization API console.
Verify X-Popcraft-Signature before trusting the raw request body. It contains t=timestamp,v1=signature. The HMAC-SHA256 message is the exact timestamp, a literal dot and the unchanged raw body bytes. This receiver example rejects timestamps more than five minutes old and compares signatures in constant time.
import hashlib
import hmac
import re
import time
def verify_popcraft_webhook(raw_body, signature, secret):
try:
if not secret:
return False
parts = dict(part.strip().split("=", 1)
for part in signature.split(","))
timestamp = parts["t"]
supplied = parts["v1"].lower()
if not re.fullmatch(r"[0-9]+", timestamp):
return False
if not re.fullmatch(r"[0-9a-f]{64}", supplied):
return False
if abs(int(time.time()) - int(timestamp)) > 300:
return False
message = timestamp.encode("ascii") + b"." + raw_body
expected = hmac.new(secret.encode("utf-8"), message,
hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, supplied)
except (KeyError, ValueError, TypeError, AttributeError):
return FalseDeduplicate events using their id or X-Popcraft-Delivery header. Return a 2xx response after accepting the event durably. Delivery is at least once, so receiving the same event again must not repeat your application action.
After successive delivery failures, retries wait 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours, plus processing delays. Requests time out after five seconds and redirects are not followed. Delivery stops after six failed attempts; the API console provides delivery history and redelivery.
Handle retries without creating duplicate jobs
Keep the job ID returned by every accepted request. If a status check fails, retry the status check before submitting another generation. If submission times out before you receive a job ID, follow the documented recovery procedure rather than assuming the request failed.
Read the submission-timeout recovery procedure
Recover a submission timeout
- Keep the original request body, API key identity, Idempotency-Key and any returned job ID together.
- If the submission times out before an ID arrives, retry the same endpoint and unchanged body with the same API key and same Idempotency-Key. An existing job mapping returns the original job.
- If the API returns HTTP 409 CONFLICT, back off and retry the same logical request. Do not automatically create a new idempotency value. If the conflict persists without a job ID, contact support before resubmitting as a new request.
- Once an ID is known, resume polling that individual job. A polling timeout or connection loss does not establish that generation failed.
- Stop on completed, failed or cancelled. Download usable outputs only after completed. A deliberately new attempt after a confirmed terminal failure needs a new idempotency value.
Idempotency is scoped to the API key, not the organization. Do not reuse one value for different endpoints or bodies, or switch API keys during recovery.
Idempotency records have a 24-hour retry window and are removed by cleanup after that. Do not assume deduplication after the window. If the outcome is still unknown, resolve it with support before starting a new request.
Image
Text-to-image and reference-guided generation at production resolutions, from fast drafts to flagship quality.
Video
Cinematic text-to-video and image-to-video with explicit duration and resolution — priced per second, quoted up front.
Audio
Speech, sound effects, and music. Durations are explicit, so the credit quote is exact before a single frame is rendered.
Avatar
Drive a still portrait with audio or text-to-speech to produce a talking avatar video — one call, one clip.
Pricing
What the flagship models cost.
Estimated list price for one typical request. You pay only when a job succeeds — and enterprise contracts come in below list.
Seedance 2.5
≈ $2.10
per 5-second 720p clip
42 credits / sec
Veo 3.1
≈ $2.90
per 5-second 720p clip
58 credits / sec
Kling 3.0
≈ $0.90
per 5-second 720p clip
18 credits / sec
Hailuo 3
≈ $0.70
per 5-second 768P clip
14 credits / sec
Wan 3.0 Prime
≈ $0.70
per 5-second 720p clip
14 credits / sec
GPT Image 2.5
≈ $0.11
per 1K image
11 credits
Nano Banana Pro
≈ $0.20
per 1K image
20 credits
List price at $0.01 per credit, before any discount. Prices vary by resolution and length — the API console quotes every request exactly, and lists 34 more models.
Enterprise only · prices negotiable
Commit to volume. Get an offer below list.
The Popcraft API is sold to enterprise organisations only, and every contract is negotiated. Tell us roughly what you expect to generate each month and we will come back with a discounted offer — plus limits raised to your throughput and billing on invoice.
Volume discounts
Commit to monthly or annual volume and your rate drops below list — the bigger the commitment, the deeper the discount.
Limits set to your throughput
Concurrency, request rate, queue depth and per-model capacity are raised to the numbers your product needs.
Invoicing & net terms
Monthly invoicing with net terms and an SLA, plus a security review, DPA and a named engineer.
Built for production
The hard parts are already solved.
Generation is slow, bursty, and expensive to get wrong. The platform is engineered so one tenant's flood never delays another's single job.
Leak detection, built in
Every API key is watched for volume and velocity spikes and access from unfamiliar countries. Anything suspicious alerts the owner instantly — so a leaked key is caught in minutes, not on the invoice.
Provider limits, absorbed
Per-kind concurrency caps and per-model rate budgets keep you inside provider limits automatically. Backpressure is a clean 429, never a silent drop.
Durable by default
Every job is persisted the instant it's accepted. Deploys, restarts, and instance failures never lose a job or bill you twice.
Async from the first byte
Submit returns in milliseconds with a job id. Poll for state, or let a webhook push the result the moment it's ready.
Signed webhooks
Terminal events are delivered with an HMAC signature and retried on failure — so you can skip polling entirely and still never miss a result.
A live model catalog
Query available models, their capabilities, limits, and credit price at runtime. New models appear without a code change on your side.
Plans
Start on standard limits. Scale on a volume contract.
The API is for enterprise organisations only. Every enabled organisation starts on the standard limits and the list rates above. A volume contract lowers your rate and turns each limit into a number we set with you — concurrency first.
Enterprise · day one
Standard
Everything you need to build, launch and self-serve.
List price
from the price list · pay per successful job
- PricingList price per credit
- Concurrency10 image · 4 video · 6 audio · 2 avatar in-flight
- Request rate60 / min
- Queue depth50 waiting per kind
- DeliveryPoll or signed webhook
- Spend controlPer-key limits & org ceiling
When you scale · negotiated
Volume contract
The same platform, at your negotiated rate, with every limit turned up to your number.
Discounted offer
negotiated against committed volume
- PricingVolume discounts on committed spend
- ConcurrencyRaised to your throughput — name the number
- Rate & capacityHigher RPM · dedicated per-model budgets
- CommercialInvoicing · net terms · SLA
- AssuranceSecurity review · DPA · named engineer
- Spend controlCustom ceilings, still owner-controlled
Room to negotiate
Concurrency is yours to raise.
The Standard numbers are a floor, not a ceiling. On a volume contract, every one of these — how many jobs run at once, how fast you can call, how deep the queue goes — is set with you and applied per organisation. No code change and no new keys on your side.
| Dimension | Standard | On a volume contract |
|---|---|---|
| Image jobs in-flight | 10 concurrent | Contact us to raise |
| Video jobs in-flight | 4 concurrent | Contact us to raise |
| Audio jobs in-flight | 6 concurrent | Contact us to raise |
| Avatar jobs in-flight | 2 concurrent | Contact us to raise |
| Requests / min | 60 | Contact us to raise |
| Queue depth | 50 waiting per kind | Contact us to raise |
| Per-model capacity | Shared pool | Contact us for dedicated |
| Monthly credit ceiling | You set it | Contact us to raise |
These are real controls, applied per organization the moment your plan changes. Raising throughput is a conversation, not a migration.
Spend & safety
The owner holds every lever.
Handing a developer a key doesn't mean handing over the budget. The owner caps spend, watches every credit, and shuts down anything that looks wrong — without opening a ticket.
Cap the spend
Set a monthly ceiling for the whole organization and a credit limit on each key. Both are enforced at submit — an over-limit request is refused before it costs a single credit.
Catch abuse early
Every key is watched for volume and velocity spikes and calls from unfamiliar countries. The owner is alerted by email and in-console the moment a key looks leaked — revoke it in one click.
No surprise invoices
Failed, cancelled, and timed-out jobs are never billed. With caps and alerts on top, a leaked key simply cannot run up a bill you did not sign off on.
Billing
You pay for results, not attempts.
Credits are reserved when you submit and deducted only when a job completes. Failed, cancelled, and timed-out jobs cost nothing — so a refund is something you'll simply never need.
Exact quotes up front: every request is priced from the live catalog before it runs, and expected-leftover math on every status read means you always know what you can still afford.
The questions procurement asks.
Usage is metered in credits and charged against your organization's monthly cycle — one shared balance, not a separate wallet per developer. Every request is priced up front from the live catalog, and you're charged only when a job completes. Failed, cancelled, and timed-out jobs cost nothing.
Yes, at two levels: an organization ceiling per cycle and a per-key credit limit, so a single integration can't run away with the budget. Both are enforced at submit — an over-limit request is refused before it costs a credit. The owner controls both.
The console shows live usage by API key and by team member, with a recent jobs-and-charges ledger. Export a CSV statement by job or by model for any date range. Enterprise adds monthly invoicing with net terms.
Each model kind has an in-flight cap plus per-key caps and a bounded queue. A fair scheduler round-robins across keys, so one customer's burst of 200 jobs never starves another's single job. Extra work queues rather than failing — and on Enterprise the caps are raised to your throughput.
Requests are governed by per-key and per-organization rate buckets. The Default numbers are a floor; concurrency, request rate, queue depth, and per-model capacity are all per-organization overrides we apply instantly — no redeploy, no new keys.
You get a clean 429 with backpressure — never a silent drop. Jobs already accepted keep flowing through the queue; you pace new submissions or ask us to raise the ceiling.
Async. Submit returns in milliseconds with a job id. Then either poll the generation endpoint or let a signed webhook push the result the moment it's ready.
Terminal events carry an HMAC signature you verify against your per-organization secret, and are retried on failure. So you can skip polling entirely and still never miss a result.
Built-in abuse detection watches every key for volume and velocity spikes and activity from unfamiliar countries, and alerts your team by email and in-console the moment something looks off. Revoke in one click — and spend caps mean the blast radius is bounded even before you react.
Yes. Grant a member console access with self-scope — they manage only their own keys and see only their own usage, never org billing or other members' keys. Owners and admins see everything.
The API is enabled per organization. Your account manager switches it on and sets your limits; from there owners self-serve keys, docs, usage, and billing in the console. Most teams are calling production models the same day.
Yes. The prices on this page are list prices. Every enterprise contract is negotiated against committed volume, and a larger commitment gets a deeper discount. Tell us your expected monthly usage and we will send you an offer.
In credits, from the live rate card: video, audio and avatar per second of output (video also by resolution), images per image, and music tracks per track. The exact quote is reserved when you submit and charged only if the job completes.
Getting started
Access is granted per organization.
The API is available to enterprise organisations only. Once your organisation is enabled, owners and admins self-serve everything from the dashboard.
01
Get enabled
Your account manager enables API access for your organization and sets up your dedicated credit pool.
02
Mint keys, read the docs
Create scoped API keys for your developers from the console — and read the full interactive reference with copy-paste examples.
03
Ship it
Submit, poll, and render. Watch usage and billing update live in the console as your product generates.