Skip to main content
PUT
/
v1beta
/
quota
/
keys
/
{api_key_id}
TypeScript
import { Factify } from "@factify/sdk";

const factify = new Factify({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await factify.usage.setAPIKeyQuota({
    apiKeyId: "<id>",
    body: {
      organizationId: "org_01h2xcejqtf2nbrexx3vqjhp41",
    },
  });

  console.log(result);
}

run();
{
  "quota": {
    "api_key_id": "key_01h2xcejqtf2nbrexx3vqjhp41",
    "current_usage": 123,
    "is_exceeded": true,
    "limit": 123,
    "remaining": 123
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer , where is your auth token.

Path Parameters

api_key_id
string
required

The API key ID (required).

Minimum string length: 1
Pattern: ^key_[0-9a-hjkmnp-tv-z]{26}$

Body

application/json

SetAPIKeyQuotaRequest creates or updates a per-key quota.

limit
integer<int32> | null

The limit for this key. Must be > 0.

organization_id
string | null

Optional: organization ID. If not provided, uses the caller's organization.

Pattern: ^org_[0-9a-hjkmnp-tv-z]{26}$
Example:

"org_01h2xcejqtf2nbrexx3vqjhp41"

Response

Success

SetAPIKeyQuotaResponse returns the updated key quota.

quota
quota · object

The updated key quota status.