DEV Community

SpicyAPI
SpicyAPI

Posted on

Give Claude Code an unrestricted image and video API with one MCP server

Most image and video models live behind their own account, SDK and billing page, and most hosted APIs add a moderation layer of their own on top of the model. If you want your coding agent to make a product shot, a short clip or a voice-over while it works, wiring each provider up by hand gets old fast, and having a request refused by a filter you never asked for gets old even faster.

This post shows how to give Claude Code (or Cursor, Codex, VS Code and other MCP clients) one tool that can browse 200+ generation models, price a request, and run it, with the agent stopping to ask you before anything costs money. It uses the official MCP server for SpicyAPI, an unrestricted AI API: the platform adds no content filter of its own, so what you can generate depends only on the model you pick, and the catalog marks which models are uncensored.

What you need

  • Node.js 22.13 or later (node --version).
  • A SpicyAPI API key. Create one on the API keys page. Keys start with sk-spicy- and are shown once. Under Advanced you can give the key a daily cap or restrict it to certain models, which is a good idea for a key an agent will use.
  • Funds on the account for paid runs. Browsing models, quoting prices and reading results are free.

Add the server to Claude Code

Export your key in the terminal you will run the command from, then register the server:

export SPICY_API_KEY="sk-spicy-..."

claude mcp add spicyapi \
  -e SPICY_API_KEY=$SPICY_API_KEY \
  -- npx --yes --package=@spicyapi/mcp spicyapi-mcp
Enter fullscreen mode Exit fullscreen mode

The --package flag matters: the package ships two binaries, so plain npx @spicyapi/mcp cannot tell which one to run.

Check it with claude mcp list or /mcp inside a session. Add --scope user if you want it in every project, and avoid --scope project, which would write your key into a .mcp.json in the repository.

Or add it to Cursor

Cursor reads ~/.cursor/mcp.json (Windsurf and Gemini CLI use the same shape in their own files):

{
  "mcpServers": {
    "spicyapi": {
      "command": "npx",
      "args": ["--yes", "--package=@spicyapi/mcp", "spicyapi-mcp"],
      "env": { "SPICY_API_KEY": "YOUR_SPICY_API_KEY" }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Keep this in your user-level file, not a project file that gets committed.

First three prompts (all free)

  1. "Check the SpicyAPI service status." This tool needs no key, so it proves the server starts.
  2. "What is my SpicyAPI balance?" Proves the key reaches the server.
  3. "Which SpicyAPI tools do you have?" You should see 15 tools prefixed spicyapi_.

Then ask for something real

Use SpicyAPI to list the image models I can call, pick an inexpensive one, generate a cinematic night portrait, and give me the result link when it finishes.

Behind the scenes the agent:

  1. reads the live catalog and the chosen model's input schema;
  2. gets an exact USD quote;
  3. stops and asks you to confirm the estimate and the maximum charge;
  4. creates the task, waits for it and returns the result link.

A few more that work well:

  • "Find models that turn an image into a video and compare what a 5-second clip costs on each." (catalog plus quotes, free)
  • "Turn ~/Desktop/product.jpg into a 5-second video with a slow push-in." (uploads the file, then a confirmed task)
  • "Show my tasks from the last three days that failed, and why."

Why the agent cannot spend on its own

Paid tools use MCP elicitation: the confirmation is rendered by your client and answered by you, not by the model. The answer is bound to the exact request, so if the model or input changes after the question, nothing is created. Declining means no task, no hold and no charge. Quotes are valid for five minutes, and a client that does not support elicitation simply cannot create paid tasks; the read-only tools still work.

Local files and results

spicyapi_upload_file takes an absolute path, uploads the file and returns a spicy:// URI the agent can pass to a model. By default it only reads under your home directory, which protects you from a path smuggled in through a web page or an email. Results come back as ready-to-use links; generated files are kept for about 14 days, so download anything you want to keep.

Links

Top comments (0)