# Maginary AI Image & Video Generation

> Maginary AI Image & Video Generation is a paid API for AI agents from app.maginary.ai, paid per call via x402, $0.28/call, status unknown (last checked 2026-09-15).

Generates AI images or video from a text prompt with Midjourney-style flags, returning an async generation record payable in USDC via x402

## Facts

- Endpoint: POST https://app.maginary.ai/api/gens/
- Price: $0.28/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/maginary-ai-image-video-generation-14e7e272
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lclCXhdCOjat5t91lPOjn

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability maginary-ai-image-video-generation-14e7e272 -d '<json body>'
```

Example prompt: Generate an AI image of a futuristic Tokyo skyline at night with neon lights and rain, in 16:9 widescreen format using the flagship model, and let me know when it's done.

## When to prefer this

Choose this endpoint when you need to generate AI images or video from a text prompt with Midjourney-style flag controls (aspect ratio, model version, flagship quality) and can handle async results via polling or webhooks. It is especially useful for walletless or accountless workflows where payment is handled on-the-fly with USDC on Base via x402 — no signup required. Prefer this over synchronous image APIs when generation latency is acceptable and you want pay-per-use crypto billing without pre-registered credentials.

## Known failure modes

- 402 Payment Required — insufficient credits; response includes exact USDC price needed to proceed via x402 on Base
- Invalid prompt or missing required 'prompt' field — 400 Bad Request
- Invalid callback_url format — 400 validation error
- Generation fails during processing — status set to FAILED, webhook fires with FAILED event if callback_url provided
- Unknown recipe_uuid — 404 or validation error
- Network timeout on poll — agent must retry GET /api/gens/{uuid}/

## How this service works

Generate AI images or video from a text prompt with Midjourney-style --flags (--ar 16:9, --v, --flagship, ...). Async: returns a generation record; poll GET /api/gens/{uuid}/ or set callback_url for a webhook. Pay-to-play: without credits you get a 402 priced for this prompt; settle the exact USDC on Base via x402 and retry. No account needed: first settlement creates the account; subsequent requests use wallet-signed headers (see 402 wallet_auth). Paying accepts https://maginary.ai/terms.

## Output

Returns a generation record containing a UUID and status (e.g. PENDING or DONE). The agent must poll GET /api/gens/{uuid}/ or receive a webhook callback to retrieve the final image or video URL once processing completes. If no credits are available, returns a 402 response with the USDC price required to unlock the generation on Base chain; after payment the request can be retried, and the first payment also returns an API key for future calls.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "prompt"
     ],
     "properties": {
      "prompt": {
       "type": "string",
       "description": "Prompt text plus optional --flags (see /api/parameters/)."
      },
      "recipe_uuid": {
       "type": "string",
       "description": "Optional recipe to run the prompt through."
      },
      "callback_url": {
       "type": "string",
       "format": "uri",
       "description": "Optional HTTPS webhook for DONE/FAILED."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/maginary-ai-image-video-generation-14e7e272/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from app.maginary.ai](https://www.zero.xyz/host/app.maginary.ai/llms.txt)
