Pay for one generation with this request (Machine Payments Protocol, HTTP 402) — no credits

Changed on

The first call quotes one job and returns 402: the body names job_id, model and amount; WWW-Authenticate: Payment carries a challenge bound to that job. Pay it (card through a Stripe Link agent wallet; USDC is accepted for credit top-ups, not here yet) and send the same request again with Authorization: Payment <credential>; that runs exactly that job. An image is returned in the response; a video starts and is polled at GET /v1/jobs/{job_id} (the same id). Price: the credits price for the job, at least $0.50 (card minimum), at most $50. A job that fails after payment is refunded. Send the Varosity key as X-API-Key. Media-driven models (length set by supplied audio/video) are not offered here.

post/v1/pay/generate

Request

  • Base URL: https://varosity.ai/api
  • URL: https://varosity.ai/api/v1/pay/generate
  • Auth: API key in header X-API-Key

Request body

type'image' | 'video' required
modelstring required
promptstring required
aspectRatio'16:9' | '9:16' | '1:1' | '4:5' | '21:9'
durationSecinteger
referenceImageUrlstring uri

Response

Paid: { job_id, status (succeeded | running), output_url, poll_url (video), amount_cents, payment_reference } plus a Payment-Receipt header

Changes

    • info

      the endpoint scheme security apiKeyHeader was added to the API

    • info

      added the non-success response with the status