curl
curl https://api.naga.ac/v1/account/balance \
-H "Authorization: Bearer $NAGA_PROVISIONING_KEY"import requests
url = "https://api.naga.ac/v1/account/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.naga.ac/v1/account/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.naga.ac/v1/account/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"balance": "12.4750"
}{
"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>"
}
}Account
Get the account balance
Returns the account’s credit balance. Requires a provisioning key.
GET
/
v1
/
account
/
balance
curl
curl https://api.naga.ac/v1/account/balance \
-H "Authorization: Bearer $NAGA_PROVISIONING_KEY"import requests
url = "https://api.naga.ac/v1/account/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.naga.ac/v1/account/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.naga.ac/v1/account/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"balance": "12.4750"
}{
"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
An account provisioning key. Send it as Authorization: Bearer <key>. Provisioning keys manage the account and cannot reach a model.
Response
The account's credit balance, as a decimal string.
What the account has left to spend, as a decimal string.
The credits left, one credit being one US dollar.