Skip to main content
Generate an API key from the Datagate dashboard. Keys start with dg_live_ and are shown once — store it securely.
from datagate import DatagateClient

client = DatagateClient(api_key="dg_live_...")

JWT Access Token

If you authenticate via the login flow (email + 2FA), you receive a 15-minute JWT access token. This is primarily used by the dashboard, but SDKs accept it too:
client = DatagateClient(access_token="eyJhbGciOiJIUzI1NiJ9...")
Both methods use the same Authorization: Bearer <credential> header. The SDK does not handle login or token refresh — the caller provides a valid credential.

Key Management

ActionEndpointNotes
Generate/rotatePOST /v1/auth/api-keysReplaces any existing key. Raw key shown once.
RevokeDELETE /v1/auth/api-keysDeletes key, no replacement.
Manage your API key from the dashboard under API Keys.

Environment Variables

For MCP servers and CI/CD, set your key as an environment variable:
export DATAGATE_API_KEY="dg_live_..."