Skip to main content

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 use https://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_urls value.
Image and video submission spends credits. A request such as “plan,” “draft,” or “estimate” does not authorize submission. A request such as “generate” or “create now” authorizes one submission. If a required choice can materially change the price, the agent must show the final model, parameters, and current estimate before asking for confirmation.

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.
Start Codex or Claude Code from the same shell. The agent should read 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.
The schemas above are the recommended general-purpose presets. Machine-readable request schemas for every publicly documented model are available in the API reference, including both Seedance models, Seedance 2.0 Mini, Kling AI, Kling v3, Kling v3 Omni, PixVerse V6, Grok Imagine Video 1.5, Gemini Omni Flash, Wan 2.6 Flash, Seedream 4/4.5, Seedream 5.0 Pro, all public Nano Banana variants, GPT Image 2, GPT Image 2.5, Qwen Image 2.0 / 2.0 Pro, and Suno.

Parameter construction rules

Image payload

Submit it to POST /api/v1/task/submit/gpt-image-2.

Video payload

Submit it to POST /api/v1/task/submit/veo3.

Submit once and capture the Task ID

A successful submit response uses this envelope:
The client must read 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.