remagicaDocs home

Authentication and scopes

API keys, what they can reach, and the scopes and presets that limit them.

Every request sends an API key in the x-api-key header:

curl https://api.remagica.com/api/v1/models -H "x-api-key: rmg_..."

The MCP server that Claude connects to doesn't use API keys. You sign in with your Remagica account instead.

API keys

  • Create keys in the app, in Settings under API keys. Any member of a workspace can create one. The key starts with rmg_ and is shown once, so copy it then.
  • A key belongs to the workspace, not to you. It spends the workspace's credits, what it makes belongs to the workspace, and it keeps working if the person who made it leaves.
  • Nothing a key makes is personal. Projects, Library items and other things a key creates have workspace (team) visibility, because a key doesn't act as a person.
  • Edit or revoke a key from the same list. You can change your own keys; owners and admins can change anyone's.

Expiry and rotation

  • Expiry: when you create a key, pick never, 30, 90 or 365 days. The list shows how long a key has left. Once it expires, its calls get 401 UNAUTHORIZED with "This API key has expired. Create or rotate a key in Settings → API keys."
  • Rotation: open a key's ⋯ menu and pick Rotate. This creates a new key with the same name, scopes, allowlist and lifetime, and shows it once. The old key keeps working for 24 hours, or until it expires if that's sooner, so you have time to deploy the new one. A key can only be rotated once, and an expired key can't be rotated.

IP allowlists

You can limit a key to the addresses your servers call from. When you create or edit the key, list them one per line. Each line is an IPv4 or IPv6 address, or a CIDR range such as 203.0.113.0/24. A request from any other address gets 401 UNAUTHORIZED. Leave the list empty to allow any address.

API activity

Settings → API activity lists every request made with your workspace's keys: the time, key, method and path, status and IP. Request bodies and keys are never stored. You can filter by key, status and date, and export the list as CSV.

The list also records changes to keys and webhook endpoints. Owners and admins see everything; members see their own keys and their own changes. Events are kept for 90 days.

Each key's row in Settings also shows when it was last used, and from which IP.

What a key can reach

A key only reaches the public API: the endpoints in the API reference. It can never manage the workspace (members, groups, credit limits), billing, comments, the agent chat or the editor, whatever its scopes.

Within the public API, each endpoint needs one scope, shown on its reference page. A key holding that scope can call it.

  • An endpoint a key can't reach at all answers 404 NOT_FOUND, as if it didn't exist.
  • An endpoint the key's scopes don't cover answers 403 FORBIDDEN, naming the scope it needs: This key needs workflows:run.

A few read-only endpoints need no key at all: GET /pricing, GET /capabilities and GET /node-types.

Presets

When you create a key, start from a preset, then add or remove scopes if you need to. API is the one to start with. Full access can delete things, so give it only to code you trust with that.

PresetWhat it's forScopes
API (recommended)Generate, upload, make clips, run workflows and apps, and read the Library, templates and usage.models:list generations:cancel generations:read generations:submit uploads:write clips:read clips:submit workflows:read workflows:run workflows:cancel apps:read apps:run library:read templates:read usage:read
BuilderAPI, plus building: edit projects, workflows, templates, apps and the Library.models:list generations:cancel generations:read generations:submit uploads:write clips:read clips:submit workflows:read workflows:run workflows:cancel apps:read apps:run library:read templates:read usage:read projects:write workflows:write templates:write templates:use apps:write library:write
Generate onlyModels, generations and uploads only.models:list generations:cancel generations:read generations:submit uploads:write
Read-onlyRead everything a key can read, change nothing.apps:read brand:read clips:read generations:read library:read models:list projects:read references:read sprites:read templates:read usage:read webhooks:read workflows:read
UsageThe credit balance, history and usage, and the price list.usage:read models:list
Full access (sensitive)Every scope of the public API, deletes included. Never workspace admin or billing.apps:publish apps:read apps:run apps:write brand:delete brand:read brand:write clips:read clips:submit generations:cancel generations:read generations:submit library:delete library:read library:share library:write models:list projects:delete projects:read projects:share projects:write references:delete references:read references:write sprites:read sprites:write templates:delete templates:read templates:use templates:write uploads:write usage:read webhooks:read webhooks:write workflows:cancel workflows:delete workflows:read workflows:run workflows:write

Scopes

A scope is a resource and an action, like generations:submit. These are all the scopes, by resource.

Apps

ScopeAllows
apps:publishPublish apps for the workspace or the community.
apps:readList and read apps and their runs.
apps:runRun apps.
apps:writeCreate, edit, remix and delete apps.

Brand

ScopeAllows
brand:deleteDelete brand kits and moodboards.
brand:readList and read brand kits and moodboards.
brand:writeCreate and edit brand kits and moodboards.

Clips

ScopeAllows
clips:readList and read clip jobs, their clips and exports.
clips:submitStart clip jobs and re-export clips.

Generations

ScopeAllows
generations:cancelStop generations in progress.
generations:readList and read generations and characters.
generations:submitGenerate images, videos, audio and characters.

Library

ScopeAllows
library:deleteTrash, restore and permanently delete Library items.
library:readList and read Library items, folders and labels.
library:shareRead and change files' share links.
library:writeAdd, edit, move and label Library items and folders.

Models

ScopeAllows
models:listList models, their capabilities, node types and prices.

Projects

ScopeAllows
projects:deleteDelete project folders.
projects:readList projects and their folders.
projects:shareShare projects by link and copy shared ones.
projects:writeCreate, rename, duplicate and move projects and folders.

References

ScopeAllows
references:deleteDelete references.
references:readList references, their previews and bookmarks, and the thumbnail reference library.
references:writeAdd references and bookmark them.

Sprites

ScopeAllows
sprites:readList and read Sprite Studio games, characters, Sprite DNA, outfits, actions, takes, master candidates, presets, drift reports and exports, estimate runs and follow the live feed.
sprites:writeCreate and edit Sprite Studio games, characters, outfits, actions and presets, draw masters, views and takes (spending credits), approve takes, edit, redraw, add and remove frames, pin storyboard sketches, fix drift and export.

Templates

ScopeAllows
templates:deleteDelete templates.
templates:readList and read templates and presets.
templates:useStart projects from templates and keep presets' examples.
templates:writeSave projects as templates.

Uploads

ScopeAllows
uploads:writeUpload files, import them from links and sign their URLs.

Usage

ScopeAllows
usage:readRead the credit balance, history and usage.

Webhooks

ScopeAllows
webhooks:readList webhook endpoints and their deliveries.
webhooks:writeAdd, change and test webhook endpoints.

Workflows

ScopeAllows
workflows:cancelStop workflow runs and results.
workflows:deleteDelete workflows, revisions and results.
workflows:readRead workflows, revisions, runs and their files.
workflows:runRun workflows.
workflows:writeCreate and edit workflows and their revisions.

Keep keys safe

  • Keep keys on your server. Never ship one in a web page or a mobile app.
  • Give each integration its own key with the fewest scopes it needs, so you can revoke one without breaking the rest.
  • If a key leaks, revoke it in Settings straight away and create a new one.

On this page