Python
import requests
url = "https://api.naga.ac/v1/account/keys"
payload = { "name": "production" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'production'})
};
fetch('https://api.naga.ac/v1/account/keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl https://api.naga.ac/v1/account/keys \
-H "Authorization: Bearer $NAGA_PROVISIONING_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "production",
"credit_limit": 25.0,
"credit_limit_period": "month",
"expires_at": "2027-01-01T00:00:00Z",
"workspace_id": 3
}'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.naga.ac/v1/account/keys"
payload := strings.NewReader("{\n \"name\": \"production\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": 42,
"name": "production",
"key": "ng-xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"created_at": "2026-08-01T09:14:22",
"expires_at": "2027-01-01T00:00:00",
"is_enabled": true,
"credit_limit": 25,
"credit_limit_period": "month",
"default_routing_strategy": null,
"workspace_id": 3,
"message": "Store this key now — it is not shown again."
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"message": "Invalid provisioning key."
}
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}API Keys
Create an API key
Creates an API key on the account and returns its secret this once. Requires a provisioning key.
POST
https://api.naga.ac
/
v1
/
account
/
keys
Python
import requests
url = "https://api.naga.ac/v1/account/keys"
payload = { "name": "production" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'production'})
};
fetch('https://api.naga.ac/v1/account/keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl https://api.naga.ac/v1/account/keys \
-H "Authorization: Bearer $NAGA_PROVISIONING_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "production",
"credit_limit": 25.0,
"credit_limit_period": "month",
"expires_at": "2027-01-01T00:00:00Z",
"workspace_id": 3
}'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.naga.ac/v1/account/keys"
payload := strings.NewReader("{\n \"name\": \"production\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": 42,
"name": "production",
"key": "ng-xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"created_at": "2026-08-01T09:14:22",
"expires_at": "2027-01-01T00:00:00",
"is_enabled": true,
"credit_limit": 25,
"credit_limit_period": "month",
"default_routing_strategy": null,
"workspace_id": 3,
"message": "Store this key now — it is not shown again."
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"message": "Invalid provisioning key."
}
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}Authorizations
Body
application/json
The body of POST /v1/account/keys.
Response
The freshly minted key, and the one answer carrying the secret itself.
The created key, and the only copy of its secret you will be given.