> For the complete documentation index, see [llms.txt](https://help.clickatell.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.clickatell.com/developers-api-reference/developers-archive/sms-http-s-api/retrieve-account-balance.md).

# Retrieve account balance

This command will return the number of credits available on your account.

If you simply want to monitor your account balance, you can receive SMS and email notifications when your account balance reaches a certain amount. This can be configured within your Developers Central account.

### **Command**

```
https://api.clickatell.com/http/getbalance?user=xxxx&password=xxxx&api_id=xxxx
```

### **Parameters**

You need to supply the authentication parameters that are outlined [here](broken://pages/1szjm2IZGPG5iWs9oY7g).&#x20;

### **Examples**

#### **Bash**

{% code lineNumbers="true" %}

```
username="place username here"
password="place password here"
api_id="place password here"
curl --data "user=$username&password=$password&api_id=$api_id" \
    'https://api.clickatell.com/http/getbalance'
```

{% endcode %}

#### **PHP**

{% code lineNumbers="true" %}

```
<?php
$username = urlencode("place username here");
$password = urlencode("place password here");
$api_id   = urlencode("place api_id here");
 
echo file_get_contents("https://api.clickatell.com/http/getbalance"
   . "?user=$username&password=$password&api_id=$api_id");
?>
```

{% endcode %}

#### **Python**

{% code lineNumbers="true" %}

```
import urllib2, urllib
 
params = {
    "user": "place username here",
    "password": "place password here",
    "api_id": "place password here"
}
 
params = urllib.urlencode(params)
f = urllib2.urlopen("https://api.clickatell.com/http/getbalance", params)
print f.read()
```

{% endcode %}

### **API responses**

#### **Example response**

*Successful API response:*

```
Credits: 123.00 
```

*Error response:*

```
ERR: 001, Authentication failed
```

#### **Format**

*Successful API response:*

```
Credits: <balance>
```

*Error response:*

```
ERR: <error code>, <error description>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.clickatell.com/developers-api-reference/developers-archive/sms-http-s-api/retrieve-account-balance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
