Studio API

Everything the AI Studio does, over HTTP. Create a key on the studio page (it acts as the wallet that made it) and send it as Authorization: Bearer riu_sk_…. Generations spend that wallet's credits. CORS is open.

KEY=riu_sk_…
curl -s https://v2.regwatchhq.org/api/studio/images \
  -H "Authorization: Bearer $KEY" -H "content-type: application/json" \
  -d '{"prompt":"my frog watching the chart go up, caption \"we are so back\"","kind":"meme"}'
# → 202 {"image":{"id":"…","status":"pending"},"balance":…}

curl -s https://v2.regwatchhq.org/api/studio/images/<id> -H "Authorization: Bearer $KEY"
# → {"image":{"status":"done","url":"/api/studio/images/<id>/file",…}}
GET/api/studio/config

Credit price, per-image cost, and the StudioCredits contract per chain.

POST/api/studio/credits/claim

Credit a purchase. The contract event names the wallet credited; each purchase counts once.

{ "chainId": 4663000, "txHash": "0x…" }
GET/api/studio/mekey

Wallet, balance and recent credit movements.

POST/api/studio/imageskey

Start a generation. Answers 202 with a pending image; credits are taken now and refunded if it fails. kind: pfp | meme | free. size: 1K | 2K. token makes it a meme of that token and always includes the creator's pinned meme kit. postToX posts the finished image to the wallet's connected X account with that text.

{ "prompt": "my frog in a gold chain", "kind": "pfp", "size": "1K", "characterId": "…", "referenceIds": ["…"], "token": { "chainId": 4663, "address": "0x…" }, "postToX": "$TICKER gm" }
GET/api/studio/tokens/:chainId/:address

A token's meme kit (the creator's pinned references and style notes) and its latest memes.

PUT/api/studio/tokens/:chainId/:addresskey

Token creator only: create or edit the meme kit. Pin references with /api/studio/characters/:kitId/pins.

{ "name": "$FROG", "notes": "green frog, gold chain, comic outlines" }
POST/api/studio/images/:id/xkey

Post a finished image to the wallet's connected X account. Connecting X is done on the site.

{ "text": "$FROG gm" }
GET/api/studio/images/:idkey

Poll one image until status is done or failed.

GET/api/studio/imageskey

Your images, newest first. ?limit=&before=&kind=

GET/api/studio/images/:id/file

The image bytes. Public by id; add ?download for an attachment.

DELETE/api/studio/images/:idkey

Hide an image from your gallery and unpin it.

POST/api/studio/uploadskey

Upload a reference image.

multipart field "file" (or a raw image body), up to 8 MB
GET/api/studio/characterskey

Your characters with their pinned references.

POST/api/studio/characterskey

Create a character.

{ "name": "Frog", "notes": "green, gold chain" }
POST/api/studio/characters/:id/pinskey

Pin a reference (max 10). Pinned references go with every generation for that character.

{ "imageId": "…" }
DELETE/api/studio/characters/:id/pins?imageId=…key

Unpin a reference.

Errors are JSON { "error": "code" }: 401 no_pass, 402 insufficient_credits (with need and balance), 429 rate_limited (30 generations per 10 minutes per wallet), 503 studio_disabled.