Get Credits
curl --request GET \
--url https://api.example.com/creditsimport requests
url = "https://api.example.com/credits"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/credits', 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.example.com/credits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/credits"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/credits")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/credits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyCredits
Get Credits
Get your organization’s credit balance, plan, billing cycle, and auto top-up settings.
GET
/
credits
Get Credits
curl --request GET \
--url https://api.example.com/creditsimport requests
url = "https://api.example.com/credits"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/credits', 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.example.com/credits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/credits"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/credits")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/credits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyReturns everything about your organization’s credit state in a single call: current balance, active plan, billing cycle dates, and auto top-up configuration.
When
Request
curl -X GET "https://api.mosaic.so/credits" \
-H "Authorization: Bearer mk_your_api_key"
Response
{
"organization_id": "d808af70-fc57-4f90-95ca-186a9cbf2ef7",
"balance": 1840,
"plan": "creator",
"plan_id": "creator_annual",
"billing_cycle": {
"current_period_start": "2026-03-01T00:00:00.000Z",
"current_period_end": "2026-04-01T00:00:00.000Z"
},
"auto_topup": {
"eligible": true,
"enabled": true,
"threshold": 1000,
"quantity": 5000
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
organization_id | string | Organization identifier. |
balance | number | Current remaining credits. |
plan | string | null | Normalized plan family (creator or professional). |
plan_id | string | null | Concrete active plan ID (creator, creator_annual, professional, etc.). |
billing_cycle.current_period_start | string | null | Current subscription cycle start in ISO format. |
billing_cycle.current_period_end | string | null | Current subscription cycle end in ISO format. |
auto_topup.eligible | boolean | Whether the current plan can use auto top-ups. Eligible plans are creator, creator_annual, professional, and professional_annual. |
auto_topup.enabled | boolean | Whether auto top-up is active. |
auto_topup.threshold | number | When the credit balance drops below this number, an auto top-up is triggered. |
auto_topup.quantity | number | Number of credits purchased each time an auto top-up fires. |
auto_topup.eligible is false, auto top-ups are unavailable for the current plan and the returned auto top-up config will be disabled (enabled: false, threshold: 0, quantity: 0).Was this page helpful?
⌘I