Management API

Administer your org programmatically: API keys, projects, and usage

The Management API lets you administer your organization programmatically, built for infrastructure-as-code (Pulumi, Terraform, scripts) as much as for one-off automation:

  • API keys: issue a key per customer or employee, rotate keys, attach per-key spend limits. Walkthrough: Management API keys
  • Projects: create and delete projects, attach a project-scoped routing policy, set spending limits. Walkthrough: Projects API
  • Organization usage: org-wide and per-project spend rollups with per-model breakdowns

Base URL

https://api-gateway.merge.dev

Authentication

Authenticate with a management key as a bearer token. Create one in the dashboard under API keys → Management keys. It is shown once at creation.

Authorization: Bearer mgmt_<your_management_key>

A management key acts only on its own organization and cannot call the gateway’s model endpoints. Operations are scope-gated: manage_keys for API-key management, manage_projects for projects and their routing, manage_routing for org-level routing policies, and read_usage for usage endpoints. Newly minted management keys carry all four scopes; keys minted before a scope was introduced need a re-mint to gain it.