Skip to main content
GET
/
api
/
v2
/
account
/
balance
cURL
curl --request GET \
  --url https://api.deapi.ai/api/v2/account/balance \
  --header 'Accept: <accept>' \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.deapi.ai/api/v2/account/balance"

headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Accept: '<accept>', Authorization: 'Bearer <token>'}};

fetch('https://api.deapi.ai/api/v2/account/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deapi.ai/api/v2/account/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.deapi.ai/api/v2/account/balance"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Accept", "<accept>")
req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.deapi.ai/api/v2/account/balance")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.deapi.ai/api/v2/account/balance")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "balance": 123
}
{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123
}
{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123
}
{
"message": "Too Many Attempts."
}
Retrieve the current account balance (in USD) for the authenticated API key. Useful for displaying usage in dashboards or gating background jobs when funds run low.
Minimum balance. Generation requires an account balance of at least $0.49. When your balance drops below this threshold, new jobs are rejected until you top up. This safeguard prevents a single job from costing more than your remaining funds, since the final price of a generation is only known once it completes. Top up your account and generation resumes immediately — no other action is required.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Accept
enum<string>
default:application/json
required
Available options:
application/json

Response

Current client balance.

balance
number<double>

Current client balance