Skip to content
Skip to Content

Authentication

API keys for scripts, CI and agents, what a key may do, and the other ways a call is signed in.

Every call to the API sends a credential in the Authorization header:

curl https://openpanel.sh/api/v1/me \
  -H "Authorization: Bearer $OPENPANEL_TOKEN"

A call without one, or with one that has been revoked or has expired, answers 401.

CredentialLooks likeMade byWorks in
API keyopk_ and 43 charactersA signed-in person, with openpanel keys create or the APIThe organization it was made in
CLI tokenopc_…openpanel login, approved by a person in the browserEvery organization of that person; OpenPanel-Organization picks one

The console's own session also works, from the console only: a change made with it must come from the console's own pages.

AI clients connect to the MCP server instead of the API. They sign in with OAuth as the person who approves them, or send an API key the same way as above.

API keys

An API key is for a script, a CI pipeline or an AI agent: something that runs without a person at a browser.

  • It acts as the person who made it. Each call reads that person's role and project access as they are at that moment. If their access is lowered, the key's is too; if they leave the organization, the key stops working and is revoked.
  • Its scope is a ceiling: view reads, deploy also changes and deploys services, admin also deletes and manages access. A key never does more than its creator could, whatever its scope.
  • It can be limited to some projects. Such a key sees only those projects, and cannot do anything that belongs to the whole organization, such as listing servers or reading the audit log.
  • It can expire on a date you choose.
  • It is shown once. OpenPanel keeps only a hash of it. If you lose a key, revoke it and make a new one.
  • A key cannot make or revoke keys. Only a signed-in person can, so a leaked key cannot make itself a successor.

Each person can have 50 active keys in an organization.

Make a key

In the console, open Organization settings, then API keys, and choose Create key: a name, a scope, optionally some projects and an end date. The key is shown once.

From the CLI, signed in as yourself with openpanel login (see Sign in):

openpanel keys create --name "GitHub Actions" --scope deploy --project shop --expires 2027-06-30

--project limits the key to that project (repeat it for more); leave it out for a key that reaches every project you can. The key is printed once; store it right away, for example as a secret of your CI.

The same from the API, with the CLI's token (opc_…, from openpanel login):

curl https://openpanel.sh/api/v1/api-keys \
  -H "Authorization: Bearer $OPENPANEL_CLI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "GitHub Actions", "scope": "deploy", "projectIds": ["0193b7a0-…"], "expiresAt": "2027-06-30T00:00:00Z" }'

The answer holds the key in key, the only time it is ever shown, and the key's record in apiKey:

{
  "apiKey": {
    "id": "01a23325-b8ff-7007-81ee-6d86df4d57e3",
    "name": "GitHub Actions",
    "prefix": "opk_8JoAsdp1",
    "scope": "deploy",
    "projectIds": ["0193b7a0-…"],
    "expiresAt": "2027-06-30T00:00:00.000Z",
    "lastUsedAt": null,
    "revokedAt": null,
    "createdAt": "2026-12-01T19:47:19.929Z",
    "createdBy": "…",
    "creatorName": "Rūta Kazlauskė",
    "creatorEmail": "[email protected]"
  },
  "key": "opk_…"
}

See and revoke keys

openpanel keys
openpanel keys revoke 01a23325-b8ff-7007-81ee-6d86df4d57e3

openpanel keys lists your own keys with their scope, projects and when each was last used; the organization's owner and admins see everyone's, so they can revoke any of them. A revoked key stops working at once. In the API: List API keys and Revoke an API key.

Making and revoking a key are written to the audit log, and every change a key makes is recorded with the person behind it.

What a call may do

A call is allowed when the person's access to the project, capped by the key's scope, is enough:

ToNeeds
See projects, services, deployments, variables and domainsview
Create services, change their settings, set variables, deploy, roll back, add domains and volumesdeploy
Delete projects and services, remove volumes, rename a project or make it private, give people accessadmin on that project
Create a projectdeploy in the organization
Read the audit log, and see and revoke everyone's keysOwner or admin of the organization
Make an API keyAny member, signed in as themselves

A person's access to a project comes from their role, unless they were given their own access to that project; see Per-project access. A project the caller cannot see at all answers 404, as if it did not exist, so a private project's name does not leak. When the caller can see it but may not make the change, the answer is 403 with a sentence such as "This API key's scope is view; this needs deploy."

Keep keys safe

  • Keep a key in your CI's secrets or a secret manager, never in a repository.
  • Give each place its own key, with the lowest scope that does the job and only the projects it needs, so you can revoke one without touching the others.
  • Set an expiry on keys you make for a one-off job.