Productions
Approve one USD budget for a piece of work, run every task inside it and close it when done. Open and raise in two steps, follow every charge.
A production is one piece of work with one USD budget approved up front: a launch video with a dozen shots, a set of product photos, an agent's whole job. Open it with a quote and a confirmation, then pass its id as productionId to createTask. Each task's hold also counts against the production, so the work can never spend past the approved total, and your agent does not need a new approval for every call while the budget lasts.
Opening a production holds and charges nothing. Every task is still held and billed on your PopNow balance in USD, exactly as without a production; the production only caps their total and keeps a record of each charge.
At a glance
| Open | POST /api/v1/productions: quote with budgetUsd, then confirm with quoteId and an Idempotency-Key |
| Run tasks | POST /api/v1/jobs/createTask with productionId |
| Follow | GET /api/v1/productions/{id} for the totals, GET /api/v1/productions/{id}/events for each charge |
| List | GET /api/v1/productions, the productions this API key opened |
| Raise | POST /api/v1/productions/{id}/budget: quote a new total, then confirm |
| Close | POST /api/v1/productions/{id}/close |
| Over MCP | open_production, get_production, list_productions, raise_production_budget, close_production and production_id on paid tools of the developer MCP |
Open a production
First send the budget without quoteId. This is only a quote: nothing is opened or held, and it needs no Idempotency-Key.
curl https://api.popnow.ai/api/v1/productions \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"budgetUsd":"10","title":"Spring launch reel","project":"campaign-2026-q4"}'{
"code": 200,
"msg": "success",
"data": {
"needsConfirmation": true,
"currency": "USD",
"quoteId": "quote_from_server",
"expiresAt": "2026-11-24T17:36:10Z",
"budgetUsd": "10",
"availableUsd": "42.5"
}
}availableUsd is your available balance now; a budget above it returns 402 with code 40201. Show the budget to whoever approves the spending. Once they agree, send the same body with the quoteId and an Idempotency-Key:
# Set QUOTE_ID to the quoteId returned above, after the budget is approved.
curl https://api.popnow.ai/api/v1/productions \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d "{\"budgetUsd\":\"10\",\"title\":\"Spring launch reel\",\"project\":\"campaign-2026-q4\",\"quoteId\":\"$QUOTE_ID\"}"{
"code": 200,
"msg": "success",
"data": {
"needsConfirmation": false,
"production": {
"id": "prod_01jbr2k8m4n6p8q0s2t4v6x8z0",
"title": "Spring launch reel",
"project": "campaign-2026-q4",
"state": "open",
"currency": "USD",
"budgetUsd": "10",
"spentUsd": "0",
"reservedUsd": "0",
"remainingUsd": "10",
"createdAt": "2026-11-24T17:06:10Z",
"lastActivityAt": "2026-11-24T17:06:10Z",
"idleExpiresAt": "2026-11-25T17:06:10Z",
"expiresAt": "2026-12-01T17:06:10Z"
}
}
}budgetUsdis a USD decimal string above 0 and at most10000, with up to nine decimal places. JSON numbers, exponent notation and unknown fields are rejected rather than converted.- The
quoteIdis valid for 30 minutes and opens one production. It is bound to the body: a different budget, title or project needs a new quote. maxUsdis optional; if you send it, it must equalbudgetUsd.currencyis optional and can only beUSD.titletakes up to 120 characters,projectup to 128.- If the response is lost, retry with the same
Idempotency-Keyand body: you get the same production back, also with201.
Run tasks inside it
Add productionId to an ordinary createTask request:
curl https://api.popnow.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"model":"google/nano-banana-2.1/text-to-image","input":{"prompt":"A red bicycle leaning on a sunlit brick wall"},"productionId":"prod_01jbr2k8m4n6p8q0s2t4v6x8z0"}'While the task runs, its hold is in the production's reservedUsd. When it settles, the final charge moves to spentUsd and the unused part of the hold is released; refunds come back the same way. remainingUsd is budgetUsd minus both.
If a task's hold is larger than remainingUsd, createTask returns 402 with code 40202 and nothing is held:
{
"code": 40202,
"msg": "Production budget exceeded",
"data": {
"reason": "production_budget_exceeded",
"budgetUsd": "10",
"spentUsd": "9.5",
"reservedUsd": "0.4",
"remainingUsd": "0.1"
},
"request_id": "req_01jbr3a5c7e9g1j3l5n7q9s1u3"
}Ask whoever approved the budget to raise it, or finish the work. The usual balance and spend-cap checks still apply to each task. Replaying a task's original Idempotency-Key returns that task even after the production has ended; a key that already created a task outside this production returns 409.
Follow and list
curl https://api.popnow.ai/api/v1/productions/prod_01jbr2k8m4n6p8q0s2t4v6x8z0 \
-H "Authorization: Bearer $POPNOW_API_KEY"The response has the same fields as the open production above. Once it has ended it also has endedBy and endedAt. Reading does not count as activity.
curl "https://api.popnow.ai/api/v1/productions/prod_01jbr2k8m4n6p8q0s2t4v6x8z0/events?limit=50" \
-H "Authorization: Bearer $POPNOW_API_KEY"Events come oldest first. Each has kind, the amountUsd it moved and the totals after it (budgetAfterUsd, spentAfterUsd, reservedAfterUsd); task events add taskId and tool.
kind | amountUsd is |
|---|---|
opened | The budget |
call_submitted | The task's hold |
call_settled | The task's final charge |
call_refunded | A refund |
budget_raised | The increase |
closed, expired | 0 |
For the next page, pass the last event's id (also returned as nextCursor) as after. limit is 1–200, default 50.
GET /api/v1/productions lists the productions this key opened, newest first. Filter with state (open, closed or expired), page with limit (1–100, default 20) and cursor (the previous page's nextCursor).
Raise the budget
budgetUsd here is the new total, not an increase, and must be above the current total. Quote first, then confirm with the quoteId and an Idempotency-Key:
curl https://api.popnow.ai/api/v1/productions/prod_01jbr2k8m4n6p8q0s2t4v6x8z0/budget \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"budgetUsd":"25"}'{
"code": 200,
"msg": "success",
"data": {
"needsConfirmation": true,
"currency": "USD",
"quoteId": "quote_from_server",
"expiresAt": "2026-11-24T17:45:00Z",
"currentBudgetUsd": "10",
"newBudgetUsd": "25",
"availableUsd": "42.5"
}
}# Set QUOTE_ID to the quoteId returned above, after the new total is approved.
curl https://api.popnow.ai/api/v1/productions/prod_01jbr2k8m4n6p8q0s2t4v6x8z0/budget \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d "{\"budgetUsd\":\"25\",\"quoteId\":\"$QUOTE_ID\"}"The confirmation returns needsConfirmation: false and the updated production. Repeating a confirmed quoteId returns the production again without raising twice. A quote is tied to the total it was issued against: if the budget changed in the meantime, you get 409 and need a new quote. Your available balance must cover the new total minus what is already spent and held. Raising counts as activity but does not extend the 7-day limit.
Close it
curl https://api.popnow.ai/api/v1/productions/prod_01jbr2k8m4n6p8q0s2t4v6x8z0/close \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'The response is the production with state: "closed" and endedBy: "agent". Tasks that are already running finish and settle as usual; new tasks with this productionId return 409. Closing an already closed production returns it unchanged.
How long a production lasts
endedBy | When |
|---|---|
agent | You closed it through this API or the developer MCP |
user | It was closed in the console |
idle | 24 hours passed without activity (opening, a task submission or a raise) |
lifetime | 7 days passed since it opened |
admin | PopNow support closed it |
idleExpiresAt and expiresAt show both limits. A production past either limit reads expired right away. At most 20 productions can be open at once per account.
Keys and scope
Productions take personal API keys only; a team key gets 403. Only the key that opened a production can read it, spend from it, raise it or close it. Another key on the same account gets 404, so treat a production id like part of that key's state. A read-only key can list and read but not open, raise or close. An older key that belongs to no workspace gets 400; create a new key in the API console.
Productions you open on the developer MCP with the same key are the same productions: they appear in this API, and their ids work in createTask.
Over the developer MCP
Connect the developer MCP and ask your agent to plan the work under one budget. The same key, USD balance and rules apply as on REST.
| Tool | What it does | Parameters |
|---|---|---|
open_production | Quotes, then opens with the approved budget | budget_usd, title, project; to confirm: max_usd, quote_id, idempotency_key |
get_production | Reads totals and recent activity | production_id, events_after, limit |
list_productions | Lists productions opened with this key | state, limit, cursor |
raise_production_budget | Quotes, then raises the total | production_id, budget_usd; to confirm: max_usd, quote_id |
close_production | Closes it | production_id |
Paid single-task tools such as create_image, create_video and create_task take production_id. With it they need no max_usd while the budget lasts; when it runs out, they ask for a raise instead of running. Batches and recipes do not take production_id yet.
Errors
Production failures add a machine-readable data.reason to the usual error envelope. A 404 without data means productions are not available on this account.
data.reason | HTTP | Meaning |
|---|---|---|
production_not_found | 404 | The production does not exist or another key opened it |
production_closed | 409 | It was closed; open a new one |
production_expired | 409 | It ended after 24 hours idle or 7 days; open a new one |
production_budget_exceeded | 402 | The task's hold is more than the production has left (code 40202) |
production_budget_invalid | 400 | The budget is not a positive USD amount up to 10000, or not above the current total |
production_currency | 400 | Productions on this API are USD only |
production_limit | 409 | 20 productions are already open; close one first |
production_confirmation | 400 / 409 | The quoteId does not match the request (400), or expired or was already used (409); request a new quote |
Does opening a production set money aside?
No. Opening checks that your balance covers the budget and holds nothing. Each task is held and billed on your balance when it runs, as usual; the production stops the work from going past the approved total.
What happens to unused budget?
Nothing, because it was never held. Close the production when the work is done, or let it end after 24 hours without activity.
Can I use a production with batches or recipes?
Not yet. Pass productionId to createTask, or production_id to single-task tools on the developer MCP.
Related
Assets and LoRA files
Keep files in your asset library and reuse them by URI, read your characters, and bring your own LoRA weights.
Chat models
Call Claude, Gemini, DeepSeek, GLM, Grok and Kimi through the PopNow API with the OpenAI, Anthropic or Gemini SDK you already use. One API key, priced per token in USD.

