Create a new API key for a user
Request body
The configuration ID to use for the API key. If not provided, the default configuration will be used.
Name of the Api Key
Prefix of the Api Key
Amount to refill the remaining count of the Api Key. server-only. Eg: 100
Interval to refill the Api Key in milliseconds. server-only. Eg: 1000
The duration in milliseconds where each request is counted. Once the maxRequests is reached, the request will be rejected until the timeWindow has passed, at which point the timeWindow will be reset. server-only. Eg: 1000
Maximum amount of requests allowed within a window. Once the maxRequests is reached, the request will be rejected until the timeWindow has passed, at which point the timeWindow will be reset. server-only. Eg: 100
Whether the key has rate limiting enabled. server-only. Eg: true
Permissions of the Api Key.
User Id of the user that the Api Key belongs to. server-only. Eg: "user-id"
Organization Id of the organization that the Api Key belongs to. Eg: 'org-id'
Response
API key created successfully
Unique identifier of the API key
Creation timestamp
Last update timestamp
Name of the API key
Prefix of the API key
Starting characters of the key (if configured)
The full API key (only returned on creation)
Whether the key is enabled
Expiration timestamp
ID of the reference owning the key
Last refill timestamp
Last request timestamp
Metadata associated with the key
Maximum requests in time window
Rate limit time window in milliseconds
Remaining requests
Amount to refill
Refill interval in milliseconds
Whether rate limiting is enabled
Current request count in window
Permissions associated with the key