クロードAgents · Claude Code
Let Claude draw for your project.
SKILL.md that tells Claude when and how to do something. This one lets Claude Code generate anime images through AnimeAPI and save them where your project needs them: README art, game sprites, placeholder characters. It knows the video API too, for short animated clips.Fastest way
Paste one prompt.
Copy this prompt into Claude Code. It creates the files below with the exact contents shown on this page.
Preview the prompt
Install the AnimeAPI skill for Claude Code. Create these two files exactly, then run chmod +x on the script:
~/.claude/skills/animeapi/SKILL.md
```markdown
---
name: animeapi
description: Generate anime-style images (characters, scenes, sprites, backgrounds, key art) and short anime video clips with AnimeAPI and save them to disk. Use when the user asks for anime or manga style images, animations or visual assets.
allowed-tools: Bash(${CLAUDE_SKILL_DIR}/scripts/generate.sh *)
---
# AnimeAPI: anime image and video generation
Generate anime-style images (and, when asked, short anime video clips) through
AnimeAPI and save them into the project.
## Setup
`ANIMEAPI_KEY` must be set in the environment the agent runs in (for example
`export ANIMEAPI_KEY=ank_...` in your shell profile). A `.env` file is not
read automatically. Keys: https://animeapi.ai/dashboard/api-keys
## How to generate
Run:
```bash
${CLAUDE_SKILL_DIR}/scripts/generate.sh "<prompt>" <output-file> [model] [orientation]
```
The script needs `curl` and `jq`.
- `model`: `anime` (default, $0.003, best for characters, tag-based),
`ultra` ($0.01, follows long sentences, renders legible text) or
`ultra-max` ($0.02, highest detail).
- `orientation`: `portrait` (default), `square` or `landscape`.
- Use a `.webp` output path for `anime` and `.png` for the ultra tiers.
- The script prints `enhanced_prompt` (what the model actually read) and the
remaining `balance_usd`.
## Writing prompts
- anime: describe the character first (who, hair, outfit, pose), then the
place and light. Your prompt is rewritten into Danbooru tags automatically.
It is strongly biased toward drawing a person; for animals or objects as the
subject, use ultra.
- ultra / ultra-max: write a full sentence; an anime style is added
automatically. Put any text that must appear in the image in quotes.
## Errors
- 401 INVALID_KEY: ANIMEAPI_KEY is missing or revoked.
- 402 INSUFFICIENT_BALANCE: tell the user to top up at
https://animeapi.ai/dashboard/billing. Do not retry.
- 400 MODERATION_BLOCKED (ultra tiers): rephrase the prompt.
- 500 GENERATION_FAILED: the charge was refunded; one retry is fine.
Each image costs money. Generate one image, show it, and ask before making
batches.
## Videos
Only when the user asks for a video or animation. Videos are MP4 (24 fps, with
sound), 5 to 15 seconds, billed per second up front: $0.016/s at 480p,
$0.04/s at 768p (a 5-second 768p clip is $0.20). State the price and ask
before anything longer than 5 seconds or more than one clip.
1. Start a job (build the JSON with `jq -n` if the prompt has quotes):
```bash
curl -sS https://animeapi.ai/api/videos -H "Authorization: Bearer $ANIMEAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "<what happens>", "resolution": "768p", "duration": 5, "orientation": "landscape"}'
```
It returns 202 with an `id`. Optional `first_frame` / `last_frame`: an
image URL or a `data:image/png;base64,...` data URI (up to 10 MB) that the
clip starts / ends on; the first frame sets the shape. For a local image,
pipe it through jq into a file (too long for a command-line argument):
```bash
base64 < in.webp | tr -d '\n' | jq -Rs --arg p "<what happens>" \
'{prompt: $p, duration: 5, first_frame: ("data:image/webp;base64," + .)}' > /tmp/video.json
curl -sS https://animeapi.ai/api/videos -H "Authorization: Bearer $ANIMEAPI_KEY" \
-H "Content-Type: application/json" -d @/tmp/video.json
```
2. Poll every 5 seconds until `status` is `succeeded` or `failed`:
```bash
curl -sS https://animeapi.ai/api/videos/<id> -H "Authorization: Bearer $ANIMEAPI_KEY"
```
3. On `succeeded`, download `video_url` into the project (`curl -sS -o out.mp4 <video_url>`).
On `failed`, the charge was refunded and `error` says why.
```
~/.claude/skills/animeapi/scripts/generate.sh
```bash
#!/usr/bin/env bash
# Usage: generate.sh "<prompt>" <output-file> [model] [orientation]
set -euo pipefail
PROMPT="${1:?usage: generate.sh \"<prompt>\" <output-file> [model] [orientation]}"
OUT="${2:?usage: generate.sh \"<prompt>\" <output-file> [model] [orientation]}"
MODEL="${3:-anime}"
ORIENTATION="${4:-portrait}"
: "${ANIMEAPI_KEY:?Set ANIMEAPI_KEY first: https://animeapi.ai/dashboard/api-keys}"
# jq builds the JSON so quotes and newlines in the prompt are escaped safely.
BODY=$(jq -n --arg p "$PROMPT" --arg m "$MODEL" --arg o "$ORIENTATION" \
'{prompt: $p, model: $m, orientation: $o, allowNSFW: false}')
RESPONSE=$(curl -sS https://animeapi.ai/api/generate \
-H "Authorization: Bearer $ANIMEAPI_KEY" \
-H "Content-Type: application/json" \
-d "$BODY" \
-w $'\n%{http_code}')
STATUS=$(tail -n1 <<<"$RESPONSE")
JSON=$(sed '$d' <<<"$RESPONSE")
if [ "$STATUS" != "200" ]; then
echo "AnimeAPI error $STATUS $(jq -r '.code // ""' <<<"$JSON"): $(jq -r '.error' <<<"$JSON")" >&2
exit 1
fi
mkdir -p "$(dirname "$OUT")"
curl -sS -o "$OUT" "$(jq -r '.image_url' <<<"$JSON")"
echo "saved: $OUT"
echo "enhanced_prompt: $(jq -r '.enhanced_prompt' <<<"$JSON")"
echo "balance_usd: $(jq -r '.balance_usd' <<<"$JSON")"
```→Or install it by hand
Put your key in the environment
Claude runs the script in your shell, so the key must be exported there. Add it to
~/.zshrcor~/.bashrcand restart Claude Code.~/.zshrc export ANIMEAPI_KEY="ank_your_key_here"Create the skill folder
Personal skills live in
~/.claude/skills/and work in every project. Use.claude/skills/inside a repo to share it with your team instead.terminal mkdir -p ~/.claude/skills/animeapi/scriptsAdd SKILL.md
~/.claude/skills/animeapi/SKILL.md --- name: animeapi description: Generate anime-style images (characters, scenes, sprites, backgrounds, key art) and short anime video clips with AnimeAPI and save them to disk. Use when the user asks for anime or manga style images, animations or visual assets. allowed-tools: Bash(${CLAUDE_SKILL_DIR}/scripts/generate.sh *) --- # AnimeAPI: anime image and video generation Generate anime-style images (and, when asked, short anime video clips) through AnimeAPI and save them into the project. ## Setup `ANIMEAPI_KEY` must be set in the environment the agent runs in (for example `export ANIMEAPI_KEY=ank_...` in your shell profile). A `.env` file is not read automatically. Keys: https://animeapi.ai/dashboard/api-keys ## How to generate Run: ```bash ${CLAUDE_SKILL_DIR}/scripts/generate.sh "<prompt>" <output-file> [model] [orientation] ``` The script needs `curl` and `jq`. - `model`: `anime` (default, $0.003, best for characters, tag-based), `ultra` ($0.01, follows long sentences, renders legible text) or `ultra-max` ($0.02, highest detail). - `orientation`: `portrait` (default), `square` or `landscape`. - Use a `.webp` output path for `anime` and `.png` for the ultra tiers. - The script prints `enhanced_prompt` (what the model actually read) and the remaining `balance_usd`. ## Writing prompts - anime: describe the character first (who, hair, outfit, pose), then the place and light. Your prompt is rewritten into Danbooru tags automatically. It is strongly biased toward drawing a person; for animals or objects as the subject, use ultra. - ultra / ultra-max: write a full sentence; an anime style is added automatically. Put any text that must appear in the image in quotes. ## Errors - 401 INVALID_KEY: ANIMEAPI_KEY is missing or revoked. - 402 INSUFFICIENT_BALANCE: tell the user to top up at https://animeapi.ai/dashboard/billing. Do not retry. - 400 MODERATION_BLOCKED (ultra tiers): rephrase the prompt. - 500 GENERATION_FAILED: the charge was refunded; one retry is fine. Each image costs money. Generate one image, show it, and ask before making batches. ## Videos Only when the user asks for a video or animation. Videos are MP4 (24 fps, with sound), 5 to 15 seconds, billed per second up front: $0.016/s at 480p, $0.04/s at 768p (a 5-second 768p clip is $0.20). State the price and ask before anything longer than 5 seconds or more than one clip. 1. Start a job (build the JSON with `jq -n` if the prompt has quotes): ```bash curl -sS https://animeapi.ai/api/videos -H "Authorization: Bearer $ANIMEAPI_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt": "<what happens>", "resolution": "768p", "duration": 5, "orientation": "landscape"}' ``` It returns 202 with an `id`. Optional `first_frame` / `last_frame`: an image URL or a `data:image/png;base64,...` data URI (up to 10 MB) that the clip starts / ends on; the first frame sets the shape. For a local image, pipe it through jq into a file (too long for a command-line argument): ```bash base64 < in.webp | tr -d '\n' | jq -Rs --arg p "<what happens>" \ '{prompt: $p, duration: 5, first_frame: ("data:image/webp;base64," + .)}' > /tmp/video.json curl -sS https://animeapi.ai/api/videos -H "Authorization: Bearer $ANIMEAPI_KEY" \ -H "Content-Type: application/json" -d @/tmp/video.json ``` 2. Poll every 5 seconds until `status` is `succeeded` or `failed`: ```bash curl -sS https://animeapi.ai/api/videos/<id> -H "Authorization: Bearer $ANIMEAPI_KEY" ``` 3. On `succeeded`, download `video_url` into the project (`curl -sS -o out.mp4 <video_url>`). On `failed`, the charge was refunded and `error` says why.allowed-toolslets Claude run this one script without asking each time.${CLAUDE_SKILL_DIR}points at the skill folder wherever it’s installed.Add the script
~/.claude/skills/animeapi/scripts/generate.sh #!/usr/bin/env bash # Usage: generate.sh "<prompt>" <output-file> [model] [orientation] set -euo pipefail PROMPT="${1:?usage: generate.sh \"<prompt>\" <output-file> [model] [orientation]}" OUT="${2:?usage: generate.sh \"<prompt>\" <output-file> [model] [orientation]}" MODEL="${3:-anime}" ORIENTATION="${4:-portrait}" : "${ANIMEAPI_KEY:?Set ANIMEAPI_KEY first: https://animeapi.ai/dashboard/api-keys}" # jq builds the JSON so quotes and newlines in the prompt are escaped safely. BODY=$(jq -n --arg p "$PROMPT" --arg m "$MODEL" --arg o "$ORIENTATION" \ '{prompt: $p, model: $m, orientation: $o, allowNSFW: false}') RESPONSE=$(curl -sS https://animeapi.ai/api/generate \ -H "Authorization: Bearer $ANIMEAPI_KEY" \ -H "Content-Type: application/json" \ -d "$BODY" \ -w $'\n%{http_code}') STATUS=$(tail -n1 <<<"$RESPONSE") JSON=$(sed '$d' <<<"$RESPONSE") if [ "$STATUS" != "200" ]; then echo "AnimeAPI error $STATUS $(jq -r '.code // ""' <<<"$JSON"): $(jq -r '.error' <<<"$JSON")" >&2 exit 1 fi mkdir -p "$(dirname "$OUT")" curl -sS -o "$OUT" "$(jq -r '.image_url' <<<"$JSON")" echo "saved: $OUT" echo "enhanced_prompt: $(jq -r '.enhanced_prompt' <<<"$JSON")" echo "balance_usd: $(jq -r '.balance_usd' <<<"$JSON")"terminal chmod +x ~/.claude/skills/animeapi/scripts/generate.shIt needs
curlandjq.jqbuilds the JSON, so prompts with quotes or apostrophes are safe.
→Use it
Ask for what you want. Claude picks the skill up from its description, or you can call it directly with /animeapi.
- “Make a hero image for the README, a girl coding at night by a rainy window, landscape, save to docs/hero.webp”
- “Generate three enemy portraits for the RPG in square format into assets/enemies/”
- “Use ultra to make a cafe sign that says OPEN LATE, save to public/sign.png”
- “Animate docs/hero.webp into a 5-second clip where she looks up from the laptop, save to docs/hero.mp4”
Videos go through curl rather than the script (start a job, poll it, download the MP4), so Claude Code asks before running those commands.
