Virtual Keys

These endpoints allow you to create and manage virtual keys, which are used to authenticate requests made through the AI Runtime Control gateway. Each virtual key can be configured with request-per-minute and token-per-minute rate limits, a spend-limit flag, and a failover policy.

Data model

The virtual key that was created, including its access token.

access_tokenstringThe access token for this virtual key. This is only returned when the key is created or rotated, and cannot be retrieved again afterward. Required. Read-only.
created_atstringThe date and time the key was created, in RFC 3339 format. Required. Read-only.
customer_idstringThe ID of the customer account that owns the key. Required. Read-only.
expires_atstringThe date and time the key expires, in RFC 3339 format. null if the key doesn't expire.
idstringThe unique identifier of the virtual key. Required. Read-only.
namestringThe display name of the virtual key. Required.
rpm_limitintegerThe requests-per-minute limit for this key. null if there is no limit.
tpm_limitintegerThe tokens-per-minute limit for this key. null if there is no limit.
updated_atstringThe date and time the key was last updated, in RFC 3339 format. Required. Read-only.
user_idstringThe ID of the user who created the key. Required. Read-only.
provider_connection_idstringThe ID of the provider connection to retry against.
security_actionstringThe action AI Firewall takes when it detects a violation on a request made with this key.
security_enabledbooleanWhether AI Firewall security is enabled for requests made with this key.
spend_limit_enabledbooleanWhether a spend limit is enabled for this key. This field cannot be set when the key is created; it can only be changed with this endpoint.
spend_limit_enabled_onstringThe date and time spend_limit_enabled was last set to true, in RFC 3339 format. null if the spend limit has never been enabled. This timestamp is not cleared when spend_limit_enabled is later set back to false, so it can be non-null even when the spend limit is currently disabled. Read-only.
rate_limit_429_enabledbooleanWhether a 429 Too Many Requests response from the provider triggers failover.
server_error_5xx_enabledbooleanWhether a 5xx server error response from the provider triggers failover.
targetsarrayThe provider connections to retry against, in order.
timeout_enabledbooleanWhether a request timeout triggers failover.
deleted_atstringThe date and time the key was deleted, in RFC 3339 format. null unless the key was deleted and include_deleted was used to retrieve it. Read-only.
last_used_atstringThe date and time the key was last used to make a request, in RFC 3339 format. null if the key has never been used. Read-only.
typestringThe type of the resource. Read-only.
user_namestringThe display name of the user who created the key. Read-only.
created_bystringThe display name of the user who created the key. Read-only.
limitintegerThe limit value used when making the request.
next_cursorstringThe cursor to use to request the next page of results. null when there are no more results.
prev_cursorstringThe cursor to use to request the previous page of results. null when there is no previous page.
sortstringThe sort value used when making the request.
totalintegerThe count of results matching the request.
metaobjectMetadata about the request.

Endpoints

List virtual keys

GET/ai-runtime-control/v1/keys

Create a virtual key

POST/ai-runtime-control/v1/keys

Get a virtual key

GET/ai-runtime-control/v1/keys/key_id

Delete a virtual key

DELETE/ai-runtime-control/v1/keys/key_id

Update a virtual key

PATCH/ai-runtime-control/v1/keys/key_id

Rotate a virtual key

POST/ai-runtime-control/v1/keys/key_id/rotate

Get a virtual key's failover policy

GET/ai-runtime-control/v1/keys/key_id/failover

Update a virtual key's failover policy

PUT/ai-runtime-control/v1/keys/key_id/failover