---
title: "Update provider governance"
method: PUT
path: "/api/governance/providers/{provider_name}"
tags: ["Governance"]
---

# Update provider governance

`PUT /api/governance/providers/{provider_name}`

Updates governance settings (budget and rate limits) for a specific provider.

## Path parameters

- `provider_name` string, required

## Request body

- UpdateProviderGovernanceRequest — Request to update provider governance settings
  - `budgets` CreateBudgetRequest[], nullable — Full desired set of budgets. Pointer-to-slice semantics apply: omitting the field leaves budgets unchanged; sending an empty array `[]` removes all budgets; sending a non-empty array replaces all existing budgets with the provided set.
    - `max_limit` number, required
    - `reset_duration` string, required
    - `calendar_aligned` boolean — When true, usage resets at the start of each calendar period in UTC instead of on a rolling window from last reset. Only valid with reset durations that use day, week, month, or year suffixes (`d`, `w`, `M`, `Y`). For example `1d` resets at midnight UTC; `1w` at Monday 00:00 UTC; `1M` on the first day of each month; `1Y` on January 1. Sub-day durations (e.g. `1h`) cannot use calendar alignment.
  - `budget` UpdateBudgetRequest — Update budget request
    - `max_limit` number
    - `reset_duration` string
    - `calendar_aligned` boolean, nullable — Set to true or false to enable or disable calendar-aligned resets. Only valid with reset durations that use day, week, month, or year suffixes (`d`, `w`, `M`, `Y`); sub-day durations (e.g. `1h`, `30m`) are invalid with calendar alignment and the API rejects that combination. When enabling on an existing budget, current usage is reset to zero and last_reset snaps to the current period start.
  - `rate_limit` UpdateRateLimitRequest — Update rate limit request
    - `token_max_limit` integer
    - `token_reset_duration` string
    - `request_max_limit` integer
    - `request_reset_duration` string
  - `calendar_aligned` boolean, nullable — When true, all budgets reset at clean calendar boundaries. Omit to leave unchanged.

## Response `200`

Provider governance updated successfully

- ProviderGovernanceResponse — Response containing provider governance settings
  - `provider` string — Provider name
  - `budgets` Budget[] — Budget configurations for this provider. Each entry has a unique reset_duration.
    - `id` string, required
    - `max_limit` number, required — Maximum budget in dollars
    - `reset_duration` string, required — Reset duration (e.g., "30s", "5m", "1h", "1d", "1w", "1M")
    - `calendar_aligned` boolean — When true, resets align to calendar period boundaries in UTC (not rolling from last reset)
    - `last_reset` string, date-time, required
    - `current_usage` number, required
    - `team_id` string — Team that owns this budget, when the budget is team-scoped
    - `virtual_key_id` string — Virtual key that owns this budget, when the budget is virtual-key-scoped
    - `provider_config_id` integer — Provider config that owns this budget, when the budget is provider-config-scoped
    - `config_hash` string, nullable, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `budget` Budget — Budget configuration
    - `id` string, required
    - `max_limit` number, required — Maximum budget in dollars
    - `reset_duration` string, required — Reset duration (e.g., "30s", "5m", "1h", "1d", "1w", "1M")
    - `calendar_aligned` boolean — When true, resets align to calendar period boundaries in UTC (not rolling from last reset)
    - `last_reset` string, date-time, required
    - `current_usage` number, required
    - `team_id` string — Team that owns this budget, when the budget is team-scoped
    - `virtual_key_id` string — Virtual key that owns this budget, when the budget is virtual-key-scoped
    - `provider_config_id` integer — Provider config that owns this budget, when the budget is provider-config-scoped
    - `config_hash` string, nullable, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `rate_limit` RateLimit — Rate limit configuration
    - `id` string, required
    - `token_max_limit` integer
    - `token_reset_duration` string
    - `token_current_usage` integer, required
    - `token_last_reset` string, date-time, required
    - `request_max_limit` integer, nullable
    - `request_reset_duration` string, nullable
    - `request_current_usage` integer, required
    - `request_last_reset` string, date-time, required
    - `config_hash` string, nullable, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `calendar_aligned` boolean — When true, all budgets reset at clean calendar boundaries (midnight UTC for day, Monday for week, 1st for month, Jan 1 for year).

## Other responses

- `400` — Bad request
- `404` — Provider not found
- `500` — Internal server error

---

[API](https://skmtc.net/getbifrost/apis/bifrost-api.md) · [All operations](https://skmtc.net/getbifrost/apis/bifrost-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getbifrost/bifrost-api/revisions/f8cab88f64ea/schema)
