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

# Make the first API request

> Validate a Telnyx API key with a safe, read-only account balance request.

Use the account balance endpoint as the initial authentication check. `GET /balance` is read-only and requires no product resource or provisioning step.

## Before starting

* Create a key from [API Keys in Mission Control Portal](https://portal.telnyx.com/#/app/api-keys). See [Create and manage API keys](/docs/development/api-fundamentals/create-api-keys) for storage and rotation guidance.
* Install `curl` on macOS or Linux, or use PowerShell on Windows.
* Keep the key in a server-side environment variable. Never embed it in browser or mobile code.

## Send the request

<Tabs>
  <Tab title="macOS and Linux">
    ```bash theme={null}
    export TELNYX_API_KEY="..."

    curl --request GET \
      --url "https://api.telnyx.com/v2/balance" \
      --header "Authorization: Bearer $TELNYX_API_KEY" \
      --header "Accept: application/json"
    ```
  </Tab>

  <Tab title="Windows PowerShell">
    ```powershell theme={null}
    $Env:TELNYX_API_KEY = "..."

    $headers = @{
      Authorization = "Bearer $Env:TELNYX_API_KEY"
      Accept = "application/json"
    }

    Invoke-RestMethod `
      -Method Get `
      -Uri "https://api.telnyx.com/v2/balance" `
      -Headers $headers
    ```
  </Tab>
</Tabs>

<Callout type="info">
  **Request failed?**

  Start with [API troubleshooting](/docs/development/api-fundamentals/troubleshooting), then check [authentication](/docs/development/api-fundamentals/authentication) and the [API error catalog](/docs/development/api-fundamentals/api-errors).
</Callout>

A successful response has a `data` object containing the current balance, pending amount, credit limit, available credit, and ISO 4217 currency identifier:

```json theme={null}
{
  "data": {
    "record_type": "balance",
    "pending": "10.00",
    "balance": "300.00",
    "credit_limit": "100.00",
    "available_credit": "400.00",
    "currency": "USD"
  }
}
```

The values above are illustrative. Treat monetary values as decimal strings rather than binary floating-point numbers.

## Interpret failures

* `401 Unauthorized`: The `Authorization` header is absent or the key is invalid.
* `403 Forbidden`: The credential or account cannot access balance information.
* `422 Unprocessable Entity`: The request reached the endpoint but could not be processed.
* `503 Service Unavailable`: The service is temporarily unavailable. Apply the [retry guidance](/docs/development/api-fundamentals/reliability/command-retries).

See [API troubleshooting](/docs/development/api-fundamentals/troubleshooting) for a diagnostic sequence and [API error codes](/docs/development/api-fundamentals/api-errors) for Telnyx-specific error bodies.

## Continue

* [Open the balance API reference](/api-reference/billing/get-user-balance-details)
* [Select a server-side SDK](/docs/development/sdk)
* [Install the Telnyx CLI](/docs/development/cli/getting-started/install)
* [Review request and response handling](/docs/development/api-fundamentals/request-response)
