ManifoldGen API keys can be limited to specific scopes, expire, and be rotated or revoked through the API. The account's original sk-mg- key keeps working with every usage scope, so existing integrations do not change.

Authentication

Send the key as Authorization: Bearer sk-mg-... or X-API-Key: sk-mg-.... Keys are stored as SHA-256 hashes. The secret is returned once, when a key is created or rotated, and cannot be retrieved later.

Scopes

GET https://manifoldgen.com/api/keys/scopes (no key needed) lists the catalog:

POST /api/service is scoped by service: image services need generate:image, video services generate:video, music, sfx and speech generate:audio, lora_training needs train:lora, and production tools need generate:tools.

Management key

A key with keys:manage can list, create, rotate and revoke keys, and does nothing else unless it was also given usage scopes. Ordinary keys, including the original account key used from scripts, get 403 insufficient_scope on /api/keys. The signed-in account page can also manage keys. Create the management key there, store it separately from keys used by workers.

Endpoints

curl -X POST https://manifoldgen.com/api/keys \
  -H "Authorization: Bearer $MANAGEMENT_KEY" -H "Content-Type: application/json" \
  -d '{"name":"render worker","scopes":["generate:video","jobs:read"],"expires_in_days":90}'

Errors

Errors are JSON: {"error":{"code","message","hint","required_scope"}}; required_scope appears on scope errors.

Frequently Asked Questions

Can a key create keys with more scopes than it has?

Only management keys and the signed-in account can create keys, and ordinary keys cannot reach the endpoint at all.

Does rotating the original account key affect scoped keys?

No. The account page rotation still replaces the original key immediately; scoped keys are separate.

How do I roll a key without downtime?

Rotate with grace_seconds (for example 3600), deploy the new secret, and the old key expires on its own.