Skip to content

Commit a7cde09

Browse files
techpro-aimlapigitbook-bot
authored andcommitted
GITBOOK-547: docs: add api schema for billing balance
1 parent 8f82eb1 commit a7cde09

1 file changed

Lines changed: 4 additions & 95 deletions

File tree

docs/api-references/service-endpoints/account-balance.md

Lines changed: 4 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -6,99 +6,8 @@ icon: money-check-pen
66

77
## Get account balance info
88

9-
<mark style="color:green;">`GET`</mark> `https://billing.aimlapi.com/v1/billing/balance`
9+
You can query your account balance and other billing details through this API.
1010

11-
**Headers**
12-
13-
<table><thead><tr><th width="190.6666259765625">Name</th><th>Value</th></tr></thead><tbody><tr><td>Authorization</td><td><code>Bearer &#x3C;token></code></td></tr><tr><td>Content-Type</td><td><code>application/json</code></td></tr></tbody></table>
14-
15-
**Body**
16-
17-
**-**
18-
19-
**Response Schema**
20-
21-
<table><thead><tr><th width="189">Field</th><th>Description</th></tr></thead><tbody><tr><td><code>balance</code></td><td>The total credits associated with the provided API key.</td></tr><tr><td><code>lowBalance</code></td><td>True if the balance is below the threshold.</td></tr><tr><td><code>lowBalanceThreshold</code></td><td>Threshold for switching to low balance status.</td></tr><tr><td><code>lastUpdated</code></td><td>The date of the request — i.e., the current date.</td></tr><tr><td><code>autoDebitStatus</code></td><td>Indicates whether auto top-up is enabled for the plan.</td></tr><tr><td><code>status</code></td><td>The status of the plan associated with the provided API key.</td></tr><tr><td><code>statusExplanation</code></td><td>A more detailed explanation of the plan status.</td></tr></tbody></table>
22-
23-
## Example
24-
25-
{% tabs %}
26-
{% tab title="cURL" %}
27-
```url
28-
curl https://billing.aimlapi.com/v1/billing/balance \
29-
-H "Authorization: Bearer <YOUR_AIMLAPI_KEY>" \
30-
-H "Content-Type: application/json"
31-
```
32-
{% endtab %}
33-
34-
{% tab title="HTTP" %}
35-
```http
36-
GET /v1/billing/balance HTTP/1.1
37-
Host: billing.aimlapi.com
38-
Authorization: Bearer <YOUR_AIMLAPI_KEY>
39-
Content-Type: application/json
40-
```
41-
{% endtab %}
42-
43-
{% tab title="Python" %}
44-
{% code overflow="wrap" %}
45-
```python
46-
import requests
47-
import json
48-
49-
def main():
50-
response = requests.get(
51-
"https://billing.aimlapi.com/v1/billing/balance",
52-
headers={
53-
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
54-
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
55-
"Content-Type": "application/json",
56-
})
57-
58-
data = response.json()
59-
print(json.dumps(data, indent=2, ensure_ascii=False))
60-
61-
if __name__ == "__main__":
62-
main()
63-
```
64-
{% endcode %}
65-
{% endtab %}
66-
67-
{% tab title="JavaScript" %}
68-
{% code overflow="wrap" %}
69-
```javascript
70-
async function main() {
71-
const response = await fetch("https://billing.aimlapi.com/v1/billing/balance", {
72-
headers: {
73-
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
74-
"Content-Type": "application/json",
75-
},
76-
});
77-
78-
const data = await response.json();
79-
console.log(JSON.stringify(data, null, 2));
80-
}
81-
82-
main();
83-
```
84-
{% endcode %}
85-
{% endtab %}
86-
{% endtabs %}
87-
88-
<details>
89-
90-
<summary>Response</summary>
91-
92-
```json5
93-
{
94-
"balance": 551564495,
95-
"lowBalance": false,
96-
"lowBalanceThreshold": 10000,
97-
"lastUpdated": "2025-11-10T10:01:56.824Z",
98-
"autoDebitStatus": "disabled",
99-
"status": "current",
100-
"statusExplanation": "Balance is current and up to date"
101-
}
102-
```
103-
104-
</details>
11+
{% openapi-operation spec="billing-test-1" path="/v1/billing/balance" method="get" %}
12+
[OpenAPI billing-test-1](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/service-endpoints/billing-balance.json)
13+
{% endopenapi-operation %}

0 commit comments

Comments
 (0)