---
title: "Set API key quota"
method: PUT
path: "/v1beta/quota/keys/{api_key_id}"
tags: ["Usage"]
---

# Set API key quota

`PUT /v1beta/quota/keys/{api_key_id}`

Creates or updates a per-key quota limit. The key will be enforced independently of the organization quota.

## Path parameters

- `api_key_id` string, required — The API key ID (required).

## Request body

- object — SetAPIKeyQuotaRequest creates or updates a per-key quota.
  - `limit` integer, nullable — The limit for this key. Must be > 0.
  - `organization_id` string, nullable — Optional: organization ID. If not provided, uses the caller's organization.

## Response `200`

Success

- SetAPIKeyQuotaResponse — SetAPIKeyQuotaResponse returns the updated key quota.
  - `quota` APIKeyQuota — APIKeyQuota represents per-key quota status.
    - `api_key_id` string — The API key ID.
    - `current_usage` integer — Current usage for this key in the billing period.
    - `is_exceeded` boolean — Whether this key's quota is exceeded. Only true when limit is set and exceeded.
    - `limit` integer, nullable — The configured limit for this key. Not set means no explicit key limit.
    - `remaining` integer — Remaining requests for this key. Only meaningful when limit is set.

## Other responses

- `400` — Invalid request parameters
- `401` — Authentication failed - missing or invalid API key
- `403` — Authorization failed - valid key but insufficient permissions
- `404` — Resource not found
- `429` — Too many requests
- `500` — Internal server error

---

[API](https://skmtc.net/factify-inc/apis/factify-api.md) · [All operations](https://skmtc.net/factify-inc/apis/factify-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/factify-inc/factify-api/versions/8baabdfb82bf/schema)
