Generate a file
Make an image, a video, a voice track or a 3D asset for a price in credits shown before it starts.
A generation runs one job on the provider configured by the operator and charges it once, when its file is stored (Metering and settlement). You need credits that cover its estimate, or a wallet with USDC to pay over x402 instead.
#Prices and options
| Kind | Credits | Per | In dollars |
|---|---|---|---|
| Image | 40 | image | $0.040 |
| Video | 100 | output second | $0.100 |
| Voice | 15 | 1,000 characters | $0.015 |
| 3D asset | 200 | 3D asset | $0.200 |
A 5-second video costs 500 credits, $0.50. Voice is counted per character, 0.015 credits each, so 2,500 characters cost 37.5 credits.
| Kind | Options |
|---|---|
| Image | width and height 256 to 2048, count 1 to 4, format png or webp |
| Video | outputSeconds 1 to 60, required; aspectRatio 16:9, 9:16 or 1:1; format mp4 or webm |
| Voice | the text to speak, up to 4,096 characters per request; voice; format mp3 or wav |
| 3D asset | format glb or usdz; style |
The full request shapes are under GenerationRequest.
#Generate
App
Pick the kind
Open Create and pick the Kind: image, video, voice or 3D asset.
Write the prompt
Write the prompt, or for voice the text, and set the options. The cost in credits updates as you type.
Generate
Press Generate. The job runs in Results with its progress.
Get the file
When it is done, download the file from Results; its receipt links from it.
SDK
const estimate = await shader.estimate({ kind: 'image', prompt: 'a lighthouse at dusk' })
const job = await shader.generate({ kind: 'image', prompt: 'a lighthouse at dusk' })
const done = await shader.waitForJob(job.id)done.result holds the file's URL, type and size, and done.receipt its receipt.
CLI
shader estimate image "a lighthouse at dusk"
shader generate image "a lighthouse at dusk" --out lighthouse.pnggenerate waits for the job and saves the file to --out. --seconds sets a video's length and --voice the voice.
MCP
Call generate with kind, prompt and options, then get_job until it is done. A video without outputSeconds runs for 4 seconds.
#What happened
Admission
The API checked that your available credits cover the estimate and, for an agent, the key's caps.
Reservation
It reserved the estimate against other work while the job ran.
The job
The job ran on the provider configured by the operator, from
queuedtorunningtodone.Settlement
Once the file was stored, the backend settled the job in one line of kind
generation.
#The receipt
One generation receipt per job, with the job's units (images, output seconds, characters or assets) and the credits charged.
#If it fails
| What you see | Why | Next |
|---|---|---|
failed, "Not charged." | The provider did not produce a file | Nothing was charged. Generate again |
CREDITS_TOO_LOW | Available credits do not cover the estimate | Deposit |
AGENT_CAP_EXCEEDED, AGENT_DAILY_CAP_EXCEEDED | The estimate is above the key's per-request cap or what is left of its day | Make the job smaller or raise the cap |
CONFIGURATION_REQUIRED | No provider is configured for this kind | The operator configures one |
VALIDATION_ERROR | An option is out of range | Fix the field the error names |