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

# Get credit balance

> Get your current credit balance and subscription plan details.

Credits are consumed when running browser agents.



## OpenAPI

````yaml get /v1/get_credit_balance
openapi: 3.1.0
info:
  title: Altrina Browser Agent API
  description: >

    AI-powered browser automation API that allows you to control web browsers
    programmatically.


    ## What can Altrina do?


    Altrina uses advanced AI models to understand natural language instructions
    and execute them in a web browser:

    - **Web Scraping**: Extract data from any website without writing selectors

    - **Form Automation**: Fill out complex forms and multi-step workflows

    - **Testing**: Automated end-to-end testing with natural language assertions

    - **Research**: Gather information across multiple sites and compile results

    - **Monitoring**: Check websites for changes or specific conditions


    ## Authentication

    All API endpoints (except `/v1/health`) require authentication via API key.


    ### Getting an API Key

    1. Go to
    [https://app.altrina.com/settings](https://app.altrina.com/settings)

    2. Click on "Generate API Key"

    3. Copy your API key and keep it secure


    ### Using the API Key

    Include your API key in the `Authorization` header as a Bearer token:

    ```

    Authorization: Bearer YOUR_API_KEY

    ```


    ### Example cURL Request

    ```bash

    curl -X POST "https://api.altrina.com/v1/run_browser_agent" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "directive": "Go to news.ycombinator.com and get the titles and points of the top 3 stories on the homepage",
        "browser_config": {
          "width": 1920,
          "height": 1080,
          "residential_ip": false,
          "keep_browser_open": false,
          "use_user_browser_profile": false
        }
      }'
    ```


    **Note on Browser Profiles**: By default (`use_user_browser_profile:
    false`), each API call uses a fresh browser profile with no cookies or
    browsing history. Set `use_user_browser_profile: true` if you need to
    maintain logged-in state across multiple API calls.


    ## Rate Limits


    - **Browser Agent**: 10 requests/minute

    - **Status Polling**: 60 requests/minute

    - **Credit Balance**: 60 requests/minute


    ## Support


    For issues or questions, contact support@altrina.com
  version: 1.0.0
servers:
  - url: https://api.altrina.com
security: []
tags:
  - name: Browser Agent
    description: Start and monitor browser automation tasks
  - name: Workflows
    description: Trigger saved workflows via API or webhook
  - name: Account
    description: Manage credits and subscription
  - name: System
    description: Service health and status
paths:
  /v1/get_credit_balance:
    get:
      tags:
        - Account
      summary: Get credit balance
      description: |-
        Get your current credit balance and subscription plan details.

        Credits are consumed when running browser agents.
      operationId: get_credit_balance_v1_get_credit_balance_get
      responses:
        '200':
          description: Credit balance retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditBalanceResponse'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    CreditBalanceResponse:
      properties:
        credit_balance:
          anyOf:
            - type: integer
            - type: 'null'
          title: Credit Balance
          description: >-
            Number of credits remaining. NULL for enterprise users with
            unlimited usage
        plan:
          type: string
          title: Plan
          description: 'Current subscription plan: ''free'', ''pro'', ''enterprise'''
        unlimited:
          type: boolean
          title: Unlimited
          description: Whether the user has unlimited credits (enterprise plan)
        next_reset:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Reset
          description: ISO 8601 timestamp when credits reset (for non-enterprise plans)
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: Additional information about the credit status
      type: object
      required:
        - plan
        - unlimited
      title: CreditBalanceResponse
      description: User's credit balance and subscription information
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Detailed error message
        status_code:
          type: integer
          title: Status Code
          description: HTTP status code
      type: object
      required:
        - detail
        - status_code
      title: ErrorResponse
      description: Standard error response format
  securitySchemes:
    HTTPBearer:
      type: http
      description: >-
        API key for authentication. Get your API key at
        https://app.altrina.com/settings
      scheme: bearer

````