Field | Type | Required | Description | Example |
---|---|---|---|---|
key |
str | ✔️ | The key to verify | sk_1234 |
api_id |
Optional[str] | ➖ | The id of the api where the key belongs to. This is optional for now but will be required soon. The key will be verified against the api's configuration. If the key does not belong to the api, the verification will fail. |
api_1234 |
authorization |
Optional[models.Authorization] | ➖ | Perform RBAC checks | |
ratelimit |
Optional[models.V1KeysVerifyKeyRequestRatelimit] | ➖ | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. Use 'ratelimits' with [{ name: "default", cost: 2}] |
|
ratelimits |
List[models.RatelimitsModel] | ➖ | You can check against multiple ratelimits when verifying a key. Let's say you are building an app that uses AI under the hood and you want to limit your customers to 500 requests per hour, but also ensure they use up less than 20k tokens per day. |
[ { "name": "requests", "limit": 500, "duration": 3600000 }, { "name": "tokens", "limit": 20000, "duration": 86400000 } ] |