Shigaru

API Keys

An API key lets a script or bot use Shigaru as you: it spends your credits, and what it makes lands in your account.

Making a key

Open Settings → API keys, name the key, and select Make key. Copy it right away — it's shown once. If you lose it, revoke it and make another.

Treat a key like a password. Anyone holding it can generate and post as you until you revoke it. You can hold up to ten keys at a time.

What a key can see

Choose when you make it:

  • Only what this key makes (the default). The key works with the images it made and nothing else on your account: your other images read as not found. It can generate, check on, publish, upscale, animate and delete its own images. This is the one for a bot.
  • Everything on my account. The key can do what you can on the site, apart from the things listed under What a key can't do.

Either way, credits come from your balance, and what a key publishes shows under your name. Revoking a key leaves its images on your account.

To use a key from Claude, Cursor or another AI app, see AI Apps (MCP).

Calling the API

Send the key as a bearer token to https://api.shigaru.com. This lists the images the key can see, newest first:

export SHIGARU_KEY="shg_..."
curl "https://api.shigaru.com/gallery?mine=true" \
  -H "Authorization: Bearer $SHIGARU_KEY"

Generate an image

POST /generate takes a prompt. Flags work the same as on the site — see Prompt Syntax.

curl https://api.shigaru.com/generate \
  -H "Authorization: Bearer $SHIGARU_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "a cat reading in a sunlit library --q 2"}'
{ "id": "6f1c…", "status": "running", "creditsUsed": 6 }

Check on it

GET /generate/<id> returns the generation. status is pending, running, completed or failed. Once it's completed, imageUrls holds the images.

curl https://api.shigaru.com/generate/6f1c… \
  -H "Authorization: Bearer $SHIGARU_KEY"

Poll every few seconds; there's no need to go faster.

Publish or share it

New generations follow your default visibility. To make one public:

curl -X PATCH https://api.shigaru.com/generate/6f1c… \
  -H "Authorization: Bearer $SHIGARU_KEY" \
  -H "Content-Type: application/json" \
  -d '{"isPublic": true}'

Add "index": 0 to publish just one image of the batch, or send "isPublic": false to make it private again. A public image may wait for a quick check before others can see it.

Its page is https://shigaru.com/gallery/<id> — post that link anywhere.

What a key can't do

A key can't make or revoke keys, change your profile or sign-in, delete your account, buy credits, or reach moderator tools. Do those on the site.

A key limited to what it makes gets 403 from anything beyond its own images, and 404 for your account's other images.

Keys are limited to about two requests a second. Too many returns 429; wait for the Retry-After seconds and try again.

A revoked key, or one used after your account is suspended or set to be deleted, returns 401.

On this page