API documentation

Everything you need to call the Turnstile token, session clearance, and JavaScript deobfuscation APIs — or connect via MCP.

Plain-text version of this page

Overview

Astify is a REST API. Send JSON over HTTPS to https://api.astify.dev, authenticate with Authorization: Bearer <API_KEY> (or x-api-key), and read each call's cost from the response headers.

Endpoints are abstracted by capability: /v1/token for Turnstile verification tokens, /v1/clearance for proxy-bound session clearance cookies, and /v1/deobfuscate for JavaScript code restoration.

POST /v1/tokenTurnstile Token (/v1/token)
POST /v1/clearanceSession Clearance (/v1/clearance)
POST /v1/deobfuscateDeobfuscation (/v1/deobfuscate)

Authentication

Create an API key in your dashboard and send it via `Authorization: Bearer <key>` or `x-api-key: <key>` on every request. Keep it on your server: anyone holding the key can spend your credits.

Authorization: Bearer $ASTIFY_API_KEY
# or:
x-api-key: $ASTIFY_API_KEY

Turnstile Token (/v1/token)

POST https://api.astify.dev/v1/token

Returns a single-use Turnstile verification token (POST /v1/token, alias POST /v1/turnstile). Supports both default system egress (10 credits / $5.00 per 1k) and custom proxy (9 credits / $4.50 per 1k).

Guide, proxy modes and common questions

Request

curl -X POST https://api.astify.dev/v1/token \
  -H "Authorization: Bearer $ASTIFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sitekey": "0x4AAAAAAABS7vwvV6VFfMcD",
    "url": "https://example.com/login"
  }'

Parameters

ParameterDescription
sitekeystring, requiredTurnstile widget sitekey (e.g. 0x4AAAAAAABS7vwvV6VFfMcD).
urlstring, requiredFull URL of the page hosting the verification widget.
proxystring, optionalOptional custom proxy (http://user:pass@host:port, socks5://...). Passing a proxy lowers the cost to 9 credits ($4.50/1k).
actionstring, optionalOptional widget action parameter if configured by the target site.
cDatastring, optionalOptional widget cData string if configured by the target site.

Response

{
  "success": true,
  "ok": true,
  "token": "0.aB3dEf9gHiJkLmNoPqRsTuVwXyZ…(1024 chars)",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
  "proxyMode": "managed",
  "requiresIpConsistency": false,
  "tookMs": 3420
}

Response fields

FieldDescription
successbooleantrue when a valid token was obtained. A false response costs 0 credits.
tokenstringSingle-use verification token (valid for ~5 minutes).
userAgentstringUser-Agent used during verification.
proxyMode"own" | "managed"own if you passed proxy, managed if system default egress was used.
requiresIpConsistencybooleanAlways false for /v1/token.
tookMsnumberEnd-to-end solve duration in milliseconds.

Session Clearance (/v1/clearance)

POST https://api.astify.dev/v1/clearance

Returns a cf_clearance cookie and bound userAgent (POST /v1/clearance). Strictly requires a custom proxy parameter so your follow-up requests preserve IP, User-Agent, and fingerprint consistency. Fixed cost: 10 credits ($5.00 per 1k).

Guide, proxy modes and common questions

Request

curl -X POST https://api.astify.dev/v1/clearance \
  -H "Authorization: Bearer $ASTIFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/",
    "proxy": "http://user:[email protected]:8080"
  }'

Parameters

