await unkey.keys.updateRemaining({
  keyId: "xyz_AS5HDkXXPot2MMoPHD8jnL",
  value: 300,
  op: "set"
});
{
  result: {
    "remaining": 300
  }
}

Request

keyId
string
required

The ID of the key you want to update.

op
string
required

Name of the operation to perform. The options are increment, decrement and set.

value
integer
required

The number to increment, decrement or set the remaining usage of a key.

Response

result
remaining
integer | null
required

The remaining usage of the key.

await unkey.keys.updateRemaining({
  keyId: "xyz_AS5HDkXXPot2MMoPHD8jnL",
  value: 300,
  op: "set"
});
{
  result: {
    "remaining": 300
  }
}