Projects

Organize workloads, set budgets, and control routing at the project level.

Projects are the organizational unit in Gateway. Every project has a unique slug, its own budget, routing policy, and compression settings. Requests are scoped to a project via the X-Project-Id header. Projects are the foundation — routing, compression, budgeting, and spend tracking all attach to a project.


What you can do with projects

  • Set budgets — dollar limit + billing period; Gateway tracks spend and alerts or blocks at thresholds. See Cost Governance and Savings for details.
  • Configure routing — org default or project-specific override. See Routing Policies.
  • Configure compression — org default or project-specific override. See Context Compression.
  • Track spend — per-project view in the dashboard; managed vs BYOK spend, model/provider breakdowns.
  • Apply tags — attach key-value tags via headers or API keys; drive tag-based routing rules and spend tracking by tag.

Creating a project

Create a project from the Gateway dashboard using the four-step wizard:

  1. Details — name, slug (unique per org, used as the X-Project-Id value), and optional description.
  2. Budget — amount (USD), period (daily / weekly / monthly / quarterly / yearly), enforcement mode (soft / hard), and alert thresholds. You can skip this step and add a budget later.
  3. Routing — use the org default or set a project-specific override; choose a fallback or intelligent strategy.
  4. Compression — use the org default or set a project-specific override; disabled, context window only, or cost optimization with a target ratio slider.

All settings are editable after creation. Projects can be deactivated without deleting.


Scoping requests to a project

Pass the X-Project-Id header with the project slug. Without it, requests use org-level defaults.

1from merge_gateway import MergeGateway
2
3client = MergeGateway(api_key="YOUR_API_KEY")
4
5response = client.responses.create(
6 model="openai/gpt-5.2",
7 input=[
8 {"type": "message", "role": "system", "content": "You are a helpful programming tutor. Explain the concepts clearly with practical examples."},
9 {"type": "message", "role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
10 ],
11 extra_headers={"X-Project-Id": "my-project-slug"},
12)
13
14print(response.output[0].content[0].text)

Budgets

Each project can have a budget that caps spend for a billing period. How Gateway enforces that cap depends on the enforcement mode:

Enforcement ModeBehaviorUse Case
Soft LimitAlerts at thresholds; requests continueVisibility without disruption
Hard LimitBlocks requests (HTTP 402) once exceededStrict cost control

Alert thresholds default to 50%, 80%, and 90% of the budget. The dashboard shows color-coded progress bars: blue (< 80%), yellow (80–100%), red (100%+).

For complete coverage of budgets, billing, and cost-saving strategies, see Cost Governance and Savings.


Tags

Tags are key-value pairs defined at the org level. They serve two purposes:

  • Routing — use tags as conditions in tag-based routing rules. For example, route requests tagged customer_tier: enterprise to a quality-first policy. See Routing Policies for configuration details.
  • Spend tracking — view spend broken down by tag in the dashboard’s “By Tag” tab.

The dashboard includes quick-fill templates for common tags like customer_tier, environment, and region.


FAQ

Yes. Separate projects by environment, team, or product feature to get independent budgets, routing, and spend tracking for each.

Requests use org-level defaults for routing and compression. Spend is tracked at the org level and not attributed to any project.

No. The slug is used in API headers and spend tracking and cannot be changed. All other settings are editable.

Yes. Deactivating a project stops it from accepting requests but retains its configuration and history.

Projects define static configuration — budget, routing policy, compression settings. Tags are dynamic per-request metadata used for routing decisions and spend tracking within a project.


Next steps