---
title: "Get user credit balance"
description: "Returns the authenticated user's ID and current credit balance."
---

> Documentation Index
> Fetch the complete documentation index at: https://staging.threadapi.dev/llms.txt
> Use this file to discover all available pages before exploring further.

Path: ThreadAPI API › User

`GET /api/v1/user/balance`

Returns the authenticated user's ID and current credit balance.

## Authentication

Requires one of the following:

- `bearerAuth`, http, header `Authorization`
- `apiKeyAuth`, apiKey, in header, header `x-api-key`

## Code samples

### cURL

```bash
curl --request GET \
  --url https://api.threadapi.dev/api/v1/user/balance \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.threadapi.dev/api/v1/user/balance';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.threadapi.dev/api/v1/user/balance"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Current user balance

#### Example

```json
{
  "user_id": "usr_12345",
  "credit_balance": 100
}
```

- `user_id` (`getUserBalance.response.200.user_id`; string, required)
  - example `"usr_12345"`
- `credit_balance` (`getUserBalance.response.200.credit_balance`; integer, required)
  - example `100`

### 401

Missing or invalid API key or OAuth access token

#### Example

```json
{
  "error": "unauthorized: missing or invalid credentials",
  "error_code": "insufficient_credits"
}
```

One of:

- `ErrorResponse`
- `Error`

### 404

Requested user or resource not found

#### Example

```json
{
  "error": "unauthorized: missing or invalid credentials",
  "error_code": "insufficient_credits"
}
```

One of:

- `ErrorResponse`
- `Error`

### 429

Rate limit or daily request quota exceeded

#### Example

```json
{
  "error": "unauthorized: missing or invalid credentials",
  "error_code": "insufficient_credits"
}
```

One of:

- `ErrorResponse`
- `Error`

### 500

Internal server error

#### Example

```json
{
  "error": "unauthorized: missing or invalid credentials",
  "error_code": "insufficient_credits"
}
```

- `error` (`getUserBalance.response.500.error`; string, required) — Human-readable error message
  - example `"unauthorized: missing or invalid credentials"`
- `error_code` (`getUserBalance.response.500.error_code`; string, optional) — Machine-readable error code. Known values include: forbidden_scope, rate_limited, daily_quota_exceeded, insufficient_credits, duplicate_transaction. Additional codes may be introduced in future releases.
  - one of `"forbidden_scope"`, `"rate_limited"`, `"daily_quota_exceeded"`, `"insufficient_credits"`, `"duplicate_transaction"`; example `"insufficient_credits"`


Source: https://staging.threadapi.dev/api/User/getUserBalance/index.md
