ESC
Type to search across all documentation
GET

/account

Returns plan details, quota usage, and file size limits for the account associated with your API key. Use this to check remaining capacity before submitting large batches of conversions.

Required scope: convertacoal:read

Response 200 OK

{
  "success": true,
  "data": {
    "plan_type": "pro",
    "balance": 42.50,
    "quota_monthly": 1000,
    "used_this_month": 237,
    "remaining_quota": 763,
    "max_file_size": 52428800,
    "can_convert": true
  }
}

Response Fields

Field Type Description
plan_type string Active subscription plan. e.g. free, starter, pro, enterprise
balance float Current account credit balance in USD
quota_monthly integer Total number of conversions allowed per calendar month on your plan
used_this_month integer Number of conversions completed in the current calendar month
remaining_quota integer Conversions remaining before the monthly quota resets. Resets on the 1st of each month UTC.
max_file_size integer Maximum upload size in bytes. 52428800 = 50 MB. Varies by plan.
can_convert boolean true if the account can submit a conversion right now. false if quota is exhausted or balance is insufficient.

Plan Limits

Plan Monthly Quota Max File Size
free 25 5 MB
starter 250 20 MB
pro 1,000 50 MB
enterprise Custom Custom

Example Request

curl https://coals.ai/api/v1/convertacoal/account \
  -H "Authorization: Bearer YOUR_API_KEY"
// Using Guzzle
$response = $client->get('https://coals.ai/api/v1/convertacoal/account', [
  'headers' => ['Authorization' => 'Bearer YOUR_API_KEY']
]);
$data = json_decode($response->getBody(), true);
# Using requests
import requests

response = requests.get(
  "https://coals.ai/api/v1/convertacoal/account",
  headers={"Authorization": "Bearer YOUR_API_KEY"}
)
data = response.json()
# Using net/http
require "net/http"
require "json"

uri = URI("https://coals.ai/api/v1/convertacoal/account")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer YOUR_API_KEY"

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
// Using fetch (Node 18+)
const response = await fetch("https://coals.ai/api/v1/convertacoal/account", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY"
  }
});
const data = await response.json();