ParameterDescription
urlstring, requiredProtected target page URL that issues a cf_clearance cookie.
proxystring, requiredRequired custom proxy (http://user:pass@host:port, socks5://...). Must be non-empty to keep IP, User-Agent, and fingerprint consistent.

Response

{
  "success": true,
  "ok": true,
  "cf_clearance": "q7Yw0mJ1c2V…xNzMxNTg1NjAw-1.2.1.1",
  "cookies": {
    "cf_clearance": "q7Yw0mJ1c2V…xNzMxNTg1NjAw-1.2.1.1"
  },
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
  "proxyMode": "own",
  "requiresIpConsistency": true,
  "tookMs": 5180
}

Response fields

FieldDescription
successbooleantrue when a clearance cookie was obtained. A false response costs 0 credits.
cf_clearancestringThe cf_clearance cookie value to attach to your target domain.
cookiesobjectKey-value map of returned session cookies (including cf_clearance).
userAgentstringThe exact User-Agent bound to cf_clearance. Send it on every follow-up request.
proxyMode"own"Always own for /v1/clearance.
requiresIpConsistencybooleanAlways true — follow-up requests must reuse the exact same proxy IP and userAgent.
tookMsnumberEnd-to-end solve duration in milliseconds.

Deobfuscation (/v1/deobfuscate)

POST https://api.astify.dev/v1/deobfuscate

Returns readable source for obfuscated JavaScript. Uses dynamic complexity-based pricing (lines of code, complexity multiplier, and detected obfuscator), starting from 2,000 credits ($1.00).

Request

curl -X POST https://api.astify.dev/v1/deobfuscate \
  -H "Authorization: Bearer $ASTIFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "var _0x4a2b=[\"\\x6c\\x6f\\x67\"];console[_0x4a2b[0]](\"hi\");"
  }'

Parameters

ParameterDescription
codestring, requiredJavaScript source, up to 30 MB.

Response

{
  "success": true,
  "code": "console.log(\"hi\");",
  "bytesIn": 58,
  "bytesOut": 19,
  "credits": 2000
}

Response fields

FieldDescription
successbooleantrue when readable source was produced. A false response costs 0 credits.
codestringThe readable source.
bytesInnumberSize of the input in bytes.
bytesOutnumberSize of the output in bytes.
creditsnumberDynamic complexity-based credits charged for this file (minimum 2,000 credits).

MCP (Model Context Protocol)

Connect Astify to Claude Desktop, Cursor, or Claude Code via https://astify.dev/mcp. Authenticate with either a Dashboard API Key (Authorization: Bearer <API_KEY>) or OAuth 2.1.

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "astify": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://astify.dev/mcp",
        "--header",
        "Authorization: Bearer <YOUR_ASTIFY_API_KEY>"
      ]
    }
  }
}

Cursor / Claude Code (Streamable HTTP)

{
  "mcpServers": {
    "astify": {
      "type": "http",
      "url": "https://astify.dev/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_ASTIFY_API_KEY>"
      }
    }
  }
}

Exposed MCP tools: solve_turnstile, solve_clearance, analyze_javascript, submit_deobfuscation, get_job_status, get_deobfuscation_result, and get_account_info.

Billing headers

Every response carries two headers, whether the call succeeded or not.

HeaderMeaning
X-Astify-CostCredits charged for this call. 0 when the call failed.
X-Astify-BalanceCredits left in your balance after this call.

Errors

Errors use standard HTTP status codes and a JSON body with success: false and an error object. A failed call is never charged.

StatusMeaning
400Invalid JSON, missing required field, or missing proxy on /v1/clearance (proxy_required).
401The API key is missing or not valid.
402Not enough credits. Top up with crypto in the dashboard, then retry.
422Request schema validation failed.
424The solve failed upstream. Not charged (0 credits), safe to retry.
429Too many requests in flight for your concurrency limit. Wait the Retry-After seconds, then retry.

Concurrency

Each account has a limit on requests in flight: 2 by default, more with a concurrency pack. A request over the limit gets 429 and a Retry-After header with the seconds to wait.

Concurrency packs and prices

Deobfuscation engine

Astify can detect and handle a wide range of obfuscation techniques used by popular JavaScript obfuscators.

Patterns it detects

hex-identifiersHexadecimal variable and function names like _0x1a2b
string-encryptionEncrypted or encoded strings with runtime decryption
control-flow-flatteningSwitch-based control flow with state machines
dead-codeUnreachable code injected to confuse analysis
opaque-predicatesAlways-true/false conditions that obscure logic
debug-protectionCode that detects and blocks debugging attempts
self-defendingSelf-modifying code that breaks when formatted
domain-lockCode that only runs on specific domains
eval-usageDynamic code execution using eval()
unicode-escapeUnicode escape sequences for strings

Obfuscators it recognises

Obfuscator.ioMost popular open-source JavaScript obfuscator
JScramblerEnterprise-grade code protection service
JavaScript-ObfuscatorNode.js obfuscation library
Webpack / BundlersBundled and minified code from build tools

Limits

Maximum file size30 MB
Supported file types.js, .mjs, .cjs
File retention period7 days