REST and MCP, one key

Make animated Shorts from your own code or agent.

The Toonyx API writes a video from an idea, prices it, makes it on your word and hands you the file. Every tool the Toonyx agent has is also an MCP server your agent can plug into, with the same plan, credits and approval rules as the app.

Quick start

The base URL is https://api.toonyx.com/v1. Sign in to the dashboard with your Toonyx account and make a key, then:

1. Write a Short from an idea

curl https://api.toonyx.com/v1/shorts \
  -H "Authorization: Bearer $TOONYX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"idea": "A banana and a lemon open rival juice stands on the same street"}'

Writing is free. You get back the video with its id, its script and credits_estimate, the price of making it.

2. Get the price, then make it

curl -X POST https://api.toonyx.com/v1/videos/VIDEO_ID/make \
  -H "Authorization: Bearer $TOONYX_KEY"
# {"needs_approval": true, "quote": {"credits": 36, "credits_left": 1264, ...}, "approve": "apv_..."}

curl -X POST https://api.toonyx.com/v1/videos/VIDEO_ID/make \
  -H "Authorization: Bearer $TOONYX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"approve": "apv_..."}'

3. Poll, then download

curl https://api.toonyx.com/v1/videos/VIDEO_ID -H "Authorization: Bearer $TOONYX_KEY"
# status: queued, rendering (with stage, scene and scene_of), then ready

curl -L -o short.mp4 https://api.toonyx.com/v1/videos/VIDEO_ID/download \
  -H "Authorization: Bearer $TOONYX_KEY"

Keys and scopes

Send your key on every call as Authorization: Bearer nyk_.... A key acts as the account that made it: your plan, your credits, your videos, your connected TikTok and YouTube. Nothing more.

  • full keys can do everything your account can do in the app.
  • read keys only read: GET routes and read tools. Anything else answers 403 read_only_key.
  • A key is shown once, when you make it. Toonyx keeps only a hash of it, so a lost key cannot be shown again: revoke it and make a new one.
  • Make and revoke keys in the dashboard, signed in with your Toonyx account; it also shows each key's calls, what it was approved to do and the credits its videos were charged. A key cannot make more keys. Up to 10 live keys per account.

Admin accounts are not billed. On a Toonyx team account the credit balance reads 0 and billed is false, and everything still runs. On a customer account the balance is the real one.

Quote, then approve

Nothing that spends credits, posts in public or changes settings runs on a first call. The first call answers with what it would do, the price where there is one, and an approve token:

{
  "ok": false,
  "needs_approval": true,
  "quote": {"credits": 36, "credits_left": 1264, "billed": true},
  "approve": "apv_6v0Qn...",
  "expires_in": 1800,
  "next": "Nothing was spent, posted or changed. Show this to your user. Only on their yes, call make_video again with the same arguments and approve set to this token."
}

Make the same call again with approve set to that token. The token is bound to your key, that tool, those exact arguments and that price. It works once and lasts 30 minutes. If the price changes in between, the token stops matching and you get a fresh quote. If you build an agent on this, have it show the quote to its user and only send the token on their yes.

Endpoints

Every response is JSON (except downloads). Every route needs a key except /v1/pricing.

GET/v1/meread

Your account, this key's id and scope, your credits and your rate limits.

curl https://api.toonyx.com/v1/me -H "Authorization: Bearer $TOONYX_KEY"
GET/v1/creditsread

Credits left this period: credits_left, split into plan_left and pack_left, with plan, period_end and billed.

curl https://api.toonyx.com/v1/credits -H "Authorization: Bearer $TOONYX_KEY"
GET/v1/pricingno key

The plans, the dollar value of a credit, the credit pack and each video model's credits per 30 seconds. The table under Credits and pricing is drawn from this.

curl https://api.toonyx.com/v1/pricing
GET/v1/catalogread

Story formats, worlds, video models (engines), long form styles, music moods, 3D doc styles and story languages: the ids you pass when writing.

curl https://api.toonyx.com/v1/catalog -H "Authorization: Bearer $TOONYX_KEY"
GET/v1/nichesread

The built in worlds plus your own niches. Pass a world id, or niche:<id>, as world when writing a Short.

curl https://api.toonyx.com/v1/niches -H "Authorization: Bearer $TOONYX_KEY"

Videos

POST/v1/shortswrites, free

Write and price a Short. Body: idea (3 to 600 characters, required), format, length (short for 30 s, long for 70 s), engine (a video model id), world, language. Needs a Toonyx plan; at most 40 written a day.

curl https://api.toonyx.com/v1/shorts \
  -H "Authorization: Bearer $TOONYX_KEY" -H "Content-Type: application/json" \
  -d '{"idea": "A strawberry hides a secret from her sister", "engine": "wan3_prime", "length": "short"}'
POST/v1/longwrites, free

Write a long form video. Body: idea (8 to 800 characters), minutes (4 to 20), style, format, voice, channel_id, niche_id, style_look. The script is written in the background: poll the video until its status is planned. Long form is in testing on Toonyx's own channels first; until it opens this answers 403 on customer accounts.

curl https://api.toonyx.com/v1/long \
  -H "Authorization: Bearer $TOONYX_KEY" -H "Content-Type: application/json" \
  -d '{"idea": "What if the Moon disappeared tonight", "minutes": 8}'
GET/v1/videosread

