Store Securely The API key is only shown once during creation. Store it
securely as it cannot be retrieved again.
Provisioning Key Required This endpoint requires authentication with a
provisioning key, not a regular API key.
Request Parameters
Name for the API key (1-255 characters)
Optional credit limit for the API key (minimum: 0). Use null to remove the limit.
Optional expiration datetime for the API key (ISO 8601). Must be in the future. Use null to remove expiration.
Usage examples
import requests
response = requests.post(
"https://api.naga.ac/v1/account/keys",
headers={
"Authorization": "Bearer YOUR_PROVISIONING_KEY",
"Content-Type": "application/json",
},
json={
"name": "New Production Key",
"credit_limit": 500.00,
},
)
key_data = response.json()
print(f"New API Key: {key_data['key']}")
print(f"Key ID: {key_data['id']}")
Response
{
"id": 3,
"name": "New Production Key",
"key": "naga_sk_1234567890abcdef",
"created_at": "2025-01-20T15:45:00Z",
"expires_at": "2026-01-20T15:45:00Z",
"is_enabled": true,
"credit_limit": 500.0,
"message": "Store this key securely. It will not be shown again."
}
Response Fields
The actual API key (only shown once)
Optional expiration datetime (ISO 8601). null means no expiration.
Whether the key is active
Optional spending limit (null means no limit)