TokenSniped
HomeDashboardDocs
HomeDashboardDocs
TokenSniped
    • Introduction
    • Quick Start
    • Frequently Asked Questions
    • Code Examples
    • Error Handling
    • Best Practices
    • Captcha Solving
      • Solve Geetest v4
        POST
      • Solve Cloudflare Turnstile
        POST
      • Solve WAF/Interstitial Challenge
        POST
    • Status & History
      • Get solve request status
        GET
      • Get solve history
        GET
    • Real-Time (SSE)
      • Stream solve status
        GET
      • Stream dashboard updates
        GET
      • Stream live solves
        GET
    • API Keys
      • List API keys
        GET
      • Create API key
        POST
      • Update API key
        PATCH
      • Delete API key
        DELETE
    • Billing
      • Get credit balance
        GET
      • Claim daily free credits
        POST
      • Get transaction history
        GET
      • Create Stripe checkout
        POST
      • Create crypto payment
        POST
      • List crypto currencies
        GET
    • Health check
      GET
    • Schemas
      • Schemas
        • GeetestRequest
        • TurnstileRequest
        • InterstitialRequest
        • CreateApiKeyRequest
        • UpdateApiKeyRequest
        • GeetestSuccessResponse
        • TurnstileSuccessResponse
        • InterstitialSuccessResponse
        • SolveErrorResponse
        • SolveStatusResponse
        • SolveHistoryItem
        • ApiKey
        • ApiKeyCreatedResponse
        • BalanceResponse
        • Transaction
        • StripeCheckoutResponse
        • CryptoCheckoutResponse
        • ErrorResponse
      • Response
        • ValidationError
        • Unauthorized
        • Forbidden
        • NotFound
        • InsufficientCredits
        • RateLimited
        • SolverError
    HomeDashboardDocs
    HomeDashboardDocs
    TokenSniped

    Error Handling

    Complete guide to handling errors from the TokenSniped API.

    HTTP Status Codes#

    CodeMeaningAction
    200SuccessProcess the result
    400Bad RequestFix your request parameters
    401UnauthorizedCheck your API key
    402Insufficient CreditsAdd more credits
    403ForbiddenCheck resource ownership
    404Not FoundCheck the request ID
    429Rate LimitedWait and retry
    500Server ErrorRetry with backoff

    Error Response Format#

    All errors follow this structure:
    {
      "error": "Error Type",
      "message": "Human-readable description",
      "details": "Additional context (optional)"
    }

    Common Errors#

    Authentication Errors (401)#

    Missing API Key
    {
      "error": "Unauthorized",
      "message": "API key required. Use: Authorization: Bearer <api_key>"
    }
    Solution: Add the Authorization header:
    Invalid API Key
    {
      "error": "Unauthorized",
      "message": "Invalid or expired API key"
    }
    Solution:
    Check for typos in your key
    Ensure the key is active in your dashboard
    Generate a new key if needed
    Disabled API Key
    {
      "error": "Unauthorized",
      "message": "API key is disabled"
    }
    Solution: Re-enable the key in Dashboard → API Keys

    Validation Errors (400)#

    Missing Required Field
    {
      "error": "Validation Error",
      "message": "Invalid request body",
      "details": "sitekey is required"
    }
    Solution: Check the API docs for required fields
    Invalid Field Format
    {
      "error": "Validation Error",
      "message": "Invalid request body",
      "details": "url must be a valid URL"
    }
    Solution: Ensure URLs include protocol (https://)

    Credit Errors (402)#

    Insufficient Credits
    {
      "error": "Insufficient Credits",
      "message": "This request requires 0.5 credits, but you only have 0.25 credits",
      "required": 0.5,
      "available": 0.25,
      "topUpUrl": "/dashboard/billing"
    }
    Solution:
    1.
    Add credits via card or crypto
    2.
    Claim your free daily credits
    3.
    Wait for daily reset if using free tier

    Rate Limit Errors (429)#

    Rate Limit Exceeded
    {
      "error": "Rate Limit Exceeded",
      "message": "Rate limit of 60 requests per minute exceeded",
      "retryAfter": 45
    }
    Headers included:
    RateLimit-Limit: 60
    RateLimit-Remaining: 0
    RateLimit-Reset: 1699900000
    Retry-After: 45
    Solution:
    Increase limits: Edit your API key in the dashboard to increase RPM/RPD limits.

    Solve Errors (500)#

    When a captcha fails to solve, you get:
    {
      "success": false,
      "request_id": "550e8400-e29b-41d4-a716-446655440000",
      "error": "Timeout waiting for challenge",
      "solve_time_ms": 30000
    }
    Note: Failed solves are not charged.
    Common solve errors:
    ErrorCauseSolution
    Timeout waiting for challengeChallenge took too longIncrease timeout, try again
    Invalid captcha_idWrong captcha IDRe-extract from target page
    Challenge not foundCaptcha not presentVerify URL has captcha
    Proxy connection failedBad proxyCheck proxy credentials/status
    Page load failedTarget site downCheck if site is accessible

    Handling Errors in Code#

    Python#

    JavaScript#

    Retry Strategy#

    Implement exponential backoff for transient errors:

    Getting Help#

    If you encounter persistent errors:
    1.
    Check the status page for outages
    2.
    Search our Discord for similar issues
    3.
    Email [email protected] with:
    Your request_id
    The error message
    The request parameters (without sensitive data)
    Modified at 2025-12-02 02:27:00
    Previous
    Code Examples
    Next
    Best Practices
    Built with