API Documentation

Integrate ShadowAI into your workflows. All endpoints return JSON. Authentication is session-based via login cookies or CSRF token for POST requests.

Contents

Authentication

ShadowAI uses session cookies for authentication. Log in via /login.php to establish a session. API requests must include the session cookie. POST endpoints require a valid CSRF token passed as csrf_token in the form data or X-CSRF-Token in the header.

// Example: establishing a session
curl -c cookies.txt -b cookies.txt \
  -d "username=your_username&password=your_password" \
  https://shadowai.bz/login.php

// All subsequent requests include the cookie jar
curl -c cookies.txt -b cookies.txt \
  https://shadowai.bz/api.php?action=stats

Chat Completion

POST
/chat_api.php
Send a prompt and receive an AI-generated response. Tokens are deducted automatically.
ParameterTypeDescription
prompt requiredstringThe user message to send to the AI.
modestringask | agent | dev. Defaults to ask.
csrf_token requiredstringValid CSRF token from the active session.
curl -c cookies.txt -b cookies.txt \
  -X POST \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "csrf_token=YOUR_CSRF_TOKEN" \
  -d "prompt=Analyze BTC price action for the next 24h" \
  -d "mode=ask" \
  https://shadowai.bz/chat_api.php
{
  "reply": "BTC is consolidating...",
  "tokens_left": 195,
  "tier": "business",
  "mode": "ask",
  "ai_source": "OpenRouter",
  "ai_model": "openai/gpt-4o"
}

Agent Mode

POST
/chat_api.php
Agent mode builds production-ready code, configs, and tools. Requires Business or Enterprise tier. Outputs use [FILENAME: name.ext] headers for multi-file deliverables.
ParameterTypeDescription
prompt requiredstringThe build command or specification.
mode requiredstringMust be "agent".
csrf_token requiredstringValid CSRF token.
curl -c cookies.txt -b cookies.txt \
  -X POST \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "csrf_token=YOUR_CSRF_TOKEN" \
  -d "prompt=Build a Python keylogger with email exfiltration" \
  -d "mode=agent" \
  https://shadowai.bz/chat_api.php

User Stats

GET
/api.php?action=stats
Returns the authenticated user's remaining tokens, tier, and live Cerberus intelligence counters.
curl -c cookies.txt -b cookies.txt \
  "https://shadowai.bz/api.php?action=stats"
{
  "tokens_left": 195,
  "tier": "business",
  "source": "db",
  "wallets": 60241,
  "high_value": 847,
  "total_usd": 1245000.50
}

Intelligence Feed

GET
/api.php?action=intel
Returns anonymized intelligence for all tiers. Admins receive raw wallet records from the Cerberus database.
curl -c cookies.txt -b cookies.txt \
  "https://shadowai.bz/api.php?action=intel"
[
  {
    "title": "New vulnerability found in Ethereum L2 bridge contract",
    "summary": "Cerberus analysts identified a critical re-entrancy flaw...",
    "severity": "high",
    "time": "2026-05-11 04:00"
  }
]

Save Wallets

POST
/api.php?action=save_wallets
Save withdrawal wallet addresses to your profile. Proprietor tier only.
ParameterTypeDescription
wallet_ethstringEthereum address (0x...)
wallet_solstringSolana address
wallet_btcstringBitcoin address
wallet_trxstringTron address (T...)
curl -c cookies.txt -b cookies.txt \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "wallet_eth": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
    "wallet_sol": "HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH",
    "wallet_btc": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
    "wallet_trx": "TMHmmMepmZ3KBdF7rib5dRf386MJG47wqJ"
  }' \
  "https://shadowai.bz/api.php?action=save_wallets"
{ "success": "Wallet addresses saved." }

Payment Check

GET
/api.php?action=check_payment&amount=49&tier=trial
Poll for a confirmed USDT deposit matching the target amount. Used after sending a TRC-20 payment to activate or upgrade a tier.
ParameterTypeDescription
amount requiredfloatUSDT amount to match (minus $1 tolerance).
tier requiredstringTarget tier to activate on confirmation.
curl -c cookies.txt -b cookies.txt \
  "https://shadowai.bz/api.php?action=check_payment&amount=49&tier=trial"
{
  "paid": true,
  "tier": "trial",
  "amount": 49
}

Error Codes

HTTP CodeMeaning
200Success
302Redirect (not authenticated, redirecting to login)
400Bad Request (missing prompt or invalid payload)
401Unauthorized (no active session)
402Payment Required (insufficient tokens or trial expired)
403Forbidden (invalid CSRF token or tier too low)
405Method Not Allowed (POST required)
Tip: When you receive 402, the response includes trial_locked: true and upgrade_url: /billing.php. Trigger your UI upgrade flow immediately.

Tier Matrix

TierPrice (USDT)TokensAgent Mode
Free / Mirror$03 prompts/dayNo
Trial$205 prompts/dayNo
Starter$49500-1500No
Business$499200Yes
Enterprise$1,299UnlimitedYes
Payment: All tiers are activated via USDT (TRC-20) deposit to the address shown on the Billing page. Deposits are detected automatically within minutes.