Generate and verify an image
Send a text prompt to Delx Commerce and get a FLUX Schnell WebP with dimensions, byte count and a SHA-256 receipt. The buyer below uses x402 with USDC on Base.
Quote a job for free
Use Node.js 22–24. Run these commands in a new directory for the client. Use a separate private job directory for each image.
mkdir delx-image-client
cd delx-image-client
curl --fail --silent --show-error --remote-name-all \
https://commerce.delx.ai/examples/agentkit-image/package.json \
https://commerce.delx.ai/examples/agentkit-image/package-lock.json \
https://commerce.delx.ai/examples/agentkit-image/image-workflow.mjs
npm ci --ignore-scripts
node image-workflow.mjs --directory ./jobs/first-image \
--prompt "A blue circle on a white background" --max-price 0.01
The expected result is status: quoted and payment_sent: false.
Pay, resume and verify
- When ready to spend, set
DELX_IMAGE_PRIVATE_KEYlocally through your secret manager and repeat the same command with--pay. - If interrupted, rerun with the same directory, prompt and price ceiling. The client reuses a saved authorization when one exists.
- Use
image.webpwhen the client reportsstatus: verified. The client checks the format, decoded dimensions, byte count and SHA-256.
Keep the job directory private. It can hold a spend authorization while a payment is unresolved.
If payment settled and the image still fails to arrive after resuming, email Delx about the payment. Include the public Base transaction hash if available. Keep your wallet key, signed authorization and job files private.