---
title: "Update API key credit limit"
method: POST
path: "/v1/api-keys/limit"
tags: ["API key"]
---

# Update API key credit limit

`POST /v1/api-keys/limit`

Change the lifetime credit ceiling of an API key. Acts on the key that authenticates this request unless target is OTHER. Use set to pin an absolute limit, increase or decrease to adjust it by a number of credits, multiply or divide to scale it, or remove to make the key unlimited. Once a key's usage reaches its limit it can no longer authenticate until the limit is raised or removed.

<span>⚡ <strong>Rate limit:</strong> 30 requests per 1 minute</span>

<span>💰 <strong>Cost:</strong> FREE! No credits are charged for this API.&nbsp;<span title="Pricing shown is default pricing. Actual pricing may vary.">ⓘ</span></span>

## Request body

- object
  - `apiKey` string, required — Your Fiber API key
  - `target` 'SELF' | 'OTHER' — Which key to act on. SELF acts on the key that authenticates this request. OTHER acts on a different key in your organization, supplied in targetApiKey.
  - `targetApiKey` string, nullable — The key to act on when target is OTHER. Must belong to your organization. You can pass prefix, id, or the raw key. Omit when target is SELF.
  - `operation` 'set' | 'increase' | 'decrease' | 'multiply' | 'divide' | 'remove', required — set: pin an absolute credit ceiling. increase/decrease: adjust the current ceiling by a number of credits. multiply/divide: scale the current ceiling by a factor. remove: make the key unlimited. increase, decrease, multiply, and divide have no effect on an already-unlimited key; use set to establish a ceiling first.
  - `credits` number, nullable — The credit amount. Required for set (zero or greater), increase, and decrease (greater than zero); ignored otherwise.
  - `factor` number, nullable — The factor to scale the current ceiling by. Required for multiply and divide; ignored otherwise.

## Response `200`

Default Response

- object
  - `output` object, required
    - `id` string, required — id of your api key. This or prefix can be used to identify the key.
    - `name` string, required — Name of your api key.
    - `prefix` string, required — Non secret prefix of your api key. Used for identification.
    - `expiresAt` string, date-time, nullable, required — When the key expires. Null implies key never expires.
    - `maxCredits` number, nullable, required — The lifetime credit ceiling for this key. Null implies key has no per-key credit limit.
    - `creditsUsed` number, required — Credits consumed by this key so far over its lifetime.
    - `createdAt` string, date-time, required — When the key was created, as an ISO 8601 timestamp.
    - `isRevoked` boolean, required — Whether the key has been revoked. Revoked keys can no longer authenticate. Only ever true in listings that include revoked keys.
  - `chargeInfo` union, required
    - object — Credits were charged immediately for this operation
      - `method` 'charged-now', required
      - `creditsCharged` number, required
      - `lowCreditAlert` object, nullable — Contains a link to get more credits, a warning message, and the remaining credit count.
        - `getMoreCreditsUrl` string, uri, required — URL to top up credits or restart billing cycle to get fresh credits.
        - `message` string, required — Human-readable credits warning.
        - `availableCredits` number, required — Number of credits remaining in the current billing period.
    - object — Credits will be charged after the operation completes
      - `method` 'charging-later', required
      - `message` string, required
      - `lowCreditAlert` object, nullable — Contains a link to get more credits, a warning message, and the remaining credit count.
        - `getMoreCreditsUrl` string, uri, required — URL to top up credits or restart billing cycle to get fresh credits.
        - `message` string, required — Human-readable credits warning.
        - `availableCredits` number, required — Number of credits remaining in the current billing period.
    - object — Credits that were charged for an asynchronous operation
      - `method` 'charged-for-async-process', required
      - `creditsCharged` number, required
      - `message` string, required
      - `lowCreditAlert` object, nullable — Contains a link to get more credits, a warning message, and the remaining credit count.
        - `getMoreCreditsUrl` string, uri, required — URL to top up credits or restart billing cycle to get fresh credits.
        - `message` string, required — Human-readable credits warning.
        - `availableCredits` number, required — Number of credits remaining in the current billing period.
    - object — No credits were charged for this operation
      - `method` 'free', required
      - `message` string, required
      - `lowCreditAlert` object, nullable — Contains a link to get more credits, a warning message, and the remaining credit count.
        - `getMoreCreditsUrl` string, uri, required — URL to top up credits or restart billing cycle to get fresh credits.
        - `message` string, required — Human-readable credits warning.
        - `availableCredits` number, required — Number of credits remaining in the current billing period.
    - object — Credits were refunded for this operation
      - `method` 'credits-refunded', required
      - `creditsRefunded` number, required
      - `message` string, required
      - `lowCreditAlert` object, nullable — Contains a link to get more credits, a warning message, and the remaining credit count.
        - `getMoreCreditsUrl` string, uri, required — URL to top up credits or restart billing cycle to get fresh credits.
        - `message` string, required — Human-readable credits warning.
        - `availableCredits` number, required — Number of credits remaining in the current billing period.
  - `warnings` object[], nullable — Warnings about extraneous fields in request
    - `field` string, required — Full path to extraneous field (e.g., 'searchParams.ExtraField')
    - `message` string, required — Warning message
  - `advice` string[], nullable — Tips, recommendations, and suggestions for using this API effectively.

## Other responses

- `400` — Default Response
- `401` — Default Response
- `402` — Default Response
- `403` — Default Response
- `404` — Default Response
- `422` — Default Response
- `429` — Default Response
- `500` — Default Response
- `503` — Default Response

---

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