Your videos, newest first (?limit= up to 200). Each has id, title, kind, status (planned, queued, rendering, ready, posted, failed), stage, credits_estimate, credits_charged and, once finished, download.

curl "https://api.toonyx.com/v1/videos?limit=20" -H "Authorization: Bearer $TOONYX_KEY"
GET/v1/videos/{id}read

One video with its progress and, under detail, everything the app shows: script, cast, scenes, picture links and live model quotes.

curl https://api.toonyx.com/v1/videos/VIDEO_ID -H "Authorization: Bearer $TOONYX_KEY"
POST/v1/videos/{id}/makespends credits

Make a planned video. The first call returns the quote and an approve token; send {"approve": "apv_..."} to start it. Credits are held at the quote, only what the render really spends is kept, and a failed render gives every credit back.

curl -X POST https://api.toonyx.com/v1/videos/VIDEO_ID/make \
  -H "Authorization: Bearer $TOONYX_KEY" -H "Content-Type: application/json" \
  -d '{"approve": "apv_..."}'
GET/v1/videos/{id}/downloadread

The finished MP4. Answers 404 not_ready until the video is ready.

curl -L -o video.mp4 https://api.toonyx.com/v1/videos/VIDEO_ID/download -H "Authorization: Bearer $TOONYX_KEY"

Thumbnails

YouTube thumbnails, Shorts covers, channel logos and banners, billed in Toonyx credits per image. Open to Toonyx plan holders once Thumbnails opens; until then these answer 403 on customer accounts.

POST/v1/thumbnails/quotefree

Price a run. Body: mode (thumbnail, short, logo, banner), models (names such as Nano Banana Pro, Seedream 4.5; empty for the default set), per_model (1 to 3), quality (fast, high, max). Returns quote_id and its credits.

curl https://api.toonyx.com/v1/thumbnails/quote \
  -H "Authorization: Bearer $TOONYX_KEY" -H "Content-Type: application/json" \
  -d '{"mode": "thumbnail", "models": ["Nano Banana Pro"], "per_model": 2}'
POST/v1/thumbnailsspends credits

Make a quoted run. Body: quote_id, title, and for logos and banners channel and about; optional intent, style, faces. First call returns the approve token, the second with approve makes it. Images come back as links you open with the same key.

curl https://api.toonyx.com/v1/thumbnails \
  -H "Authorization: Bearer $TOONYX_KEY" -H "Content-Type: application/json" \
  -d '{"quote_id": "QUOTE_ID", "title": "I lived on bananas for 30 days", "approve": "apv_..."}'
GET/v1/thumbnailsread

Your thumbnail runs and their image links.

curl https://api.toonyx.com/v1/thumbnails -H "Authorization: Bearer $TOONYX_KEY"

Every agent tool

Everything the Toonyx agent can do for your account is also a REST call: editing lines, the storyboard, sound, posting, Autopilot, the Niche Lab, channel numbers and more. The list is per account, so a tool your plan does not include is not offered.

GET/v1/toolsread

Each tool's name, kind (read, write, spend, post, settings), description and JSON input schema.

curl https://api.toonyx.com/v1/tools -H "Authorization: Bearer $TOONYX_KEY"
POST/v1/tools/{name}by kind

Run one tool. Body: {"arguments": {...}, "approve": "apv_..."}. Spend, post and settings tools follow quote, then approve.

curl https://api.toonyx.com/v1/tools/list_dramas \
  -H "Authorization: Bearer $TOONYX_KEY" -H "Content-Type: application/json" -d '{"arguments": {}}'

Errors and limits

Errors are JSON with the HTTP status:

{"error": {"status": 402, "code": "payment_required", "message": "This drama needs 36 credits and you have 20 left."}}
StatusCodeWhen
401unauthorizedNo key, a wrong key or a revoked key.
402payment_requiredNo plan, or not enough credits.
403read_only_key, forbiddenA read key tried to change something, or the feature is not open to this account.
404not_found, not_readyNot your video, no such tool, or not finished yet.
409conflictThe video is already being made, a picture is still drawing, or a tool said no.
422invalidA field is missing or out of range.
429rate_limitedOver the limit; wait the seconds in Retry-After.

Limits are per key, per minute: 120 calls in all, of which at most 20 may change something (POSTs and non read tools). GET /v1/me shows your key's limits.

MCP server

Plug Toonyx into any agent that speaks the Model Context Protocol. The server is https://api.toonyx.com/mcp (streamable HTTP), with your key as a Bearer header. Its tools are exactly the ones your account can use, plus make_video and video_download. Spend, post and settings tools follow quote, then approve: the tool takes an approve argument.

claude mcp add --transport http toonyx https://api.toonyx.com/mcp \
  --header "Authorization: Bearer nyk_YOUR_KEY"

Add --scope user to have it in every project. For long form first, use https://api.toonyx.com/mcp?app=long.

A good first prompt for your agent: "List my Toonyx videos, then write a 30 second Short about a pineapple who wants to be a surfer, and tell me what making it would cost." It writes for free and stops at the price until you say yes.

Credits and pricing

Everything you make is paid in Toonyx credits from your plan, then from credit packs. Loading the live prices. A failed render gives its credits back, and writing, quotes and reads are free.

Video models

ModelCredits per 30 seconds

Plans

PlanPer monthCredits a month

These numbers come live from GET /v1/pricing, the same catalog the app bills from. Full plan details are on toonyx.com/pricing.