Saltar al contenido

Inicio de sesión y claves de API

Cómo inician sesión en demi las personas, los scripts y los clientes de IA, y cómo gestionar las claves con seguridad.

DisponibleActualizado: 9 de noviembre de 2026

El texto de esta página está en inglés (también disponible en alemán).

demi knows three ways to sign in. All three end in the same principle: whoever signs in acts with exactly one person's permissions, never more.

People in the terminal
Browser sign-in through the OAuth device flow: demi auth login
Scripts and CI
A personal API key as a bearer token
AI clients
OAuth 2.1 through the MCP server; every person signs in themselves

Create an API key

An API key always belongs to one person and acts with their permissions. You create it in the app or in the CLI.

Text
Settings › API keys › New key  Name:        CI export  Permissions: read, write or run agents  Expiry:      never, 30, 90 or 365 days

Use a key

Send the key as a bearer token in the Authorization header:

Terminal
curl https://api.godemi.com/v1/me/profile \  -H "Authorization: Bearer <your-api-key>"

Keys start with demi_pat_. That lets secret scanners spot one if it ever lands in a repository.

In the CLI

Terminal
printf '%s' "$DEMI_API_KEY" | demi auth login --api-key-stdin

With --api-key-stdin the key lands neither in your shell history nor in the process list. The CLI can also read it from the DEMI_API_KEY environment variable.

Pick a tenant

A key acts in the tenant it was created in. If you are a member of several tenants, pick another one per request with the x-demi-tenant-id header:

Terminal
curl https://api.godemi.com/v1/tenants/current \  -H "Authorization: Bearer <your-api-key>" \  -H "x-demi-tenant-id: <workspace-id>"

In the CLI you pick the tenant with demi config set-tenant @your-workspace, or per call with --tenant @your-workspace.

Expiry and revocation

  • The API rejects expired or revoked keys with 401.
  • When a person's account is deactivated, their keys stop working too.
  • You can revoke any key at any time in the app under Settings › API keys.

Sign-in for AI clients

AI clients need no key. They sign in to the MCP server through OAuth 2.1: the client opens the demi sign-in in your browser, you sign in and pick your tenant. The token stays in the client, not in a config file. More: MCP server.

Recommendations

  • One key per script. Then you can revoke one without disturbing the others.
  • The shortest expiry that fits. 90 days is a good value for most scripts.
  • Only the permissions it needs. An export needs no write access.
  • Never in code, never in a prompt. Keys belong in a secret manager or your CI's secrets.

Tu configurador

Aún no hay casos de uso

Tu configurador todavía está vacío

Añade un caso de uso desde cualquier tarjeta o página de caso y mira lo que aporta al año, con el cálculo. Gratis, sin registro, sin compromiso: pruébalo y cambia cada cifra.

Ver casos de uso