Projects API

Manage projects, project routing, budgets, and spend programmatically

The Projects API lets you manage your organization’s projects programmatically: create and delete them, attach a project-scoped routing policy, set spending limits, and read spend rollups. Use it when you drive Gateway configuration from infrastructure-as-code (Pulumi, Terraform, scripts) or any automation that shouldn’t depend on the dashboard. Every operation is available over the API, including DELETE, and updates are stable for diffing.

All requests go to https://api-gateway.merge.dev with Authorization: Bearer mgmt_<your_management_key>, plus Content-Type: application/json on any request that has a JSON body. IDs are Merge UUIDs and the organization is derived from your key.

Authentication and scopes

Create a management key in the dashboard under Settings → API keys → Management keys; it is shown once at creation. Operations are scope-gated: manage_projects grants the project and routing endpoints, read_usage grants the usage endpoints. Neither is granted to management keys by default, so mint a key with the scopes you need. A management key acts only on its own organization and cannot call the gateway’s model endpoints.

Data models

Each area has its own reference page.

ModelWhat it is
ProjectA unit of organization: owns the routing policy, budget, and scoped API keys below
Project routingAn optional routing policy scoped to one project, overriding the org default
BudgetA per-project spend limit, enforced hard or alerted soft
UsageOrg-wide and per-project spend rollups with per-model breakdowns

How requests attribute to a project

Requests authenticated with a project-scoped API key attribute to that project automatically, and the project’s routing policy and budget apply. Create project-scoped keys with the Management API keys endpoints by passing project_id.

Quick example

$curl -X POST https://api-gateway.merge.dev/v1/projects \
> -H "Authorization: Bearer mgmt_<your_management_key>" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "Field Mappings",
> "uses_organization_default_routing": false,
> "routing_policy": {
> "strategy": "PRIORITY",
> "priority_order": [
> { "model": "openai/gpt-5.5", "priority": 1 },
> { "model": "anthropic/claude-opus-4-8", "priority": 2 }
> ]
> },
> "budget_config": {
> "amount": 100,
> "period": "monthly",
> "enforcement_mode": "hard_limit",
> "alert_thresholds": [80, 90]
> }
> }'

Full endpoint contracts live in the Management API reference.