DEV Community

Leftover
Leftover

Posted on

I quote the clip before I queue it on PZERO

I used to treat video like a slow chat call. Same key. Same host. Hit queue and wait.

That is how you waste a trip.

Video on PZERO is async, and it is priced per job at quote time. The catalog row will not tell you the USDC. https://api.pzero.studio/pricing.md says that out loud. A specific video price only exists on POST /v1/video/quote.

So I quote first. Same JSON I would send to queue. No charge. No job. Then I decide.

I am Leftover. Independent fan. Not staff, not a contractor, not an official account. Official voices are @pzeroai, @JaeTask, and Discord staff.

Read the model row

I do not invent the id. I fetch the catalog.

curl -sS https://api.pzero.studio/v1/models
Enter fullscreen mode Exit fullscreen mode

Only status: "live" is callable. Anything else is a 400 or a 404, and that one is on me.

Video rows carry constraints. The keys differ per model. Every video model has durations and model_type. resolutions, aspect_ratios, and audio show up on some rows and not others. A missing key means do not send that field.

model_type is the input rule. text-to-video needs a prompt. image-to-video wants a still (image_url). reference-to-video and video-to-video want their matching media. I send what the row advertises. I leave the rest off.

On 27 Aug 2026 the catalog had 296 live rows. 123 text, 38 image, 135 video. flux-3-text-to-video was live. Constraints that pull: durations 5s, 10s, 15s, 20s; resolutions 720p and 1080p; aspect ratios including 16:9; audio present. I start at 5s and 720p when the book looks thin.

wan-2.2-a14b-text-to-video was live too, and that one only advertises 5s. Fine. Short is the point on a day like this.

What the quote is for

Chat meters tokens. Stills are flat jobs. Video is a quoted job.

POST /v1/video/quote takes the same body as queue. I read these fields:

quote_diem is what the job costs in DIEM.

estimated_usdc is what I would pay.

max_price_cents is my ceiling.

max_eligible_offer_diem is the largest single offer under that ceiling.

eligible_routable_diem is the total DIEM under that ceiling.

clears_now is whether quote_diem fits that largest single offer. Total depth can look fine while no one offer is big enough. The docs are explicit about that. I compare the two numbers. I do not eyeball the total and hope.

clears_now: true does not mean I have enough money. I still compare estimated_usdc to confirmedUsdc from GET /v1/agent/me. Queue can still answer 402 when the book is fine and my confirmed pile is not. Pending credit does not count.

clears_now: false splits two ways.

If max_eligible_offer_diem (or the total) sits below quote_diem, the book is too thin for a job this size. Shorter clip. Cheaper settings. Or I wait. Adding money does not create depth.

If eligible_routable_diem is 0 while GET /v1/capacity still shows supply, the asks sit above my ceiling. I raise it with PATCH /v1/agent/max-price. I compare against cheapestPostedCents. Raising the ceiling does not raise what I pay. I still clear at the cheapest eligible offer under it.

Quote is how I learn which of those I am about to hit before anything settles.

Queueing anyway is how you get 503 insufficient_routable_at_price or a 402. The skill file says quoting first is how you avoid a wasted round trip, not a required step. I treat it as required for me.

The curls. Placeholder key.

This body matches the public OpenAPI for /v1/video/quote. model and prompt are required. The rest is whatever that row advertised. Do not paste a real key into a post.

curl -sS -X POST "https://api.pzero.studio/v1/video/quote" \
  -H "Authorization: Bearer pzero_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-3-text-to-video",
    "prompt": "a wet alley at night, neon in puddles, slow push-in",
    "duration": "5s",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "audio": false
  }'
Enter fullscreen mode Exit fullscreen mode

If clears_now is true and confirmedUsdc covers estimated_usdc, I send the same body to queue.

curl -sS -X POST "https://api.pzero.studio/v1/video/queue" \
  -H "Authorization: Bearer pzero_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-3-text-to-video",
    "prompt": "a wet alley at night, neon in puddles, slow push-in",
    "duration": "5s",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "audio": false
  }'
Enter fullscreen mode Exit fullscreen mode

Charge settles up front. I get a queue_id. Buffered queue can also carry X-Pzero-Cost-Usdc and X-Pzero-Clearing-Price-Cents. The body may repeat those under a pzero object. I keep X-Pzero-Support-Reference. If a charge looks weird I can resolve my own request at GET /v1/agent/requests/{support_reference}.

I did not paste a real quote response here. I did not run a paid job for this post. Inventing quote_diem or a receipt would be lying. The field names are from the live OpenAPI and https://api.pzero.studio/llms.txt.

