AlterLabAlterLab
PricingComparePlaygroundBlogDocsChangelog
    AlterLabAlterLab
    PricingComparePlaygroundBlogDocsChangelog
    IntroductionQuickstartInstallationYour First Request
    REST APIJob PollingAPI KeysSessions APINew
    OverviewPythonNode.js
    JavaScript RenderingOutput FormatsPDF & OCRCachingWebhooksJSON Schema FilteringWebSocket Real-TimeBring Your Own ProxyProAuthenticated ScrapingNewWeb CrawlingBatch ScrapingSchedulerChange DetectionCloud Storage ExportSpend LimitsOrganizations & TeamsAlerts & Notifications
    Structured ExtractionAIE-commerce ScrapingNews MonitoringPrice MonitoringMulti-Page CrawlingMonitoring DashboardAI Agent / MCPMCPData Pipeline to Cloud
    PricingRate LimitsError Codes
    From FirecrawlFrom ApifyFrom ScrapingBee / ScraperAPIFirecrawl v0 API ReferenceLegacy
    PlaygroundPricingStatus
    API Reference
    Auto-generated

    Billing

    API reference for billing endpoints.

    Auto-generated

    This page was generated from the OpenAPI spec. Runmake generate-docs to refresh after spec changes.

    GET /api/v1/billing/audit-log

    GET
    /api/v1/billing/audit-log

    Get billing audit log

    Parameters

    NameTypeRequiredDescription
    limitintegerOptionallimitDefault: 20
    offsetintegerOptionaloffsetDefault: 0

    Request Example

    Bash
    curl -X GET https://api.alterlab.io/api/v1/billing/audit-log \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "entries": [],
      "total": 0,
      "has_more": true
    }

    GET /api/v1/billing/auto-recharge

    GET
    /api/v1/billing/auto-recharge

    Get auto-recharge settings

    Request Example

    Bash
    curl -X GET https://api.alterlab.io/api/v1/billing/auto-recharge \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "id": "example",
      "user_id": "example",
      "enabled": true,
      "threshold_microcents": 0,
      "threshold_display": "example",
      "recharge_amount_cents": 0
    }

    PUT /api/v1/billing/auto-recharge

    PUT
    /api/v1/billing/auto-recharge

    Update auto-recharge settings

    Parameters

    NameTypeRequiredDescription
    enabledbooleanOptionalEnable auto-rechargeDefault: False
    threshold_microcentsintegerOptionalRecharge when balance drops below this (microcents). 1,000,000 = $0.01Default: 500000000
    recharge_amount_centsintegerOptionalAmount to charge in cents ($25-$2000)Default: 5000
    stripe_payment_method_idstringOptionalstripe_payment_method_id
    consent_textstringOptionalconsent_text
    consent_source"deposit_flow" | "success_page" | "settings"Optionalconsent_source
    terms_versionstringOptionalterms_version

    Request Example

    Bash
    curl -X PUT https://api.alterlab.io/api/v1/billing/auto-recharge \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "enabled": false,
        "threshold_microcents": 500000000,
        "recharge_amount_cents": 5000
      }'

    Response Example

    JSON
    {
      "id": "example",
      "user_id": "example",
      "enabled": true,
      "threshold_microcents": 0,
      "threshold_display": "example",
      "recharge_amount_cents": 0
    }

    DELETE /api/v1/billing/auto-recharge

    DELETE
    /api/v1/billing/auto-recharge

    Disable auto-recharge

    Request Example

    Bash
    curl -X DELETE https://api.alterlab.io/api/v1/billing/auto-recharge \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "status": "ok"
    }

    GET /api/v1/billing/auto-recharge/history

    GET
    /api/v1/billing/auto-recharge/history

    Get auto-recharge history

    Parameters

    NameTypeRequiredDescription
    pageintegerOptionalPage numberDefault: 1
    per_pageintegerOptionalResults per pageDefault: 20

    Request Example

    Bash
    curl -X GET https://api.alterlab.io/api/v1/billing/auto-recharge/history \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "status": "ok"
    }

    POST /api/v1/billing/auto-recharge/test

    POST
    /api/v1/billing/auto-recharge/test

    Test auto-recharge

    Request Example

    Bash
    curl -X POST https://api.alterlab.io/api/v1/billing/auto-recharge/test \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "success": true,
      "payment_method_valid": true,
      "card_expired": true,
      "card_days_until_expiry": "example",
      "message": "example",
      "card_brand": "example"
    }

    GET /api/v1/billing/balance

    GET
    /api/v1/billing/balance

    Get current balance

    Request Example

    Bash
    curl -X GET https://api.alterlab.io/api/v1/billing/balance \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "balance_microcents": 0,
      "balance_display": "example",
      "total_deposited_cents": 0,
      "total_spent_cents": 0,
      "tier": "example",
      "auto_recharge": "example"
    }

    POST /api/v1/billing/change-plan

    POST
    /api/v1/billing/change-plan

    Change Plan

    Request Example

    Bash
    curl -X POST https://api.alterlab.io/api/v1/billing/change-plan \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "status": "ok"
    }

    POST /api/v1/billing/checkout

    POST
    /api/v1/billing/checkout

    Create a checkout session

    Parameters

    NameTypeRequiredDescription
    price_idstring
    Required
    Price Id
    success_urlstring
    Required
    Success Url
    cancel_urlstring
    Required
    Cancel Url
    modestringOptionalModeDefault: subscription

    Request Example

    Bash
    curl -X POST https://api.alterlab.io/api/v1/billing/checkout \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "price_id": "example_price_id",
        "success_url": "example_success_url",
        "cancel_url": "example_cancel_url",
        "mode": "example_mode"
      }'

    Response Example

    JSON
    {
      "session_id": "example",
      "url": "example"
    }

    GET /api/v1/billing/cost-projection

    GET
    /api/v1/billing/cost-projection

    Get cost projection

    Parameters

    NameTypeRequiredDescription
    X-Organization-IdstringOptionalX-Organization-Id

    Request Example

    Bash
    curl -X GET https://api.alterlab.io/api/v1/billing/cost-projection \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "usage_trend": "example",
      "credits_used": 0,
      "credits_allocated": 0
    }

    GET /api/v1/billing/credit-transactions

    GET
    /api/v1/billing/credit-transactions

    Get credit transactions

    Parameters

    NameTypeRequiredDescription
    limitintegerOptionallimitDefault: 20
    offsetintegerOptionaloffsetDefault: 0
    reference_typestringOptionalFilter by reference_type (e.g. 'crawl')
    X-Organization-IdstringOptionalX-Organization-Id

    Request Example

    Bash
    curl -X GET https://api.alterlab.io/api/v1/billing/credit-transactions \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "transactions": [],
      "total": 0,
      "has_more": true
    }

    POST /api/v1/billing/deposit

    POST
    /api/v1/billing/deposit

    Create a deposit

    Parameters

    NameTypeRequiredDescription
    amount_centsinteger
    Required
    Amount to deposit in cents ($10-$2000)
    success_urlstringOptionalsuccess_url
    cancel_urlstringOptionalcancel_url
    promo_codestringOptionalpromo_code
    auto_recharge_enabledbooleanOptionalIf true, enable auto-recharge after successful depositDefault: False
    auto_recharge_threshold_microcentsintegerOptionalauto_recharge_threshold_microcents
    auto_recharge_amount_centsintegerOptionalauto_recharge_amount_cents

    Request Example

    Bash
    curl -X POST https://api.alterlab.io/api/v1/billing/deposit \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "amount_cents": 0,
        "auto_recharge_enabled": false
      }'

    Response Example

    JSON
    {
      "session_id": "example",
      "url": "example",
      "amount_cents": 0,
      "amount_display": "example"
    }

    GET /api/v1/billing/invoices

    GET
    /api/v1/billing/invoices

    Get invoice history

    Parameters

    NameTypeRequiredDescription
    limitintegerOptionallimitDefault: 10
    X-Organization-IdstringOptionalX-Organization-Id

    Request Example

    Bash
    curl -X GET https://api.alterlab.io/api/v1/billing/invoices \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "status": "ok"
    }

    GET /api/v1/billing/payment-methods

    GET
    /api/v1/billing/payment-methods

    List payment methods

    Request Example

    Bash
    curl -X GET https://api.alterlab.io/api/v1/billing/payment-methods \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "payment_methods": [],
      "default_method_id": "example"
    }

    POST /api/v1/billing/payment-methods

    POST
    /api/v1/billing/payment-methods

    Add a payment method

    Parameters

    NameTypeRequiredDescription
    payment_method_idstring
    Required
    Payment Method Id

    Request Example

    Bash
    curl -X POST https://api.alterlab.io/api/v1/billing/payment-methods \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "payment_method_id": "example_payment_method_id"
      }'

    Response Example

    JSON
    {
      "id": "example",
      "stripe_payment_method_id": "example",
      "type": "example",
      "card_brand": "example",
      "card_last4": "example",
      "card_exp_month": "example"
    }

    DELETE /api/v1/billing/payment-methods/{payment_method_id}

    DELETE
    /api/v1/billing/payment-methods/{payment_method_id}

    Remove a payment method

    Parameters

    NameTypeRequiredDescription
    payment_method_idstring
    Required
    payment_method_id

    Request Example

    Bash
    curl -X DELETE https://api.alterlab.io/api/v1/billing/payment-methods/<payment_method_id> \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "status": "ok"
    }

    POST /api/v1/billing/payment-methods/{payment_method_id}/default

    POST
    /api/v1/billing/payment-methods/{payment_method_id}/default

    Set default payment method

    Parameters

    NameTypeRequiredDescription
    payment_method_idstring
    Required
    payment_method_id

    Request Example

    Bash
    curl -X POST https://api.alterlab.io/api/v1/billing/payment-methods/<payment_method_id>/default \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "status": "ok"
    }

    POST /api/v1/billing/portal

    POST
    /api/v1/billing/portal

    Create a Stripe portal session

    Request Example

    Bash
    curl -X POST https://api.alterlab.io/api/v1/billing/portal \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "url": "example"
    }

    POST /api/v1/billing/promo/validate

    POST
    /api/v1/billing/promo/validate

    Validate Promo Code

    Parameters

    NameTypeRequiredDescription
    codestring
    Required
    Code

    Request Example

    Bash
    curl -X POST https://api.alterlab.io/api/v1/billing/promo/validate \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "code": "example_code"
      }'

    Response Example

    JSON
    {
      "valid": true,
      "bonus_type": "example",
      "bonus_value": "example",
      "max_credits_microcents": "example",
      "max_credits_display": "example",
      "min_deposit_cents": "example"
    }

    GET /api/v1/billing/recent-activity

    GET
    /api/v1/billing/recent-activity

    Get recent billing activity

    Parameters

    NameTypeRequiredDescription
    limitintegerOptionallimitDefault: 10
    offsetintegerOptionaloffsetDefault: 0

    Request Example

    Bash
    curl -X GET https://api.alterlab.io/api/v1/billing/recent-activity \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "activities": [],
      "total": 0,
      "has_more": true
    }

    POST /api/v1/billing/setup-intent

    POST
    /api/v1/billing/setup-intent

    Create a setup intent

    Request Example

    Bash
    curl -X POST https://api.alterlab.io/api/v1/billing/setup-intent \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "client_secret": "example",
      "id": "example"
    }

    GET /api/v1/billing/subscription

    GET
    /api/v1/billing/subscription

    Get Subscription

    Request Example

    Bash
    curl -X GET https://api.alterlab.io/api/v1/billing/subscription \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "status": "ok"
    }

    GET /api/v1/billing/usage-alerts

    GET
    /api/v1/billing/usage-alerts

    Get usage alert settings

    Request Example

    Bash
    curl -X GET https://api.alterlab.io/api/v1/billing/usage-alerts \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "enabled": true,
      "threshold_50_enabled": true,
      "threshold_75_enabled": true,
      "threshold_90_enabled": true,
      "threshold_100_enabled": true,
      "email_enabled": true
    }

    PUT /api/v1/billing/usage-alerts

    PUT
    /api/v1/billing/usage-alerts

    Update usage alert settings

    Parameters

    NameTypeRequiredDescription
    enabledbooleanOptionalEnabledDefault: True
    threshold_50_enabledbooleanOptionalThreshold 50 EnabledDefault: False
    threshold_75_enabledbooleanOptionalThreshold 75 EnabledDefault: True
    threshold_90_enabledbooleanOptionalThreshold 90 EnabledDefault: True
    threshold_100_enabledbooleanOptionalThreshold 100 EnabledDefault: True
    email_enabledbooleanOptionalEmail EnabledDefault: True
    webhook_urlstringOptionalwebhook_url

    Request Example

    Bash
    curl -X PUT https://api.alterlab.io/api/v1/billing/usage-alerts \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "enabled": false,
        "threshold_50_enabled": false,
        "threshold_75_enabled": false,
        "threshold_90_enabled": false,
        "threshold_100_enabled": false
      }'

    Response Example

    JSON
    {
      "enabled": true,
      "threshold_50_enabled": true,
      "threshold_75_enabled": true,
      "threshold_90_enabled": true,
      "threshold_100_enabled": true,
      "email_enabled": true
    }

    GET /api/v1/billing/usage-breakdown

    GET
    /api/v1/billing/usage-breakdown

    Get usage breakdown

    Parameters

    NameTypeRequiredDescription
    X-Organization-IdstringOptionalX-Organization-Id

    Request Example

    Bash
    curl -X GET https://api.alterlab.io/api/v1/billing/usage-breakdown \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "light": "example",
      "js": "example",
      "pdf": "example",
      "ocr": "example",
      "crawl": "example",
      "total_credits": 0
    }

    GET /api/v1/billing/usage-chart

    GET
    /api/v1/billing/usage-chart

    Get usage chart data

    Parameters

    NameTypeRequiredDescription
    daysintegerOptionaldaysDefault: 30
    X-Organization-IdstringOptionalX-Organization-Id

    Request Example

    Bash
    curl -X GET https://api.alterlab.io/api/v1/billing/usage-chart \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "data": [],
      "period": "example"
    }

    GET /api/v1/billing/usage-realtime

    GET
    /api/v1/billing/usage-realtime

    Get real-time usage

    Parameters

    NameTypeRequiredDescription
    X-Organization-IdstringOptionalX-Organization-Id

    Request Example

    Bash
    curl -X GET https://api.alterlab.io/api/v1/billing/usage-realtime \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json"

    Response Example

    JSON
    {
      "credits_used_today": 0,
      "credits_used_week": 0,
      "credits_used_month": 0,
      "requests_today": 0,
      "requests_week": 0,
      "requests_month": 0
    }

    POST /api/v1/billing/verify/confirm

    POST
    /api/v1/billing/verify/confirm

    Verify Code

    Parameters

    NameTypeRequiredDescription
    challenge_idstring
    Required
    Challenge Id
    codestring
    Required
    Code

    Request Example

    Bash
    curl -X POST https://api.alterlab.io/api/v1/billing/verify/confirm \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "challenge_id": "example_challenge_id",
        "code": "example_code"
      }'

    Response Example

    JSON
    {
      "success": true,
      "message": "example",
      "remaining_attempts": 0
    }

    POST /api/v1/billing/verify/initiate

    POST
    /api/v1/billing/verify/initiate

    Initiate Verification

    Parameters

    NameTypeRequiredDescription
    actionstring
    Required
    Action
    methodstringOptionalMethodDefault: email

    Request Example

    Bash
    curl -X POST https://api.alterlab.io/api/v1/billing/verify/initiate \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "action": "example_action",
        "method": "example_method"
      }'

    Response Example

    JSON
    {
      "challenge_id": "example",
      "method": "example",
      "action": "example",
      "expires_at": "example",
      "masked_destination": "example"
    }
    Last updated: March 2026

    On this page