Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 13.4 KB

limitrequestbody.md

File metadata and controls

15 lines (12 loc) · 13.4 KB

LimitRequestBody

Fields

Field Type Required Description Example
identifier str ✔️ Identifier of your user, this can be their userId, an email, an ip or anything else. user_123
limit int ✔️ How many requests may pass in a given window. 10
duration int ✔️ The window duration in milliseconds 60000
namespace Optional[str] Namespaces group different limits together for better analytics. You might have a namespace for your public API and one for internal tRPC routes. email.outbound
cost Optional[int] Expensive requests may use up more tokens. You can specify a cost to the request here and we'll deduct this many tokens in the current window.
If there are not enough tokens left, the request is denied.

Set it to 0 to receive the current limit without changing anything.
2
async_ Optional[bool] Async will return a response immediately, lowering latency at the cost of accuracy.
meta Dict[str, Any] Attach any metadata to this request
resources List[models.Resources] Resources that are about to be accessed by the user [
{
"type": "project",
"id": "p_123",
"name": "dub"
}
]