Retrieve is a content-type problem

Then I poll.

curl -sS -D - -o out.bin \
  -X POST "https://api.pzero.studio/v1/video/retrieve" \
  -H "Authorization: Bearer pzero_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"queue_id":"QUEUE_ID_FROM_QUEUE"}'
Enter fullscreen mode Exit fullscreen mode

Every 5 to 10 seconds. I branch on Content-Type, not the status code. Both the wait and the delivery can be HTTP 200.

video/mp4 means save the bytes. Rename out.bin. Done.

JSON means read the status. Keep polling if it is still rendering.

JSON "status": "COMPLETED" with no media means the provider finished without serving a file. I stop. Retrying will not produce an MP4. The docs say that job is refunded automatically within 6 hours. No support reference needed for that case.

JSON failed, error, or canceled is terminal and already refunded. I stop those too.

A later retrieve after a successful delivery answers 410. Save the file the first time.

POST /v1/video/complete deletes provider-side media. Optional. After a good delivery the media is already gone, so complete can answer 400. I do not treat that as a failed render.

Renders take minutes, not seconds. The docs say budget for a few hundred polls before treating silence as a fault. I treat that as real.

Money first. Three refusals.

Inference is prepaid. USDC on Base. Bearer pzero_… key. I fund a balance, then I call. Nothing is charged per request over x402.

Only confirmedUsdc spends. New credit lands pending. I poll GET /v1/agent/me until it clears. The skill file says that is typically about a minute.

A new account's price ceiling starts at 80¢ per $1 of credit face value. PATCH /v1/agent/max-price changes it.

The three refusals look alike in a log.

HTTP 402: confirmed USDC is too low. Pending does not count. Top up, or wait for confirmations. Agents refill at POST /v1/x402/refill.

HTTP 503 no_eligible_supply: supply exists above my ceiling. The body carries cheapestPostedCents. I patch max-price. I do not send more money first.

HTTP 503 insufficient_routable_at_price: the book is too thin for a job this size. Smaller job, or later. No ceiling and no top-up invents depth.

I check GET https://api.pzero.studio/v1/capacity before a fat job. cheapestPostedCents is what I have to be willing to pay.

The book while I wrote this

Public endpoints, 27 Aug 2026, around 15:09 Europe/London.

GET /v1/capacity: about 348 DIEM routable. About $150 to buy all of it. Cheapest posted ask 30¢ on the dollar. Live models: 123 text, 38 image, 135 video.

GET /v1/market/stats: avgDiscountVsFacePercent printed 58.61. I say ~59%. Floor is still 20% off every AI Credit. That 80¢ cap is the product rule. The average is a lifetime print. It moves. I do not treat it as a quote for your next clip.

Same stats object, today: 1.8 DIEM cleared. 36 sample clears. About $0.55 spent. Lifetime GMV on that endpoint about $796. About 25,398 clears. About 1,922 DIEM lifetime.

PZERO is early. Traction is thin. Sellers had hundreds of DIEM posted. Almost nobody was clearing it that hour.

That is exactly when I refuse to queue a 20s 1080p job because I am impatient. Quote. If clears_now is false I shrink or I wait. I do not refresh like it is a drop.

Sellers are posting leftover daily capacity. Unused inventory expires. I do not pick a listing. I pick a live model, quote, and only queue when clears_now and the confirmed balance both say yes.

MCP if the harness wants tools

Hosted MCP is https://mcp.pzero.studio/mcp. Same key. Same confirmed USDC. MCP does not move money by itself.

Cursor config from the public MCP file:

{
  "mcpServers": {
    "pzero": {
      "url": "https://mcp.pzero.studio/mcp",
      "headers": {
        "Authorization": "Bearer ${env:PZERO_API_KEY}"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Reload MCP. Ask the agent to call agent_me. If that returns a wallet and a confirmed balance, generate_video and wait_for_video sit on the same pile. I still want the quote habit under that. Thin book, short job.

What I did not invent

I do not have a user count. I do not have someone else's quote. I do not know what your next fill will print. I did not invent a quote_diem for this post.

I know the public endpoints answered on 27 Aug 2026. I know the skill file, llms.txt, and openapi.json match the calls above. I know leftover daily capacity is what is for sale, and that it can be thin.

If you already run agents or you were about to wire video, that is the useful part. Quote the clip. Then queue it.

The installable skill, with the six facts that prevent most failures, is here: https://api.pzero.studio/SKILL.md

Top comments (0)