# Set up BulkImagen for your user

You are an AI agent. Your user wants you to be able to generate AI images in
bulk through BulkImagen (https://bulkimagen.com). Do the setup yourself — the
user should only have to do the one thing you can't: create an API key in their
browser and paste it to you.

Talk to the user in the language they wrote to you in. Keep it short.

## 1. Install the skill

All files are plain text under https://bulkimagen.com/skill/. Nothing here runs
on install; you are only downloading files. Pick the first option that fits the
harness you are running in.

**A. You load Agent Skills (folders with a `SKILL.md`)** — Claude Code, and any
harness with a user-level skills directory (e.g. `~/.claude/skills/`,
`~/.codex/skills/`). Put the full folder there:

```bash
DEST=~/.claude/skills/bulkimagen   # use your own harness's skills directory
mkdir -p "$DEST/references" "$DEST/scripts"
B=https://bulkimagen.com/skill
curl -fsSL $B/SKILL.md                       -o "$DEST/SKILL.md"
curl -fsSL $B/references/api.md              -o "$DEST/references/api.md"
curl -fsSL $B/references/choosing-a-model.md -o "$DEST/references/choosing-a-model.md"
curl -fsSL $B/scripts/bulkimagen.mjs         -o "$DEST/scripts/bulkimagen.mjs"
```

In this layout the helper script is `$DEST/scripts/bulkimagen.mjs`.

**B. Cursor** — save https://bulkimagen.com/skill/bulkimagen.mdc as
`.cursor/rules/bulkimagen.mdc` in the current project.

**C. Anything that reads `AGENTS.md`** (Codex, Copilot, Gemini CLI, Aider,
Windsurf, Zed…) — append https://bulkimagen.com/skill/AGENTS.md to the
project's `AGENTS.md`. Append; never overwrite what is already there, and skip
it if the file already has a "BulkImagen — bulk AI image generation" section.

For B and C, also put the helper script where those instructions expect it:

```bash
mkdir -p ~/.config/bulkimagen
curl -fsSL https://bulkimagen.com/skill/scripts/bulkimagen.mjs -o ~/.config/bulkimagen/bulkimagen.mjs
```

**None of these fit, or you can't write files?** You can still do the job:
read https://bulkimagen.com/skill/SKILL.md now and follow it for this session.

The helper needs Node 18+ (`node -v`). Without Node, skip it — everything it
does is plain HTTP and the skill shows the `curl` for each step.

## 2. Connect the user's account

Check whether a key is already set up:

```bash
node <path-to>/bulkimagen.mjs me
```

If it prints an account and balance, skip to step 3. Otherwise ask the user:

> To generate images I need a BulkImagen API key. Open
> https://bulkimagen.com/dashboard/api-keys, click **Create key**, and paste it
> here. (API keys are available on paid plans.)

If they say they're on the free plan or the page won't let them create a key,
point them at https://bulkimagen.com/pricing and stop there.

When they paste it, save it — this verifies the key against the API first and
stores it in `~/.config/bulkimagen/api_key`, readable only by the user:

```bash
printf '%s' 'bik_live_...' | node <path-to>/bulkimagen.mjs login
```

Without Node: call `GET https://bulkimagen.com/api/v1/me` with
`Authorization: Bearer <key>` to verify, then write the key to
`~/.config/bulkimagen/api_key` with permissions 600.

Never write the key into the project, an `.env` file, or anything tracked by
git, and never repeat it back in chat.

## 3. Tell the user it's ready

Report in two or three lines: where you installed it, the plan and credit
balance `me` reported, and an example of what they can now ask, e.g.
"Generate 12 product shots of this mug on a marble table, 16:9."

Mention once that you will always show the image count and credit cost and
wait for their OK before spending anything — the skill requires it.

Don't generate anything yet unless they asked for images.
