Agent Skill
A ready-made playbook for AI coding assistants. Install it once and your assistant builds SpicyAPI integrations the safe, correct way. What it is, what it changes, how to install it and how to check it works.
If you use an AI coding assistant such as Claude Code, Codex or Cursor, the SpicyAPI Skill teaches it how to work with SpicyAPI properly. You install it once. After that you can say "add SpicyAPI image generation to my app" and the assistant follows SpicyAPI's rules instead of guessing.
You don't need to be a developer to follow this page. If you can paste a command into a terminal, you can install the Skill.
The short version
- Run
npx skills add spicyapi-ai/spicy-skillin a terminal and choose your assistant. - Close your assistant and open a new session.
- Ask for something that mentions SpicyAPI, for example: "Add a SpicyAPI image generation endpoint to my backend."
What a Skill is
A Skill is a folder of instructions written for an AI assistant rather than for people. Think of it as the operations manual you would hand a new colleague: it doesn't do the work itself, but it tells whoever does the work which steps to take, in what order, and what never to do.
AI assistants know a lot about programming in general, but they have no reliable knowledge of SpicyAPI's specific rules. Left to guess, an assistant may:
- make up a model ID or input field that doesn't exist;
- paste your API key straight into your code;
- send the same paid request twice after a network hiccup, and pay twice;
- hand you a result link that stops working a few days later.
With the Skill installed, the assistant reads SpicyAPI's rules before it starts. This is how it works in practice:
- The Skill's folder sits in a place your assistant checks when a session starts.
- The assistant reads the Skill's one-paragraph summary. When your request involves SpicyAPI, it opens the full instructions. You don't have to mention the Skill by name.
- It follows those instructions while it writes code or runs commands for you.
Three facts worth knowing up front:
- It is only text. Markdown and YAML files: no programs, no scripts, nothing that runs when you install it. You can open every file in a text editor; see What's inside.
- It contains no API key and makes no calls. On its own it cannot reach your account or spend money.
- It is free and open source. MIT-licensed, published on npm as
@spicyapi/skilland developed in the open at github.com/spicyapi-ai/spicy-skill.
Skill, MCP, SDK and CLI
SpicyAPI has four official tools. They solve different problems and are designed to be used together.
| Tool | What it is | Its role, in plain words |
|---|---|---|
| Skill (this page) | Instructions for your AI assistant | The playbook: how to do things correctly |
| MCP server | A connector that runs on your computer and gives your assistant SpicyAPI actions: browse models, get a price, create a task, fetch the result | The hands: lets the assistant act on your account |
| SDK | A TypeScript library your own application imports. There are official SDKs for Python, Go, PHP and Java as well | What your app's code uses to talk to SpicyAPI |
| CLI | The spicyapi terminal command | Runs SpicyAPI operations from a terminal or a script |
The Skill doesn't replace any of them. It tells the assistant how to use them: the MCP tools when they are connected, the CLI for one-off operations, and the SDK for your language for code that goes into your application.
- Skill only. The assistant writes correct integration code for your project, but it can't look anything up in your account or run tasks for you.
- MCP only. The assistant can act on your account, but it has to work out the right order of steps by itself every time.
- Both. The assistant can try things for you and does them the documented way. If you want your assistant to run real tasks, install both. They don't conflict.
What it helps with
The left column is what you ask for. The right column is what the Skill makes the assistant do while delivering it.
| You ask the assistant to… | The Skill makes sure it… |
|---|---|
| Pick a model and build a request | Reads that model's current input fields from the live catalog instead of guessing. It never invents a model ID, a price or a field. |
| Add image or video generation to your app | Gets the exact price first, shows you the estimated cost and the maximum charge, and waits for your OK before any paid call. |
| Make the integration survive network problems | Uses one idempotency key per generation and reuses it after a timeout, so a retry can't create (and bill) a second task. See Idempotency. |
| Wait for the result | Uses a verified webhook or a wait with a deadline, then checks the task's final state. It only reports a usable result once a result link is ready. |
| Receive results by webhook | Checks the signature on the raw request before trusting it, and ignores duplicate deliveries using request_id. See Webhooks. |
| Keep the generated files | Uses the ready result link directly, then saves a copy in storage you control, because result links are temporary and outputs are kept for about 14 days. |
| Use a file from your computer as input | Uploads it first and passes the returned spicy:// address. It never pastes file contents into the request. See Media. |
| Handle errors | Doesn't blindly resend a rejected request: it fixes the input, points you to the console when the balance is too low, and waits as long as Retry-After says. See Errors. |
| Protect your API key | Reads SPICY_API_KEY from an environment variable or secret manager, and never writes it into source code, command arguments, prompts, logs or committed configuration. |
| Run many generations | There is no batch endpoint, so it limits how many run at once, gives each item its own idempotency key and price, and never resubmits a whole batch because one item timed out. |
| Keep content for less time, or delete it | Only ever shortens how long content is kept. Before destroying a task's content it asks you, and tells you plainly that this is not a refund and the billing record stays. See Retention. |
| Report what it did | Gives you the model ID, task ID, request ID and idempotency key, so you can look things up later or quote them to support. |
What it will not do
- Spend money on its own. The Skill is text and can't call anything. If your assistant also has the MCP server or the CLI and an API key, it can create paid tasks. The Skill tells it to show you the price and get your explicit confirmation first, unless your request already clearly authorized that exact paid run. With the MCP server, every paid action additionally stops for a confirmation the assistant cannot skip.
- Invent features. It won't write calls for things the public API doesn't offer, such as cancelling a task, deleting a task record or re-sending a webhook.
- Touch your account settings. Sign-up, login, payments, top-ups, team members, privacy requests and account closure stay in the SpicyAPI console. The assistant won't try to automate them.
- Fake a test. If you ask for a real test, it makes a real (and possibly paid, after your confirmation) request and reports what actually happened. A passing mock is never reported as "verified".
- Add a content setting. SpicyAPI has no content-mode flag and no per-request content review, and the Skill doesn't invent one. The model you choose decides what it can do.
Before you start
You need four things. Only the first three are needed to install.
-
An AI coding assistant that supports Agent Skills. Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, Windsurf and many others do. The Skill uses the portable Agent Skills folder format, so it works with any assistant that reads that format. If you're unsure about yours, search its documentation for "skills".
-
Node.js 22 or later, which provides the
npxcommand. Check with:node --versionThe
skillsinstaller currently asks for Node.js 22.20 or later, and the package's own installer needs 22.13 or later. If the command isn't found or the version is lower, install the LTS release from nodejs.org and open a new terminal. -
A terminal. On macOS, the Terminal app. On Windows, PowerShell. Run the commands from your project folder if you want a per-project install.
-
A SpicyAPI API key, once you start calling the API. Installing the Skill doesn't need one. Create a key in the console; it starts with
sk-spicy-and is shown only once. Store it in an environment variable namedSPICY_API_KEYand never paste the key itself into a chat with your assistant. See Authentication.
Install
There are two ways to install. Both put the same files in place. Use the first one unless you have a reason not to.
skills is a free installer shared by many coding assistants. It knows where each assistant looks for Skills, so you don't have to.
Run the command
npx skills add spicyapi-ai/spicy-skillWrite the owner exactly as spicyapi-ai. The repository moved there in October 2026; under the old Spicy-API and SpicyAPI names the installer no longer finds the Skill. That address is SpicyAPI's public GitHub repository, so you always get the current version of the Skill.
The first time, npx may ask to download the skills tool: answer y. You will then see “Cloning repository…” followed by “Found 1 skill”. That is the whole of it.
Choose your assistants
The installer shows a list of assistants. Select the ones you use with the space bar, then press Enter.
Choose where it applies
- Project: installs into the folder you ran the command from, so the Skill only applies when your assistant works in that project. The files can be committed with the project, which gives teammates the Skill too. That's safe: the Skill contains no secrets.
- Global: installs into your home folder, so the Skill applies in every project.
Choose how to install
Symlink (the recommended option) keeps one copy and points each assistant at it. Copy gives each assistant its own copy. Both work.
Start a new session
Assistants load Skills when a session starts. Close your assistant, open it again, then check that it works.
To skip the questions, name the assistant (--agent), add -g for a global install and -y to accept the defaults:
# Claude Code, this project only
npx skills add spicyapi-ai/spicy-skill --agent claude-code
# Codex, every project
npx skills add spicyapi-ai/spicy-skill --agent codex -g
# Claude Code and Codex, every project, no questions
npx skills add spicyapi-ai/spicy-skill --agent claude-code codex -g -yWhen it finishes, the installer prints the exact folders it wrote. Typical results:
| You chose | Where the files end up |
|---|---|
| Project, Claude Code only | .claude/skills/spicyapi inside the project |
| Project, several assistants | One copy in .agents/skills/spicyapi inside the project, with each other assistant's folder pointing at it |
| Global, Claude Code and Codex | ~/.agents/skills/spicyapi, plus ~/.claude/skills/spicyapi pointing at it |
~ is your home folder: /Users/your-name on macOS, C:\Users\your-name on Windows. Folders whose names start with a dot are hidden by default; on macOS, press Cmd + Shift + . in Finder to show them.
Asking your assistant to install it for you
You can ask your assistant to run the command. When the installer detects it is being run by an assistant, it doesn't ask questions, so say exactly what you want, for example: "Run npx skills add spicyapi-ai/spicy-skill --agent claude-code -g."
Check that it works
Confirm the files are there
npx skills list # Skills installed in the current project
npx skills list -g # Skills installed for every projectLook for spicyapi in the output. You can also open the install folder and check that it contains SKILL.md.
Ask your assistant
Open a new session in your project and ask:
Do you have a SpicyAPI skill available? Summarize what it tells you to do before creating a paid SpicyAPI task.
A good answer mentions things that come from the Skill: getting an exact quote and showing you the estimated cost and maximum charge, waiting for your confirmation, keeping one idempotency key for the attempt, reading the model's live input schema, and keeping SPICY_API_KEY in an environment variable.
If the answer is vague or generic, the assistant hasn't loaded the Skill. See Troubleshooting.
Optionally, call it by name
Assistants pick the Skill up automatically when a request mentions SpicyAPI. To be explicit, name it in your request: "Use the spicyapi skill to…". In Codex you can also type $spicyapi.
Example requests
Paste any of these into your assistant and adjust the details. Mention SpicyAPI in the request so the assistant knows the Skill applies.
If you already know which model you want, copy its exact ID from the model page's API tab or the authenticated live catalog and put it in the request. The examples write MODEL_ID_FROM_CATALOG where that ID goes; it is a placeholder, not a real ID. If you don't have one, ask the assistant to choose from the live catalog. See Model catalog.
Add an image endpoint to a Next.js app
Add a server-side API route to my Next.js app that takes a text prompt, generates an image with SpicyAPI using the model
MODEL_ID_FROM_CATALOG, waits for the result and returns the image link. Read the API key fromSPICY_API_KEY.
What the Skill has the assistant watch for:
- The key stays on your server in
SPICY_API_KEY. Your web page calls your route; it never calls SpicyAPI with the key. - It reads that model's current input fields from the live catalog before building the request.
- It gets an exact quote first and shows you the estimated cost and maximum charge. The paid request carries that confirmed quote.
- It creates one idempotency key for the generation and reuses it if the request times out.
- It waits with a deadline and then checks the task's
state: a wait that ended is not the same as a generation that succeeded.
Receive results with a webhook in Express
Add a webhook endpoint to my Express server that receives SpicyAPI task results, verifies the signature using
SPICY_WEBHOOK_SECRET, and saves the result link to my database.
- It verifies the signature against the exact raw request body before parsing it as JSON.
- It uses the delivery's
request_idto ignore duplicates, because the same event can arrive more than once. - It reads the result straight from a complete, verified webhook without making an extra lookup.
Copy finished videos into your own storage
When a SpicyAPI video task succeeds, download the video and upload it to my S3 bucket, then store my own link instead of the SpicyAPI one.
- Result links are temporary and generated files are kept for about 14 days, so it saves a durable copy you control.
- It doesn't send your API key when downloading from a result link.
- If a link has expired, it asks SpicyAPI for the same task again to get a fresh link. It never creates a new task just to get a link.
Turn a user's photo into a video
Let users upload a photo in my app and turn it into a short video with SpicyAPI.
- It uploads the file to SpicyAPI first and puts the returned
spicy://address in the request, instead of pasting the file in as base64. - It respects the upload limits: 10 MiB for images, 90 MiB for MP4 or WebM video and MP3 or WAV audio.
- A photo that is already at a public HTTPS link can be passed directly, without uploading.
Handle retries and a low balance
Make my SpicyAPI integration handle failures: retry network timeouts without paying twice, show a clear message when my account balance is too low, and back off when I'm rate limited.
- After a timeout it retries with the same idempotency key, so a retry can't create a second paid task.
- It doesn't retry "insufficient balance" (code
40201); your user sees a clear message and you top up in the console. - It waits for as long as
Retry-Aftersays before trying again. - If the quote has expired or the price has changed (code
40901), it gets a fresh quote and asks you again, rather than dropping the price check. - It knows that retrying a failed task creates a new task that may be charged again, so it only does that when you want a new attempt.
Generate a batch
Generate product photos with SpicyAPI for the 20 items in
products.csv, at most 3 at a time, and log each task ID.
- SpicyAPI has no batch endpoint, so it runs a limited number of requests at a time.
- Each item gets its own idempotency key and its own price.
- It records each task ID as soon as the task is accepted.
- If one item times out, it recovers only that item and never resubmits the whole batch.
With the MCP server installed as well
You can also ask the assistant to work on your account directly, for example: "Using SpicyAPI, list the image models I can call and what each costs. Don't create any tasks." Listing models and prices doesn't cost anything. See MCP server.
What's inside
The installed folder looks like this:
spicyapi/
├── SKILL.md
├── references/
│ ├── api-workflows.md
│ └── safety.md
└── agents/
└── openai.yaml| File | What it's for |
|---|---|
SKILL.md | The main page. Its header holds the Skill's name (spicyapi) and the one-paragraph description the assistant reads to decide when the Skill is relevant. The body lists the required behaviour: live schemas, quotes and confirmation, idempotency keys, uploads, result links, retention, key handling, and what to report at the end. |
references/api-workflows.md | The detailed how-to, read before the assistant composes API, CLI or MCP steps: environment variables, a table matching each job to its CLI command, MCP tool and API route, the generation sequence, batches, retention and content destruction, local file uploads, retries after an uncertain response, an SDK outline, webhook signature checks and recovering task history. Its command examples write the model ID as the placeholder MODEL_ID_FROM_CATALOG and pass the input with --input-json, so the assistant takes the real ID from the live catalog instead of copying one from the example. |
references/safety.md | The rules read before paid calls, real tests, webhook handling or anything involving keys: keeping keys and customer content private, the confirmation checklist for paid calls, how to run a real integration test, honest cleanup, limits of the local MCP server, and which account actions stay in the console. On cleanup it says the same thing as api-workflows.md: content destruction removes one finished task's generated media, result payload, prompt and other input text while the billing record stays, and there is no API to cancel a task or delete its record. |
agents/openai.yaml | The display name, short description and default prompt for assistants that read this file, such as Codex. allow_implicit_invocation: true lets the assistant use the Skill without you naming it. |
The assistant only opens the two reference files when a task needs them, which keeps its working memory free for your project. To read the files before installing, run npx @spicyapi/skill path: it prints the folder where the package keeps them.
The Skill tells the assistant to configure your code and tools with these environment variables. The Skill itself reads none of them.
Prop
Type
Updating and removing
Update
The Skill changes when SpicyAPI's recommended workflow changes, and installed copies don't update themselves. The installed folder carries no version number, so reinstalling is the simplest way to be sure you're current.
-
Installed with
npx skills add: run the same command again, with the same scope and assistants. It replaces the installed files with whatever the repository holds at that moment, so an update reaches you as soon as it lands — there is nothing to wait for. -
Installed with the package installer: run it again with
--forceand the same--target. Adding@latestmakesnpxfetch the newest package instead of reusing a cached one:npx @spicyapi/skill@latest install --target ~/.claude/skills/spicyapi --force
--force replaces the whole folder
Anything you added to or changed inside the spicyapi folder is deleted. Keep your own notes somewhere else.
Remove
Removing the Skill doesn't affect your SpicyAPI account, your API keys or any code the assistant already wrote.
-
Installed with
npx skills add: run this from the same project folder, adding-gif you installed globally. Then check that thespicyapifolder is gone.npx skills remove spicyapi -
Installed with the package installer: delete the
spicyapifolder. In Finder or File Explorer, or from a terminal:# macOS and Linux: use the folder you installed into rm -rf ~/.agents/skills/spicyapi# Windows PowerShell Remove-Item -Recurse -Force "$HOME\.agents\skills\spicyapi"Check the path twice before pressing Enter: it must end in
spicyapi.
Start a new session afterwards so the assistant stops using the Skill.
Troubleshooting
Source
The package is MIT-licensed and developed in the open at github.com/spicyapi-ai/spicy-skill. That is where to read the exact instructions the Skill installs, report behaviour that differs from what is described here, or propose a change.
Next steps
MCP server
Let your assistant browse models, get prices and run tasks on your account
SDK
The TypeScript library for your application code
CLI
The spicyapi command for terminals and scripts
Agents and automation
A runbook for AI agents and automated backends that call SpicyAPI
Quickstart
Get a key, create a task and collect the result
Model catalog
Find callable models and their exact IDs

