> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xquik.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Xquik credit balance, API usage & billing data

> Retrieve the available API credit balance, lifetime purchased and used totals, and automatic top-up settings for an Xquik account. The call is free to run.

<Panel>
  <Tabs defaultTabIndex={0} sync={false}>
    <Tab title="200" id="response-credits-get-200">
      ```json theme={null}
      {
        "auto_topup_amount_dollars": 10,
        "auto_topup_enabled": false,
        "auto_topup_stopped": false,
        "auto_topup_threshold": "50000",
        "balance": "50000",
        "lifetime_purchased": "200000",
        "lifetime_used": "150000"
      }
      ```
    </Tab>

    <Tab title="401" id="response-credits-get-401">
      ```json theme={null}
      {
        "error": "unauthenticated",
        "message": "Authentication required. Provide a valid API key or bearer token."
      }
      ```
    </Tab>

    <Tab title="429" id="response-credits-get-429">
      ```json theme={null}
      {
        "error": "rate_limit_exceeded",
        "message": "Too many requests. Try again later.",
        "retryAfter": 60
      }
      ```
    </Tab>
  </Tabs>
</Panel>

<blockquote className="agent-llms-directive">
  For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
</blockquote>

## When to read credits

This route is read-only. It returns current balance, lifetime totals, and automatic top-up settings. Use purchase and status routes only after deciding to add credits.

## Check credits before tweets, followers, or monitors

Read the current balance before starting a large tweet search, follower export,
reply export, active monitor, or X write. Compare the balance with the route's
documented credit cost. Reduce the requested result count when the available
balance cannot cover the full job.

Keep `balance`, `lifetime_purchased`, and `lifetime_used` as strings. These
values can exceed JavaScript's safe integer range. Convert them with a bigint
library only when the client supports exact arithmetic.

Review automatic top-up fields separately. `auto_topup_enabled` reports whether
automatic funding is active. The threshold and dollar amount describe when and
how much the account adds. `auto_topup_stopped` is `true` when declined charges
stopped it. Ask the user to update the card in the dashboard to restart it.

This endpoint never charges a payment method. Use standard top-up for a hosted
checkout. Use quick top-up only after the account has a saved payment method.
Poll standard checkout status with the checkout session ID.

<Callout icon="circle-check" color="#16a34a">
  **Free.** This endpoint does not consume credits.
</Callout>

<CodeGroup>
  ```bash cURL theme={null}
  curl https://xquik.com/api/v1/credits \
    -H "x-api-key: xq_YOUR_KEY_HERE" | jq
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://xquik.com/api/v1/credits", {
    headers: { "x-api-key": "xq_YOUR_KEY_HERE" },
  });
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://xquik.com/api/v1/credits",
      headers={"x-api-key": "xq_YOUR_KEY_HERE"},
  )
  data = response.json()
  print(data)
  ```
</CodeGroup>

## Headers

<ParamField header="x-api-key" type="string" required>
  Your API key. Session cookie authentication is also supported.
</ParamField>

## Response

### 200 OK

<ResponseField name="auto_topup_amount_dollars" type="number">
  Dollar amount charged when automatic top-up runs.
</ResponseField>

<ResponseField name="auto_topup_enabled" type="boolean">
  Whether automatic top-up is enabled.
</ResponseField>

<ResponseField name="auto_topup_stopped" type="boolean">
  Whether declined charges stopped automatic top-up while it is enabled. It stops after 3 declines
  in a row on one card. A paid top-up, a paid plan renewal, or the next automatic top-up on a new
  card clears it.
</ResponseField>

<ResponseField name="auto_topup_threshold" type="string">
  Credit balance threshold that triggers automatic top-up when enabled (Bigint string).
</ResponseField>

<ResponseField name="balance" type="string">
  Current credit balance (Bigint string to preserve precision above Number.MAX\_SAFE\_INTEGER).
</ResponseField>

<ResponseField name="lifetime_purchased" type="string">
  Total credits purchased (Bigint string).
</ResponseField>

<ResponseField name="lifetime_used" type="string">
  Total credits consumed (Bigint string).
</ResponseField>

```json theme={null}
{
  "auto_topup_amount_dollars": 10,
  "auto_topup_enabled": false,
  "auto_topup_stopped": false,
  "auto_topup_threshold": "50000",
  "balance": "450",
  "lifetime_purchased": "1000",
  "lifetime_used": "550"
}
```

### 401 Unauthenticated

```json theme={null}
{ "error": "unauthenticated" }
```

Missing or invalid API key.

### 429 Rate limited

```json theme={null}
{
  "error": "rate_limit_exceeded",
  "message": "Too many requests. Try again later.",
  "retryAfter": 1
}
```

Too many requests. Wait for the `Retry-After` header before retrying.

<Note>
  **Related.** [Top Up Credits](/api-reference/credits/topup) · [Get Top-Up Status](/api-reference/credits/topup-status) · [Quick Top-Up](/api-reference/credits/quick-topup) · [Billing Guide](/guides/billing)
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.