Get workspace credit balance
curl --request GET \
--url https://code.deepline.com/api/v2/billing/balance \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://code.deepline.com/api/v2/billing/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://code.deepline.com/api/v2/billing/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"org_id": "<string>",
"balance": 123,
"spendable_balance_credits": 123,
"spendable_balance_status": "complete",
"exposure_status": "complete",
"balance_display": "<string>",
"rough_usd_balance": 123,
"posted_balance_credits": 123,
"pending_spend_credits": 123,
"spendable_balance_checked_at": "<string>",
"spendable_balance_message": "<string>",
"temporary_hold_credits": 123,
"temporary_hold_credits_truncated": true,
"rough_usd_temporary_holds": 123,
"estimated_hold_credits": 123,
"incurred_unsettled_credits": 123,
"pending_wallet_debit_credits": 123,
"pending_wallet_refund_credits": 123,
"unpriced_unsettled_reservation_count": 123,
"exposure_message": "<string>",
"temporary_hold_message": "<string>",
"balance_status": "<string>",
"has_payment_method": true,
"payment_method": {},
"recovery": {},
"updated_at": "<string>"
}{
"error": "Unauthorized"
}{
"error": "<string>"
}Billing
Get workspace credit balance
Reads the authenticated workspace’s balance without starting work or making a purchase. Responses are private and uncached. A null exposure or spendable amount means unavailable, not zero. Check spendable_balance_status before using spendable_balance_credits.
GET
/
api
/
v2
/
billing
/
balance
Get workspace credit balance
curl --request GET \
--url https://code.deepline.com/api/v2/billing/balance \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://code.deepline.com/api/v2/billing/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://code.deepline.com/api/v2/billing/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"org_id": "<string>",
"balance": 123,
"spendable_balance_credits": 123,
"spendable_balance_status": "complete",
"exposure_status": "complete",
"balance_display": "<string>",
"rough_usd_balance": 123,
"posted_balance_credits": 123,
"pending_spend_credits": 123,
"spendable_balance_checked_at": "<string>",
"spendable_balance_message": "<string>",
"temporary_hold_credits": 123,
"temporary_hold_credits_truncated": true,
"rough_usd_temporary_holds": 123,
"estimated_hold_credits": 123,
"incurred_unsettled_credits": 123,
"pending_wallet_debit_credits": 123,
"pending_wallet_refund_credits": 123,
"unpriced_unsettled_reservation_count": 123,
"exposure_message": "<string>",
"temporary_hold_message": "<string>",
"balance_status": "<string>",
"has_payment_method": true,
"payment_method": {},
"recovery": {},
"updated_at": "<string>"
}{
"error": "Unauthorized"
}{
"error": "<string>"
}Authentication: workspace API key in
Authorization: Bearer <key>.
Errors
| Status | Meaning |
|---|---|
| 401 | Missing or invalid workspace authentication. |
| 500 | Server failure. Retry this read; it does not start new work. |
Authorizations
Create a workspace API key in the Deepline dashboard before calling authenticated endpoints.
Query Parameters
Set pill for the compact display response; omit for the full balance and exposure breakdown.
Available options:
pill Response
Full balance, or a compact display response when view=pill.
- Option 1
- Option 2
Available options:
complete, unavailable Available options:
complete, partial, unavailable Saved-card display metadata, or null. Never contains card credentials.
Present when funding needs attention. Recovery recommendations require explicit purchase approval.