Generate images and videos from an agent
This guide gives Codex, Claude Code, and other shell-capable agents a deterministic Wizzx workflow. You provide one API key and a natural-language generation request; the agent validates a model-specific payload, submits one asynchronous task, saves the returned Task ID, and polls that task until it finishes. No SDK is required. All examples usehttps://api.wizzx.ai.
AI-readable documentation entrypoints
Give an agent the smallest useful source first. Use the index to discover a page, the Markdown page for readable model guidance, the OpenAPI document for exact fields, and/pricing for live availability and credit tiers.
llms.txt is a discovery index, not proof that a model is currently public or that an old price is still valid. Confirm availability and pricing with GET /pricing, then use OpenAPI and the selected model page to construct the payload.Prerequisites
- A Wizzx API key with enough credits.
- An agent session allowed to make HTTPS requests.
- Public HTTP(S) URLs for reference images. A local path or base64 value is not an
image_urlsvalue.
Give the key to the agent session
Keep the key in an environment variable instead of source code, a prompt transcript, or a committed.env file.
WIZZX_API_KEY without printing it.
Copyable agent instruction
You can paste the following instruction into an agent or use it as the body of a reusable project skill.Endpoints
Use
gpt-image-2 as the general image preset and veo3 as the general video preset only while each key appears in /pricing. If the user names another model, read that model’s API reference and do not reuse a preset schema.
Use
/pricing for current credit tiers, then restrict selection to models published in these docs. Compatibility-only backend keys are not public choices. Do not keep a price copied from an old agent conversation.Request schemas
These strict schemas prevent the agent from inventing fields. Omit optional fields that the user did not request. Reference images must be public HTTP(S) URLs.Parameter construction rules
Image payload
POST /api/v1/task/submit/gpt-image-2.
Video payload
POST /api/v1/task/submit/veo3.
Submit once and capture the Task ID
data.task_id, not a provider task identifier. Treat credits_deducted as the amount reserved for this task.
Poll by Task ID
A practical polling schedule is 5 seconds, then 10, 20, and at most 30 seconds between queries. If the agent reaches its time limit, the server task keeps running; return the Task ID and resume the status request later.
Error and retry rules
Errors use a different envelope:
The run is complete only when the agent returns result URLs for
SUCCEEDED, explains a terminal FAILED, reports REVIEW_REQUIRED, or hands back a Task ID that can be polled later.
For more model-specific options, see Nano Banana 2, Seedance 1.5 Pro, and the API reference navigation.