---
title: "Get virtual key quota"
method: GET
path: "/api/governance/virtual-keys/quota"
tags: ["Governance"]
---

# Get virtual key quota

`GET /api/governance/virtual-keys/quota`

Returns the overall budget and rate limit quota for the authenticated virtual key,
as well as per-provider and per-model budgets and rate limits (with current usage).
Each budget also carries the actual per-model usage for its current cycle.
This is a self-service endpoint - no admin authentication required.
The virtual key value itself (provided via header) is the credential.

## Response `200`

Successful response

- VirtualKeyQuotaResponse — Virtual key quota response (self-service, no admin auth required)
  - `virtual_key_name` string, required — Name of the virtual key
  - `is_active` boolean, required — Whether the virtual key is active
  - `budgets` object[], nullable, required — Overall budget quotas for this virtual key. Each budget also carries the actual per-model spend (from request logs) accumulated in its current cycle.
    - `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
    - `per_model_usage` object[], required — Per-model actual usage within this budget's current cycle
      - `model` string, required — The model name
      - `provider` string — Provider that served the model; omitted when unknown
      - `total_requests` integer, required — Number of requests to this model in the cycle
      - `total_tokens` integer, required — Total tokens consumed by this model in the cycle
      - `total_cost` number, required — Total cost in dollars for this model in the cycle
  - `rate_limit` RateLimit, required — 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
  - `provider_configs` VirtualKeyProviderConfig[], nullable, required — Per-provider budget quotas and rate limits (provider-level splits and limits)
    - `id` integer, required
    - `virtual_key_id` string, required
    - `provider` string, required
    - `weight` number, nullable, required — Weight for provider load balancing. Null means excluded from weighted routing.
    - `allowed_models` string[], required
    - `blacklisted_models` string[], required
    - `allow_all_keys` boolean, required
    - `rate_limit_id` string
    - `budgets` Budget[] — Budget quotas assigned to this provider config
      - `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
    - `keys` TableKey[], nullable, required — Associated API keys for this provider config. **Always null in the quota endpoint** — keys are intentionally not loaded here to keep the response lean and avoid exposing sensitive credentials. Use the admin virtual-key API to inspect actual key assignments.
      - `id` integer
      - `name` string
      - `provider_id` integer
      - `provider` string
      - `key_id` string
      - `value` object — Environment variable configuration
        - `value` string
        - `env_var` string
        - `from_env` boolean
      - `models` string[]
      - `weight` number, nullable
      - `enabled` boolean, nullable
      - `use_for_batch_api` boolean, nullable
      - `created_at` string, date-time
      - `updated_at` string, date-time
      - `config_hash` string, nullable
      - `azure_endpoint` object, nullable — Environment variable configuration
        - `value` string
        - `env_var` string
        - `from_env` boolean
      - `azure_client_id` object, nullable — Environment variable configuration
        - `value` string
        - `env_var` string
        - `from_env` boolean
      - `azure_client_secret` object, nullable — Environment variable configuration
        - `value` string
        - `env_var` string
        - `from_env` boolean
      - `azure_tenant_id` object, nullable — Environment variable configuration
        - `value` string
        - `env_var` string
        - `from_env` boolean
      - `vertex_project_id` object, nullable — Environment variable configuration
        - `value` string
        - `env_var` string
        - `from_env` boolean
      - `vertex_project_number` object, nullable — Environment variable configuration
        - `value` string
        - `env_var` string
        - `from_env` boolean
      - `vertex_region` object, nullable — Environment variable configuration
        - `value` string
        - `env_var` string
        - `from_env` boolean
      - `vertex_auth_credentials` object, nullable — Environment variable configuration
        - `value` string
        - `env_var` string
        - `from_env` boolean
      - `bedrock_access_key` object, nullable — Environment variable configuration
        - `value` string
        - `env_var` string
        - `from_env` boolean
      - `bedrock_secret_key` object, nullable — Environment variable configuration
        - `value` string
        - `env_var` string
        - `from_env` boolean
      - `bedrock_session_token` object, nullable — Environment variable configuration
        - `value` string
        - `env_var` string
        - `from_env` boolean
      - `bedrock_region` object, nullable — Environment variable configuration
        - `value` string
        - `env_var` string
        - `from_env` boolean
      - `bedrock_arn` object, nullable — Environment variable configuration
        - `value` string
        - `env_var` string
        - `from_env` boolean
  - `model_configs` object[], required — Per-model budget quotas and rate limits configured for this virtual key (model-level limits). Always an array — the endpoint fails closed (500) rather than returning null when the model-config lookup errors.
    - `model_name` string, required — The model this usage applies to
    - `provider` string — Provider this model config is scoped to; omitted when it applies to all providers
    - `budgets` Budget[], nullable — Budget quotas for this model
      - `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

## Other responses

- `401` — Missing or invalid virtual key
- `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/versions/f8cab88f64ea/schema)
