Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 22.5 KB

v1keysverifykeyrequest.md

File metadata and controls

14 lines (11 loc) · 22.5 KB

V1KeysVerifyKeyRequest

Fields

Field Type Required Description Example
APIID *string 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
Key string ✔️ The key to verify sk_1234
Tags []string Tags do not influence the outcome of a verification.
They can be added to filter or aggregate historical verification data for your analytics needs.
To unkey, a tag is simply a string, we don't enforce any schema but leave that up to you.
The only exception is that each tag must be between 1 and 128 characters long.
A typical setup would be to add key-value pairs of resources or locations, that you need later when querying.
[
"path=/v1/users/123",
"region=us-east-1"
]
Authorization *components.Authorization Perform RBAC checks
Remaining *components.Remaining Customize the behaviour of deducting remaining uses. When some of your endpoints are more expensive than others, you can set a custom cost for each.
Ratelimit *components.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 []components.Ratelimits 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
}
]