Create an API key
In the Melius app, go to Team settings → Integrations and create a key. Each key:- Is shown once at creation — copy it before closing the dialog.
- Can be given an expiry, or set to never expire.
- Can be revoked at any time from the same page — revocation takes effect immediately.
Find your team id
x-team-id selects which team a request acts on. List your teams — note that /teams returns your memberships, so the team id is under .team.id:
x-team-id, requests default to the team the key was created in.
How keys are scoped
An API key acts on behalf of the user who created it. That has three consequences worth understanding:- It spans that user’s teams. A key can act on any team its creator is a member of by passing that team’s
x-team-id— not just the team it was created in. It can never reach a team its creator doesn’t belong to. - It’s capped at the creator’s role in each team. Permissions follow the user’s role in the team being acted on, exactly like the app — the key never grants more than that role. Owner/admin-only actions (managing members, billing, team settings) require that role in the acted-on team; a viewer can only read. Selecting a different team with
x-team-idnever escalates access. - It follows the creator’s membership. If the creating user leaves a team, the key loses access to that team.
Errors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired, or revoked API key. |
403 | The key’s user isn’t a member of the requested x-team-id, or their role there doesn’t permit the action. |
429 | Monthly request limit reached — retry after the Retry-After header. |
400 | Invalid request — including not enough credits to run a generation. |
Next steps
Quickstart
Run your first generation end to end.
API overview
The base URL, the async job model, and how generations work.