API reference
Credits
Read total credits and usage.
GET /credits returns two account totals in USD.
total_credits is the balance plus everything spent, so the balance you can spend now is total_credits - total_usage.
total_usage is everything the account has spent.
Errors: 401 for a bad key, 503 when the billing store cannot be read.
Request
sh
curl https://api.plaingateway.com/api/v1/credits \ -H "Authorization: Bearer $PLAINGATEWAY_API_KEY"
Response
http
HTTP/1.1 200
{
"data": {
"total_credits": 50,
"total_usage": 0.177992694
}
}