PopNowAPI Docs
Build with the API
Main content

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

OpenPOST /api/v1/productions: quote with budgetUsd, then confirm with quoteId and an Idempotency-Key
Run tasksPOST /api/v1/jobs/createTask with productionId
FollowGET /api/v1/productions/{id} for the totals, GET /api/v1/productions/{id}/events for each charge
ListGET /api/v1/productions, the productions this API key opened
RaisePOST /api/v1/productions/{id}/budget: quote a new total, then confirm
ClosePOST /api/v1/productions/{id}/close
Over MCPopen_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.

Quote a budget
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"}'
Quote response
{
  "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:

Open it after approval
# 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\"}"
Open production (HTTP 201)
{
  "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"
    }
  }
}
  • budgetUsd is a USD decimal string above 0 and at most 10000, with up to nine decimal places. JSON numbers, exponent notation and unknown fields are rejected rather than converted.
  • The quoteId is valid for 30 minutes and opens one production. It is bound to the body: a different budget, title or project needs a new quote.
  • maxUsd is optional; if you send it, it must equal budgetUsd. currency is optional and can only be USD.
  • title takes up to 120 characters, project up to 128.
  • If the response is lost, retry with the same Idempotency-Key and body: you get the same production back, also with 201.

Run tasks inside it

Add productionId to an ordinary createTask request:

Create a task in the production
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:

Over the production budget
{
  "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

Read a production
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.

List its events
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.

kindamountUsd is
openedThe budget
call_submittedThe task's hold
call_settledThe task's final charge
call_refundedA refund
budget_raisedThe increase
closed, expired0

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:

Quote a new total
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"}'
Quote response
{
  "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"
  }
}
Raise it after approval
# 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

Close a production
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

endedByWhen
agentYou closed it through this API or the developer MCP
userIt was closed in the console
idle24 hours passed without activity (opening, a task submission or a raise)
lifetime7 days passed since it opened
adminPopNow 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.

ToolWhat it doesParameters
open_productionQuotes, then opens with the approved budgetbudget_usd, title, project; to confirm: max_usd, quote_id, idempotency_key
get_productionReads totals and recent activityproduction_id, events_after, limit
list_productionsLists productions opened with this keystate, limit, cursor
raise_production_budgetQuotes, then raises the totalproduction_id, budget_usd; to confirm: max_usd, quote_id
close_productionCloses itproduction_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.reasonHTTPMeaning
production_not_found404The production does not exist or another key opened it
production_closed409It was closed; open a new one
production_expired409It ended after 24 hours idle or 7 days; open a new one
production_budget_exceeded402The task's hold is more than the production has left (code 40202)
production_budget_invalid400The budget is not a positive USD amount up to 10000, or not above the current total
production_currency400Productions on this API are USD only
production_limit40920 productions are already open; close one first
production_confirmation400 / 409The 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.

On this page