Skip to content

API Keys

API keys authenticate your SDK with the agent-os ingest API. Every event sent by the SDK includes the API key as a Bearer token.

Go to Settings > API Keys (/settings/api-keys) and click Create key.

Each key has:

  • Name — a label to identify the key (e.g., “production”, “staging”, “dev”)
  • Key value — a random 32-byte hex string, shown once at creation
from agent_os_sdk import AgentOS
aos = AgentOS(api_key="your-api-key")
Terminal window
export AGENT_OS_API_KEY="your-api-key"
import os
from agent_os_sdk import AgentOS
aos = AgentOS(api_key=os.environ["AGENT_OS_API_KEY"])
Authorization: Bearer <api-key>

API keys support optional expiration dates. Expired keys are automatically rejected by the API. Check the expires_at field to manage key lifecycles.

Delete a key from Settings > API Keys when it is no longer needed. This immediately revokes access — any SDK using that key will receive authentication errors.

  • Use separate keys for production and staging environments
  • Rotate keys periodically by creating a new key before deleting the old one
  • Never commit API keys to version control — use environment variables
  • Use descriptive names so you can identify which key is used where