Get credit balance
The balance, its grants, and what holds the reserved part (reservations).
financial_blocked says the figures are paused for reconciliation, when they and the
reservations can disagree until the account is repaired.
curl --request GET \
--url https://api.sqwish.ai/v1/account/wallet \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sqwish.ai/v1/account/wallet"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sqwish.ai/v1/account/wallet', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"currency": "USD",
"paid_usd": "<string>",
"promotional_usd": "<string>",
"balance_usd": "<string>",
"available_usd": "<string>",
"reserved_usd": "<string>",
"financial_shortfall_usd": "<string>",
"grants": [
{
"id": "<string>",
"source": "<string>",
"amount_usd": "<string>",
"spent_usd": "<string>",
"held_usd": "<string>",
"created_at": 123,
"expires_at": 123,
"revoked_at": 123
}
],
"reservations": {
"work": [
{
"activity": "labeling",
"id": "<string>",
"name": "<string>",
"reserved_usd": "<string>",
"since": 123,
"until": 123,
"reason": "rerun"
}
],
"decisions": {
"requests": 123,
"reserved_usd": "<string>"
}
},
"financial_blocked": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}Authorizations
Create an API key in the console. Required when accounts are enabled.
Response
Successful Response
"USD"The credit the account has: paid credit and promotional grants, with what expired grants still hold for work in progress. Available plus reserved, unless a reversed payment left paid holds uncovered.
Paid credit the account is missing: what it owes, and paid holds it no longer covers.
Show child attributes
Show child attributes
What holds the reserved credit. Each reservation is charged or released when its work ends.
Show child attributes
Show child attributes
True while the account's figures are paused for reconciliation: work it accepted still ends and is recorded, but the balance, available and reserved amounts stay as they were until support repairs them, so they can disagree with reservations meanwhile.
curl --request GET \
--url https://api.sqwish.ai/v1/account/wallet \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sqwish.ai/v1/account/wallet"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sqwish.ai/v1/account/wallet', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"currency": "USD",
"paid_usd": "<string>",
"promotional_usd": "<string>",
"balance_usd": "<string>",
"available_usd": "<string>",
"reserved_usd": "<string>",
"financial_shortfall_usd": "<string>",
"grants": [
{
"id": "<string>",
"source": "<string>",
"amount_usd": "<string>",
"spent_usd": "<string>",
"held_usd": "<string>",
"created_at": 123,
"expires_at": 123,
"revoked_at": 123
}
],
"reservations": {
"work": [
{
"activity": "labeling",
"id": "<string>",
"name": "<string>",
"reserved_usd": "<string>",
"since": 123,
"until": 123,
"reason": "rerun"
}
],
"decisions": {
"requests": 123,
"reserved_usd": "<string>"
}
},
"financial_blocked": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}