Skip to content
Docs

Authentication

Every request to the REST API is authenticated with an API key passed as a Bearer token.

Creating an API key

  1. Go to Account → API Keys in the console.
  2. Click Create API Key.
  3. Give it a descriptive name (e.g. "Deploy pipeline (production)").
  4. Copy the key immediately. It is shown only once and stored hashed.

Keys start with ek_live_ and can be created with an optional expiry (30 days, 90 days, 1 year or never). Keys can be revoked at any time; revocation takes effect immediately.

Warning

Keys are account-wide. An API key carries full access to the account that created it, so treat it like a password. Never commit keys to version control, and prefer one key per integration so individual keys can be revoked without breaking everything else.

Making authenticated requests

Pass the key in the Authorization header:

Terminal
curl https://edge.network/api/compute/vms \
  -H "Authorization: Bearer ek_live_abc123def456..."

A missing, malformed, revoked or expired key returns 401:

HTTP
HTTP/1.1 401 Unauthorized

{
  "error": "Invalid or expired API key",
  "code": "AUTHENTICATION_ERROR"
}

Managing keys via the API

API keys can themselves be managed programmatically (using an existing key or console session):

EndpointDescription
GET /api/account/keysList keys. Returns name, prefix, last-used and expiry (never the secret).
POST /api/account/keysCreate a key. Body: { name, expiresIn? }, where expiresIn is e.g. 30d, 90d, 1y or never. The full secret is returned once.
PATCH /api/account/keys/:keyIdRename a key
DELETE /api/account/keys/:keyIdRevoke a key immediately

Narrower access for agents and tools

API keys are all-or-nothing. If you're granting access to an AI agent or third-party tool and want per-product permissions and spending caps, use an agent access code (ea_live_...) with the Agent API instead.

CredentialPrefixScopeUsed with
API keyek_live_Full account accessREST API (/api/*), CLI
Agent access codeea_live_Per-product permissions, budget capsAgent API (/agent/*)

Something unclear or out of date? Tell us, or read this page as Markdown.