Unkey · Schema

V2KeysUpdateCreditsRequestBody

APIKeysRate LimitingAuthenticationDeveloper PlatformAccess ControlIdentityAnalytics

Properties

Name Type Description
keyId string The ID of the key to update (begins with `key_`). This is the database reference ID for the key, not the actual API key string that users authenticate with. This ID uniquely identifies which key's cre
value integernull The credit value to use with the specified operation. The meaning depends on the operation: for 'set', this becomes the new remaining credits value; for 'increment', this amount is added to current cr
operation string Defines how to modify the key's remaining credits. Use 'set' to replace current credits with a specific value or unlimited usage, 'increment' to add credits for plan upgrades or credit purchases, and
View JSON Schema on GitHub

JSON Schema

unkey-v2keysupdatecreditsrequestbody-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/V2KeysUpdateCreditsRequestBody",
  "title": "V2KeysUpdateCreditsRequestBody",
  "type": "object",
  "required": [
    "keyId",
    "operation"
  ],
  "properties": {
    "keyId": {
      "type": "string",
      "description": "The ID of the key to update (begins with `key_`). This is the database reference ID for the key, not the actual API key string that users authenticate with. This ID uniquely identifies which key's credits will be updated.",
      "example": "key_2cGKbMxRyIzhCxo1Idjz8q",
      "minLength": 3
    },
    "value": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64",
      "minimum": 0,
      "maximum": 9223372036854776000,
      "description": "The credit value to use with the specified operation. The meaning depends on the operation: for 'set', this becomes the new remaining credits value; for 'increment', this amount is added to current credits; for 'decrement', this amount is subtracted from current credits.\n\nSet to null when using 'set' operation to make the key unlimited (removes usage restrictions entirely). When decrementing, if the result would be negative, remaining credits are automatically set to zero. Credits are consumed during successful key verification, and when credits reach zero, verification fails with `code=USAGE_EXCEEDED`.\n\nRequired when using 'increment' or 'decrement' operations. Optional for 'set' operation (null creates unlimited usage).\n",
      "example": 1000
    },
    "operation": {
      "type": "string",
      "enum": [
        "set",
        "increment",
        "decrement"
      ],
      "x-speakeasy-unknown-values": "allow",
      "description": "Defines how to modify the key's remaining credits. Use 'set' to replace current credits with a specific value or unlimited usage, 'increment' to add credits for plan upgrades or credit purchases, and 'decrement' to reduce credits for refunds or policy violations.\n",
      "example": "set"
    }
  },
  "additionalProperties": false
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/unkey-v2keysupdatecreditsrequestbody"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.