Documentation
Start Here

API Keys

How Agent Mag API keys should be created, scoped, rotated, and used.

Status: Preview.

Agent Mag API keys authenticate hosted APIs. Keys belong to a workspace and should be managed from the dashboard.

code
Authorization: Bearer $AGENTMAG_API_KEY

Key Rules

RuleRequirement
ScopeKeys should be scoped by workspace and environment.
StorageStore keys in environment variables or a secret manager.
RotationRotate keys from the dashboard when a teammate leaves or a key leaks.
LoggingNever log full keys. Show only a short fingerprint.
BillingUsage is attributed to the key, workspace, endpoint, and job.

On this page