Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.meshai.dev/llms.txt

Use this file to discover all available pages before exploring further.

API Keys

MeshAI uses Bearer token authentication. All API keys start with msh_.
curl https://api.meshai.dev/agents \
  -H "Authorization: Bearer msh_YOUR_API_KEY"

Key Types

TypePrefixPermissions
Adminmsh_Full access — manage agents, policies, billing, users
Proxymsh_Forward LLM requests through the proxy; read-only agent data
Read-onlymsh_Read agents, cost, anomalies; no write operations

Scopes

API keys are scoped to limit permissions:
ScopeAllows
registry:readList and get agents, teams
registry:writeRegister, update, delete agents and teams
telemetry:writeSend heartbeats and usage data
monitoring:readQuery monitoring overview
cost:readQuery cost endpoints
anomaly:readList and get anomalies
anomaly:writeAcknowledge, resolve anomalies
governance:readList policies, approvals, audit events
governance:writeCreate policies, decide approvals, classify risk
proxy:forwardForward LLM requests through the proxy
adminFull access — manage keys, agents, policies, billing
platform:adminTenant management (platform admins only)

Scope Restrictions

When creating a new API key, the scopes you can grant depend on your own key’s permissions:
Your scopeCan grant
platform:adminAny scope
adminAll scopes except platform:admin
OtherOnly scopes you already have
Attempting to grant a scope you don’t have returns 403 Forbidden.

Get Current Key Info

GET /auth/me
Returns the scopes and identity of the API key making the request. Useful for determining which scopes are available when creating new keys.
curl https://api.meshai.dev/auth/me \
  -H "Authorization: Bearer msh_YOUR_API_KEY"
{
  "success": true,
  "data": {
    "key_id": "01JABC123DEF456",
    "tenant_id": "01JXYZ789GHI012",
    "scopes": ["admin"]
  }
}

Create an API Key

Via Dashboard

Go to app.meshai.dev/settings/api-keys and click “Create API Key”. Select the scopes you need.

Via API

curl -X POST https://api.meshai.dev/auth/api-keys \
  -H "Authorization: Bearer msh_YOUR_ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ci-pipeline-key",
    "scopes": ["registry:read", "registry:write", "telemetry:write"],
    "expires_in_days": 90
  }'
{
  "success": true,
  "data": {
    "id": "01JABC123DEF456",
    "raw_key": "msh_abc123def456...",
    "key_prefix": "msh_abc1",
    "name": "ci-pipeline-key",
    "scopes": ["registry:read", "registry:write", "telemetry:write"],
    "expires_at": "2026-06-15T10:00:00Z",
    "created_at": "2026-03-17T10:00:00Z"
  }
}
The API key is shown once at creation time. Store it securely — you cannot retrieve it later.

Signup

Create a new MeshAI account:
curl -X POST https://api.meshai.dev/auth/signup \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@company.com",
    "password": "secure-password",
    "company_name": "Acme Corp"
  }'
{
  "success": true,
  "data": {
    "tenant_id": "tnt_abc123",
    "user_id": "usr_def456",
    "api_key": "msh_live_abc123def456",
    "message": "Account created. Check your email to verify."
  }
}

Login

Get a session token for dashboard access or exchange for an API key:
curl -X POST https://api.meshai.dev/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@company.com",
    "password": "secure-password"
  }'
{
  "success": true,
  "data": {
    "access_token": "eyJhbGciOi...",
    "token_type": "bearer",
    "expires_in": 3600,
    "tenant_id": "tnt_abc123"
  }
}

Key Rotation

Rotate keys without downtime by creating a new key before deleting the old one:
1

Create a new key

Create a new API key with the same scopes.
2

Update your agents

Deploy the new key to all agents and services.
3

Delete the old key

Once all agents are using the new key, delete the old one:
curl -X DELETE https://api.meshai.dev/auth/api-keys/key_old123 \
  -H "Authorization: Bearer msh_YOUR_ADMIN_KEY"