Skip to main content
GET
/
api
/
v1
/
credits
/
balance
Get credit balance
curl -sS "https://api.openfunnel.dev/api/v1/credits/balance" \
  -H "X-API-Key: YOUR_API_KEY"
import requests

url = "https://api.openfunnel.dev/api/v1/credits/balance"

headers = {"X-API-Key": "<x-api-key>"}

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

print(response.text)
const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};

fetch('https://api.openfunnel.dev/api/v1/credits/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.openfunnel.dev/api/v1/credits/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 => [
"X-API-Key: <x-api-key>"
],
]);

$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.openfunnel.dev/api/v1/credits/balance"

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

req.Header.Add("X-API-Key", "<x-api-key>")

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.openfunnel.dev/api/v1/credits/balance")
.header("X-API-Key", "<x-api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.openfunnel.dev/api/v1/credits/balance")

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

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'

response = http.request(request)
puts response.read_body
{
  "total_credits": 200,
  "credits_used": 37.5,
  "credits_left": 162.5
}

Headers

X-API-Key
string
required

Response

200 - application/json

Successful Response

Your account's credit balance

total_credits
number
required

The credit allowance for your billing account.

credits_used
number
required

Credits consumed

credits_left
number
required

Remaining credits