POST /v1/api-keys
TenantService_CreateAPIKey
The server validates credentials, tenant, environment and permissions. This page does not send requests. Replace example values; deployed server validation remains authoritative.
Parameters
No path or query parameters.
Request body
allowed_cidrsarraycustomer_account_idstringOptional. When set, this key can charge and inspect only this customer.
environmentstringexpires_atstringidempotency_keystringnamestringscopesarrayservice_account_idstring
cURL
curl --request POST 'https://nexus-api.rainlib.com/v1/api-keys' \
--header 'Authorization: Bearer <NEXUS_ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"allowed_cidrs": [
"<value>"
],
"customer_account_id": "<value>",
"environment": "<value>",
"expires_at": "<value>",
"idempotency_key": "<value>",
"name": "<value>",
"scopes": [
"<value>"
],
"service_account_id": "<value>"
}'Response contract
200 · OK
api_keyobjectExpand fields
allowed_cidrsarraycreated_atstringcustomer_account_idstringenvironmentstringexpires_atstringidstringlast_used_atstringnamestringprefixstringrevoked_atstringscopesarrayservice_account_idstringtenant_idstring
secretstring
Generated responses do not enumerate every runtime error. See the integration guide for authentication, conflicts and retries.