... agent(s) online

LANAgent API

27 paid services across 17 plugins: AI content detection, web search, Chainlink oracle feeds, HuggingFace AI, YouTube, social-media downloads (TikTok, Rumble, BitChute, x.com and the rest of yt-dlp's ~1800 extractors), media, image gen, code sandbox, PDF, and more. Pay with Stripe or crypto. Auto-refund on failures.

Get API Key โ€” From $5 Quick Start Reference AI Agents (MCP) Log In
50 seconds: services, pricing, a first request, MCP for AI agents.

25 Services

All accessible via a single API key. Failed requests auto-refund. Dimmed = currently offline.

๐Ÿ”Ž
AI Content Detector โ€” 5 cr

Detect AI-generated text, images, video, and audio

๐ŸŒ
Web Scraping โ€” 1โ€“3 cr

Tiered: basic 1, stealth 2, full 3, render 3. Metadata, text, links, HTML, screenshots

๐Ÿ—„๏ธ
Web Archive โ€” 1โ€“2 cr

Cache lookup 1, full-text corpus search 2, snapshot timeline 1, cache-first scrape 2. Pulls from an existing archive instead of re-scraping.

๐ŸŽฌ
YouTube โ€” 8โ€“10 cr

Audio (MP3) 8 cr, Video (MP4) 10 cr

๐Ÿ“ฒ
Social Media Downloads โ€” 8โ€“10 cr

TikTok, Rumble, BitChute, x.com, SoundCloud, Streamable, Dailymotion, Bilibili, Twitch + the rest of yt-dlp's ~1800 extractors. MP3 8 cr, MP4 10 cr.

๐ŸŽจ
Image Generation โ€” 30 cr

AI text-to-image from prompts

๐Ÿ”„
Media Transcoding โ€” 20 cr

Convert, trim, compress, extract audio/video via FFmpeg

๐ŸŽ™๏ธ
Audio Transcription โ€” 2 cr/min

Speech to text from any common audio/video file, or a YouTube/TikTok/etc. URL (+5 cr). Up to 60 min. Billed per started minute โ€” measured before charging

๐Ÿ”Š
Text to Speech โ€” 1 cr/1K chars

MP3 speech from text: Kokoro, Orpheus and Sesame voices at 1 credit per 1,000 characters, or MAI, Grok, ElevenLabs and Voxtral at 3. Up to 5,000 characters. Priced before charging

๐Ÿ“„
Document OCR โ€” 10 cr

Text extraction from images and scans

๐Ÿ’ป
Code Sandbox โ€” 20 cr

Python, Node, Bash, Ruby, Go

๐Ÿ“‘
PDF Toolkit โ€” 5 cr

Merge, split, compress, extract text

๐Ÿ”
Web Search โ€” 2 cr

Real web search, stocks, crypto, weather, news

๐Ÿค–
HuggingFace AI โ€” 10 cr

Sentiment, summarization, QA, translation, embeddings

โ›“๏ธ
Chainlink Oracles โ€” 1 cr

Price feeds across 7 networks

๐Ÿช™
Token Profiler โ€” 3 cr

Token analysis, holder distribution, risk score

๐Ÿ‘›
Wallet Profiler โ€” 3 cr

Wallet analysis, transaction history, risk assessment

๐Ÿ”
Contract Audit โ€” 5 cr

Smart contract security analysis

๐Ÿ–ผ๏ธ
Image Tools โ€” 2 cr

Resize, optimize, watermark, transform

๐Ÿงฉ
Challenge Questions โ€” 2 cr

Bot-filtering captcha alternatives

๐Ÿ“ฐ
News โ€” 1 cr

Headlines, search articles, sources

๐ŸŒŒ
NASA โ€” 1 cr

APOD, Mars Rover, NEOs, Earth imagery

๐ŸŽต
Lyrics โ€” 1 cr

Song lyrics search, synced LRC format

๐ŸŽฎ
Anime โ€” 1 cr

Search, details, top rated, recommendations

๐Ÿ“น
yt-dlp โ€” 3 cr

Download from 1000+ video sites

๐ŸŽž๏ธ
FFmpeg โ€” 5 cr

Professional media transcoding

โ›…
Weather โ€” 1 cr

Current conditions, forecasts, historical

โšก
Auto-Refund

Failed requests are never charged

Full catalog: GET /service/catalog โ€” all available services with descriptions and credit costs

Pricing

Every endpoint is paid with credits. Buy them once, get them every month, or have them topped up automatically. Scraping at high volume? A scraper plan adds a cheap /scrape quota on top.

Credits ยท one-time
Try it, or use it now and then
  • Every endpoint
  • Never expire
  • No subscription
From $5 โ†’
Credits ยท monthly
Steady use, every month
  • Every endpoint
  • 10% more credits than packs
  • Unused credits roll over ยท cancel any time
From $5/mo โ†’
Scraper plan
Thousands of scrapes a month
  • /scrape only
  • Includes no credits
  • Other endpoints still use credits
From $10/mo โ†’

โšก Auto top-up: once signed in, choose a balance and a pack, and we refill your credits with your saved card when you run low (at most 3 times a day).

Credits โ€” one-time, never expire

For every endpoint: scraping, search, YouTube, AI image generation, transcoding, code sandbox, PDF tools, plugins.

Starter

$5
400 credits
$0.0125 / credit

Growth

$15
1,300 credits
$0.0115 / credit โ€” save 8%

Pro

$50
4,700 credits
$0.0106 / credit โ€” save 15%

Credits โ€” every month, 10% more

The same credits, for every endpoint, added to your balance each month. Unused credits roll over and never expire. Cancel from your dashboard in one click: no more charges, and your credits stay.

Credits Starter

$5/mo
440 credits / month
$0.0114 / credit
BEST VALUE

Credits Growth

$15/mo
1,430 credits / month
$0.0105 / credit

Credits Pro

$50/mo
5,170 credits / month
$0.0097 / credit

Scraper plans โ€” /scrape only

These include no credits. A scraper plan is a monthly quota for /scrape at a much lower price per page. Every other endpoint still takes credits. If you want credits every month, choose Credits โ€” every month above.

Two quota buckets per plan: basic (covers basic/stealth/full tiers) and render (JS-heavy pages with a real browser). Scrapes past the quota use credits.

Scraper Starter

$10/mo
100,000 basic + 2,500 render
~$0.0001 / basic scrape ยท no credits

Scraper Pro

$25/mo
500,000 basic + 15,000 render
~$0.00005 / basic scrape ยท no credits

Scraper Business

$50/mo
2,000,000 basic + 50,000 render
~$0.000025 / basic scrape ยท no credits

Cancel any plan from your dashboard in one click: no more charges, and what you paid for stays until the period ends. Failed scrapes never count against a quota.

Pay with Crypto (BNB/SKYNET)

No email needed. Auth with your BSC wallet, send BNB or SKYNET, get credits instantly.

Step 1: Get Nonce
curl https://api.lanagent.net/auth/nonce?wallet=0xYOUR_WALLET
# Returns: { "nonce": "scrape_gateway_auth_..." }
Step 2: Sign & Verify
curl -X POST https://api.lanagent.net/auth/verify   -H 'Content-Type: application/json'   -d '{"wallet":"0x...","signature":"0x...","nonce":"..."}'
# Returns: { "token": "eyJ..." }
Step 3: Get API Key
curl -X POST https://api.lanagent.net/auth/api-key   -H 'Authorization: Bearer YOUR_JWT'   -d '{"name":"my-app"}'
# Returns: { "apiKey": "gsk_..." }
Step 4: Check Price
curl https://api.lanagent.net/credits/price
# Returns: recipientAddress, pricePerCredit.bnb,
# pricePerCredit.skynet, bnbPrice
Step 5: Send BNB/SKYNET
# Send BNB or SKYNET to recipientAddress
# from Step 4. Use MetaMask, ethers.js, etc.
# Save the transaction hash.
Step 6: Claim Credits
curl -X POST https://api.lanagent.net/credits/purchase   -H 'X-API-Key: gsk_YOUR_KEY'   -H 'Content-Type: application/json'   -d '{"txHash":"0x...","currency":"BNB"}'
# currency must match what you sent: "BNB" or "SKYNET".
# Credits added automatically!

Prices update every 15 minutes from PancakeSwap + Chainlink oracle. Auto-refund on all failures.

Quick Start

Get an API key in 30 seconds. All examples use your gsk_* key.

1. Get Your API Key

# Sign up (returns API key instantly)
curl -X POST https://api.lanagent.net/portal/signup   -H 'Content-Type: application/json'   -d '{"email": "you@example.com", "password": "your-password"}'

# Response:
{ "apiKey": "gsk_abc123...", "token": "eyJ...", "credits": 0 }

2. Buy Credits ($5 = 400 credits)

# Start Stripe checkout (use token from signup)
curl -X POST https://api.lanagent.net/portal/checkout   -H 'Authorization: Bearer YOUR_TOKEN'   -H 'Content-Type: application/json'   -d '{"package": "starter"}'

# Response: { "checkoutUrl": "https://checkout.stripe.com/..." }
# Open the URL to complete payment. Credits added instantly.

3. Use Any Service

All 25 services use the same pattern: POST /service/{plugin}/{action}

AI Content Detector โ€” Text (5 cr)
curl -X POST https://api.lanagent.net/service/aiDetector/detectText \
  -H 'X-API-Key: gsk_YOUR_KEY' \
  -d '{"text":"The quick brown fox jumps over the lazy dog."}'
AI Content Detector โ€” Image (5 cr)
curl -X POST https://api.lanagent.net/service/aiDetector/detectImage \
  -H 'X-API-Key: gsk_YOUR_KEY' \
  -d '{"url":"https://example.com/photo.jpg"}'
AI Content Detector โ€” Audio (5 cr)
curl -X POST https://api.lanagent.net/service/aiDetector/detectAudio \
  -H 'X-API-Key: gsk_YOUR_KEY' \
  -d '{"url":"https://example.com/speech.mp3"}'
AI Content Detector โ€” Video (5 cr)
curl -X POST https://api.lanagent.net/service/aiDetector/detectVideo \
  -H 'X-API-Key: gsk_YOUR_KEY' \
  -d '{"url":"https://example.com/video.mp4"}'
Web Scraping โ€” Basic (1 cr)
curl -X POST https://api.lanagent.net/scrape   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"url":"https://news.ycombinator.com","tier":"basic"}'
# Fast static fetch. The scrape result is always under "data":
# { "success": true,
#   "data": {
#     "title":    "Hacker News",
#     "text":     "โ€ฆvisible page textโ€ฆ",
#     "links":    ["https://โ€ฆ", โ€ฆ],
#     "metadata": { "description": "โ€ฆ", "og:image": "โ€ฆ", โ€ฆ },
#     "jsonld":   [ โ€ฆ ]              # structured data when present
#   },
#   "tier": "basic", "creditsCharged": 1, "creditsRemaining": 399 }
# Tiers add fields: full/render also return data.html; render also data.screenshot.
Web Scraping โ€” Stealth (2 cr)
curl -X POST https://api.lanagent.net/scrape   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"url":"https://www.amazon.com/dp/B0DHHM3WRM","tier":"stealth"}'
// Rotates UA + bypasses anti-bot fingerprinting
Web Scraping โ€” Render (JS) (3 cr)
curl -X POST https://api.lanagent.net/scrape   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"url":"https://dexscreener.com/bsc/0x0e09f...","tier":"render","fullPage":true}'
# Headless Chromium runs the page's JS, returns the post-render content + a screenshot.
# Response (the scrape result is under "data"):
# { "success": true,
#   "data": {
#     "title":      "โ€ฆ",
#     "text":       "โ€ฆvisible textโ€ฆ",
#     "html":       "<!doctype html>โ€ฆpost-render DOMโ€ฆ",   # render/full tiers
#     "screenshot": "data:image/png;base64,iVBORw0KGgoโ€ฆ"      # render tier; PNG data URI
#   },
#   "tier": "render", "creditsCharged": 3 }
# fullPage:true โ†’ a tall full-page capture (capped ~3000px); omit for a viewport shot.
# Decode the screenshot:  echo "<base64>" | base64 -d > shot.png  (strip the data: prefix)
Web Archive โ€” Lookup (1 cr)
curl 'https://api.lanagent.net/archive/lookup?url=https://example.com&max_age=7d'   -H 'X-API-Key: gsk_YOUR_KEY'
// Latest cached snapshot with title, text, html, screenshot URLs.
// 404 + refund on no match. Cheap pre-check before a fresh scrape.
Web Archive โ€” Search (2 cr)
curl 'https://api.lanagent.net/archive/search?q=climate+report+2026&limit=10'   -H 'X-API-Key: gsk_YOUR_KEY'
// Full-text search across the corpus. Filters:
// domain=, since=, until=, quality_tier=text|full|metadata
Web Archive โ€” Scrape (2 cr)
curl -X POST https://api.lanagent.net/archive/scrape   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"url":"https://news.ycombinator.com"}'
// Flat 2 cr โ€” cache hit returns immediately at the same price.
// Cache miss (or prefer:"fresh") falls through to a fresh scrape
// and auto-ingests the result back into the archive.
Web Archive โ€” Timeline (1 cr)
curl 'https://api.lanagent.net/archive/timeline?url=https://example.com&limit=20'   -H 'X-API-Key: gsk_YOUR_KEY'
// Every snapshot of a URL with timestamps + quality tier.
// Use to detect content change over time.
YouTube โ€” Video (MP4) (10 cr)
curl -X POST https://api.lanagent.net/youtube/download   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"url":"https://youtube.com/watch?v=..."}'
YouTube โ€” Audio (MP3) (8 cr)
curl -X POST https://api.lanagent.net/youtube/audio   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"url":"https://youtube.com/watch?v=..."}'
Media Transcoding (20 cr)
curl -X POST https://api.lanagent.net/transcode   -H 'X-API-Key: gsk_YOUR_KEY'   -F 'file=@input.mov'   -F 'targetFormat=mp4' -F 'preset=social-media'
// FFmpeg: convert, trim, compress, extract audio ยท presets: social-media, podcast, archive, interview, music, gaming
Audio Transcription (2 cr/min)
curl -X POST https://api.lanagent.net/transcribe   -H 'X-API-Key: gsk_YOUR_KEY'   -F 'file=@meeting.m4a'
// mp3 wav flac m4a ogg opus webm mp4 mov mkv wma aiff amrโ€ฆ ยท up to 60 min / 100 MB

curl -X POST https://api.lanagent.net/transcribe/url   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"url":"https://youtube.com/watch?v=..."}'
// โ†’ { "text": "โ€ฆ", "minutesBilled": 3, "creditsCharged": 6 } ยท URLs +5 cr
Text to Speech (1 cr / 1K chars)
curl -s -X POST https://api.lanagent.net/tts   -H 'X-API-Key: gsk_YOUR_KEY' -H 'Content-Type: application/json'   -d '{"text":"Hello from LANAgent.","voice":"af_heart"}'   | jq -r .audio | base64 -d > hello.mp3
// โ†’ { "audio": "<base64 mp3>", "model": "hexgrad/kokoro-82m", "characters": 20, "creditsCharged": 1 }
// premium: "model":"elevenlabs/eleven-flash-v2.5","voice":"sarah" (3 cr / 1K) ยท models & voices: GET /tts/voices (free)
Image Generation (30 cr)
curl -X POST https://api.lanagent.net/image/generate   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"prompt":"A sunset over mountains"}'
Code Sandbox (20 cr)
curl -X POST https://api.lanagent.net/sandbox/execute   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"code":"print(sum(range(101)))","language":"python"}'
Anime (1 cr)
curl -X POST https://api.lanagent.net/service/anime/search   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"query":"Cowboy Bebop"}'
Chainlink Oracles โ€” Price (1 cr)
curl -X POST https://api.lanagent.net/service/chainlink/price   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"pair":"BTC"}'
Chainlink Oracles โ€” Feeds (1 cr)
curl -X POST https://api.lanagent.net/price/feeds?network=all   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{}'
HuggingFace AI โ€” Sentiment (10 cr)
curl -X POST https://api.lanagent.net/service/huggingface/sentimentAnalysis   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"inputs":"I love this product!"}'
HuggingFace AI โ€” Summary (10 cr)
curl -X POST https://api.lanagent.net/service/huggingface/textSummarization   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"inputs":"Long article text to summarize..."}'
HuggingFace AI โ€” Translation (10 cr)
curl -X POST https://api.lanagent.net/service/huggingface/translation   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"inputs":"Good morning, how are you?"}'
HuggingFace AI โ€” Zero-Shot (10 cr)
curl -X POST https://api.lanagent.net/service/huggingface/zeroShotClassification   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"inputs":"I need a phone","candidate_labels":["shopping","travel","food"]}'
Web Search (2 cr)
curl -X POST https://api.lanagent.net/service/websearch/search   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"query":"latest AI news 2026"}'
Web Search โ€” Weather (2 cr)
curl -X POST https://api.lanagent.net/service/websearch/weather   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"location":"Tokyo"}'
Web Search โ€” Stock (2 cr)
curl -X POST https://api.lanagent.net/service/websearch/stock   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"symbol":"AAPL"}'
HuggingFace AI โ€” QA (10 cr)
curl -X POST https://api.lanagent.net/service/huggingface/questionAnswering   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"question":"When was it built?","context":"The Eiffel Tower was built from 1887 to 1889."}'
News (2 cr)
curl -X POST https://api.lanagent.net/service/websearch/news   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"query":"artificial intelligence"}'
Lyrics (1 cr)
curl -X POST https://api.lanagent.net/service/lyrics/search   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"query":"bohemian rhapsody"}'
NASA (1 cr)
curl -X POST https://api.lanagent.net/service/nasa/apod   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{}'
Challenge Q&A (2 cr)
curl -X POST https://api.lanagent.net/service/challengeQuestions/generateWithAnswers   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"count":3}'
# Sample response:
# {
#   "success": true,
#   "data": {
#     "questions": [
#       { "id": 1, "type": "math",
#         "question": "What is 7 + 5?",
#         "acceptableAnswers": ["12", "twelve"] },
#       { "id": 2, "type": "color",
#         "question": "What color do you get mixing red and blue?",
#         "acceptableAnswers": ["purple", "violet"] },
#       { "id": 3, "type": "common-knowledge",
#         "question": "How many days are in a week?",
#         "acceptableAnswers": ["7", "seven"] }
#     ]
#   }
# }
Challenge Questions โ€” Verify (2 cr)
curl -X POST https://api.lanagent.net/service/challengeQuestions/generate   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"count":3}'
# Returns:
# { "data": { "token": "chq_a3f9โ€ฆ",
#             "questions": [
#               { "id": 1, "question": "What is 7 + 5?" },
#               { "id": 2, "question": "What color do you get mixing red and blue?" },
#               { "id": 3, "question": "How many days are in a week?" }
#             ],
#             "expiresIn": 600 } }
# Verify the user's answers with:
curl -X POST https://api.lanagent.net/service/challengeQuestions/verify   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"token":"chq_a3f9โ€ฆ","answers":[
       {"id":1,"answer":"12"},
       {"id":2,"answer":"purple"},
       {"id":3,"answer":"7"}
     ]}'
# { "data": { "passed": true, "score": 3, "total": 3,
#             "receipt": "cvr_b81eโ€ฆ" } }
Token Profiler (3 cr)
curl -X POST https://api.lanagent.net/service/tokenProfiler/audit \
  -H 'X-API-Key: gsk_YOUR_KEY' \
  -d '{"address":"0x8Ef0...","chain":"bsc"}'
Wallet Profiler (3 cr)
curl -X POST https://api.lanagent.net/service/walletProfiler/profile \
  -H 'X-API-Key: gsk_YOUR_KEY' \
  -d '{"address":"0xF977...","network":"bsc"}'
// Try any public address โ€” example is Binance hot wallet
Contract Audit (5 cr)
curl -X POST https://api.lanagent.net/service/contractAudit/audit \
  -H 'X-API-Key: gsk_YOUR_KEY' \
  -d '{"address":"0xFfA9...","chain":"bsc"}'
Image Tools (2 cr)
curl -X POST https://api.lanagent.net/service/imageTools/optimize \
  -H 'X-API-Key: gsk_YOUR_KEY' \
  -d '{"url":"https://example.com/photo.jpg","format":"webp","quality":80}'
# Also: /resize, /watermark, /transform
PDF Toolkit (5 cr)
curl -X POST https://api.lanagent.net/pdf/text \
  -H 'X-API-Key: gsk_YOUR_KEY' \
  -d '{"url":"https://example.com/document.pdf"}'
# Also: /pdf/merge, /pdf/split, /pdf/compress
FFmpeg (5 cr)
curl -X POST https://api.lanagent.net/service/ffmpeg/transcode \
  -H 'X-API-Key: gsk_YOUR_KEY' \
  -d '{"url":"https://example.com/video.mp4","format":"mp3"}'
YouTube โ€” Audio (MP3) (8 cr)
curl -X POST https://api.lanagent.net/youtube/audio \
  -H 'X-API-Key: gsk_YOUR_KEY' \
  -d '{"url":"https://youtube.com/watch?v=..."}'
Chainlink Oracles โ€” Feed List (1 cr)
curl -X POST https://api.lanagent.net/service/chainlink/feeds \
  -H 'X-API-Key: gsk_YOUR_KEY' \
  -d '{"network":"bsc"}'
# Also: /historical, /compare, /info
# pip install requests
import requests

API = "https://api.lanagent.net"
KEY = "gsk_YOUR_KEY"
headers = {"X-API-Key": KEY, "Content-Type": "application/json"}

# Scrape a webpage (2 credits)
r = requests.post(f"{API}/scrape", json={"url": "https://example.com"}, headers=headers)
print(r.json()["data"]["title"])

# Web Archive โ€” cache-first scrape (2 credits flat, hit OR miss)
# Same result as /scrape, but pulls from cache when possible. Falls
# through to a live agent on miss and auto-ingests the result back.
r = requests.post(f"{API}/archive/scrape", json={"url": "https://example.com"}, headers=headers)
print(r.json()["data"]["title"], "via", r.json()["agent"]["name"])

# Web Archive โ€” lookup latest cached snapshot (1 credit)
# 404 + refund on miss. Cheap pre-check before a fresh scrape.
r = requests.get(f"{API}/archive/lookup", params={"url": "https://example.com", "max_age": "7d"}, headers={"X-API-Key": KEY})
print(r.json().get("title"), "@", r.json().get("scraped_at"))

# Web Archive โ€” full-text search across the corpus (2 credits)
r = requests.get(f"{API}/archive/search", params={"q": "climate report 2026", "limit": 10}, headers={"X-API-Key": KEY})
for hit in r.json().get("hits", []):
    print(hit.get("title"))

# Search anime (1 credit)
r = requests.post(f"{API}/service/anime/search", json={"query": "Naruto"}, headers=headers)
print(r.json()["data"]["results"][0]["title"])

# Run Python code (20 credits)
r = requests.post(f"{API}/sandbox/execute", json={"code": "print(2**100)", "language": "python"}, headers=headers)
print(r.json()["stdout"])

# Chainlink price feed (1 credit)
r = requests.post(f"{API}/service/chainlink/price", json={"pair": "ETH"}, headers=headers)
print(r.json()["data"]["price"])

# Real web search (2 credits)
r = requests.post(f"{API}/service/websearch/search", json={"query": "latest AI news"}, headers=headers)
print(r.json()["result"])

# HuggingFace sentiment (10 credits)
r = requests.post(f"{API}/service/huggingface/sentimentAnalysis", json={"inputs": "I love this!"}, headers=headers)
print(r.json()["result"])  # "POSITIVE: 100.0%"

# Detect AI-generated text (5 credits)
r = requests.post(f"{API}/service/aiDetector/detectText", json={"text": "Paste any text here to check..."}, headers=headers)
print(r.json()["data"]["verdict"])  # "human", "ai_generated", or "uncertain"

# Detect AI-generated image (5 credits)
r = requests.post(f"{API}/service/aiDetector/detectImage", json={"url": "https://example.com/photo.jpg"}, headers=headers)
print(r.json()["data"]["verdict"], r.json()["data"]["confidence"])

# Bot-filtering challenge questions (2 credits)
r = requests.post(f"{API}/service/challengeQuestions/generateWithAnswers", json={"count": 3}, headers=headers)
for q in r.json()["data"]["questions"]:
    print(q["question"], "->", q["answer"])

# Token profiler (3 credits)
r = requests.post(f"{API}/service/tokenProfiler/audit", json={"address": "0x8b77CC5c6cB3d846608d9d5Dd03fA406BA03b8F1", "chain": "bsc"}, headers=headers)
print(r.json()["result"])

# Image optimization (2 credits)
r = requests.post(f"{API}/service/imageTools/optimize", json={"url": "https://example.com/photo.jpg", "format": "webp", "quality": 80}, headers=headers)
print(r.json()["result"])

# Lyrics search (1 credit)
r = requests.post(f"{API}/service/lyrics/search", json={"query": "bohemian rhapsody"}, headers=headers)
print(r.json()["result"][:80])

# Image generation (30 credits)
r = requests.post(f"{API}/image/generate", json={"prompt": "A sunset over mountains"}, headers=headers)
print(r.json().get("downloadUrl", r.json().get("result", "")))

# NASA Astronomy Picture of the Day (1 credit)
r = requests.post(f"{API}/service/nasa/apod", json={}, headers=headers)
print(r.json()["data"]["title"], "-", r.json()["data"]["explanation"][:100])

# Check remaining credits
print("Credits left:", r.json()["creditsRemaining"])

API Reference โ†“ โ€” auth, billing, error codes, rate limits, challenge-question details. Full catalog: GET /service/catalog | Service Pricing | Agent Directory | Credit Pricing

Connect an AI Agent (MCP)

Give Claude, ChatGPT, Cursor or your own agent every service in the catalog as tools. One URL: https://api.lanagent.net/mcp

Claude.ai, ChatGPT & other connector apps

Add a custom connector with the URL https://api.lanagent.net/mcp and leave the OAuth fields empty. A browser window opens: sign in with your portal email and password, a browser wallet (one signature, no gas), or an existing gsk_ key. Approving creates a new API key named MCP: <app> (<date>) for that app. Revoke that key to disconnect it.

Claude Code, Cursor, Hermes & scripts

Send your key as Authorization: Bearer gsk_โ€ฆ or X-API-Key: gsk_โ€ฆ. For Claude Code:

claude mcp add --transport http lanagent https://api.lanagent.net/mcp --header "Authorization: Bearer gsk_YOUR_KEY"

Same prices as the API. Each tool calls the same endpoint you would, so credits, subscription quotas and limits are unchanged. Free tools: catalog, credits_price, credits_balance, job_status, spending_limit. Every paid result says what it charged and your balance. Use spending_limit to set a daily credit limit on the key; web content in results is marked as untrusted. Full MCP guide โ†’

API Reference

Authentication, billing, error codes, rate limits, and per-service details. Everything an integrator needs to ship.

Authentication

Send your API key on every paid request:

X-API-Key: gsk_โ€ฆ

Or use a portal JWT: Authorization: Bearer <jwt>. Missing/invalid auth returns HTTP 401 with { "success": false, "error": "Authentication required..." }.

Billing & refunds

Credits debit before the agent runs. What happens next, per outcome:

Outcome HTTP Refunded?
Successful response (success: true)200No โ€” call ran
Agent returned success: false500Yes
Agent unreachable / threw502Yes
No agents online for the service503N/A (not debited)
Caller out of credits402N/A (not debited)
Auth missing/invalid401N/A (not debited)

A success:true response with a "negative" application-level result โ€” challenge passed:false, a honeypot flag on token audit, an empty wallet profile, no-feed-found on a price lookup โ€” is billable. The service ran and produced a real answer. Auto-refunds fire on infrastructure or service-availability failures, not on factual results the caller didn't want.

Exception: a few plugins explicitly auto-refund successful responses produced via a fallback path (e.g. Chainlink โ†’ CoinGecko fallback returns creditsCharged:0, creditsRefunded:1). The default rule is: success:true โ‡’ billed.

Detecting "out of credits"

When the calling key runs out, the gateway returns HTTP 402 (Payment Required) โ€” not 503:

{
  "success": false,
  "error": "Insufficient credits",
  "required": 2,
  "balance": 0
}

Match on the error string โ€” it's the stable identifier. balance is the current balance; required is what the call would have cost. (HTTP 503 means the gateway can't serve the call at all โ€” no agents online or gateway out of credits on its agents.)

Rate limits

No per-API-key rate limit on paid endpoints โ€” throughput is bounded only by your credit balance. The only IP-based rate limits on the gateway apply to portal/admin auth pages (/portal/signup, /portal/login, /portal/forgot-password, /admin/login): 10 attempts per 15-minute window, returning HTTP 429 with { "success": false, "error": "Too many attempts. Try again in 15 minutes." }. IPv6 clients are bucketed by /64 prefix.

Retries & timeouts

Paid endpoints are not idempotent โ€” a retry after a 200 will re-bill. Safe to retry on 502, 503, and network errors; those were either refunded or never debited. On 402, top up credits before retrying. Default request timeout 60s; image generation 120s, YouTube download 180s, media transcode 300s. Social download/audio run up to 600s โ€” past ~45s the gateway streams a keep-alive heartbeat (leading JSON whitespace) so a long yt-dlp download runs to completion instead of timing out; give your HTTP client a read timeout of at least 600s. For very long downloads prefer the async variants (up to 900s) and poll for the result โ€” see Social & media downloads below.

Social & media downloads โ€” reference

Download from TikTok, Rumble, BitChute, x.com, SoundCloud, Streamable, Dailymotion, Bilibili, Twitch and the rest of yt-dlp's ~1800 extractors. Two ways to call it: a synchronous request that returns the finished download, or an async job you submit and poll (best for very long downloads). Failed downloads auto-refund.

Endpoint Credits Behavior
POST /social/download {url}10Sync MP4. Runs up to 600s; heartbeat keeps the connection alive past ~45s. Returns the finished download.
POST /social/audio {url}8Sync MP3 (audio extracted + transcoded). Same timeout/heartbeat as above.
POST /social/download/async {url}10Submit โ†’ 202 {jobId, statusUrl, ttlSeconds} immediately. Runs in the background up to 900s. Poll statusUrl.
POST /social/audio/async {url}8Async MP3 variant.
GET /social/jobs/:jobIdfreePoll job status. Jobs are retained ~10 min after finishing (ttlSeconds).

Poll responses โ€” a status read that finds your job always returns HTTP 200; check the status field (not the HTTP code) to decide what to do. Only poll-level problems are non-2xx: 404 = unknown/expired jobId, 403 = not your job.

200 {status:"pending"}Still downloading โ€” keep polling (a 2โ€“3s interval is plenty). ageSeconds shows how long it's been running.
200 {status:"done", โ€ฆ}Finished. Body carries the same fields as the sync response (downloadUrl, filename, size, โ€ฆ).
200 {status:"failed", โ€ฆ}Download failed (credits already refunded). upstreamStatus carries the real failure code and error the reason. Stop polling โ€” this is terminal, not a transient gateway error.

Sync download (MP4):

curl --max-time 600 -X POST https://api.lanagent.net/social/download   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"url":"https://www.tiktok.com/@user/video/1234567890"}'
# { "success": true, "extractor": "tiktok",
#   "downloadUrl": "/download/2930/eyJhbGciOiโ€ฆ",   # fetch this to get the file (valid 60 min, 3 downloads)
#   "filename": "video.mp4", "size": 4821904, "caption": "โ€ฆ",
#   "creditsCharged": 10, "creditsRemaining": 390 }
# For MP3 use POST /social/audio (8 cr).

Async โ€” submit, then poll (best for long videos):

curl -X POST https://api.lanagent.net/social/download/async   -H 'X-API-Key: gsk_YOUR_KEY'   -d '{"url":"https://rumble.com/v123-long-video.html"}'
# 202 { "success": true, "jobId": "c14c1642-โ€ฆ", "statusUrl": "/social/jobs/c14c1642-โ€ฆ", "ttlSeconds": 600 }

curl https://api.lanagent.net/social/jobs/c14c1642-โ€ฆ -H 'X-API-Key: gsk_YOUR_KEY'
# 200 { "status": "pending", "ageSeconds": 42 }        โ†’ keep polling
# 200 { "status": "done", "downloadUrl": "/download/2930/โ€ฆ", "filename": "โ€ฆ", "size": โ€ฆ }
# 200 { "status": "failed", "upstreamStatus": 502, "error": "โ€ฆ" }   โ†’ terminal, credits refunded

Challenge Questions โ€” reference

Bot-filtering challenge questions. See the Quick Start above for request examples; the table below covers the behavior every integrator hits.

Credit cost2 credits per call (all actions: generate, generateWithAnswers, verify, types, trackPerformance)
Token format / TTLchq_ + 48 hex chars; 600 seconds (10 minutes) from generate. TTL is also returned as data.expiresIn.
Max verify attempts per token3 โ€” token is deleted on success or after the 3rd wrong submission; the 4th call returns { success:false, error:"Max verification attempts exceeded" }.
Pass threshold70% correct (ceil(total ร— 0.7))
Question count1โ€“20 per call (default 3); clamped server-side
Receiptcvr_ + 48 hex chars on passed:true. Persist this as proof-of-pass.
Answer matchingCase-insensitive, trimmed; each question carries an acceptableAnswers list (e.g. "12" / "all of them" both pass for "how many months have 28 days").
Wrong-answer billingBillable. A verify returning passed:false is success:true at the protocol level โ€” the service ran and produced a real answer. Only success:false outcomes auto-refund: missing token/answers[], invalid/expired token, or the 4th submission against the same token.

Web Archive โ€” reference

Cache-backed scraping. Skip the agent dispatch when a recent snapshot exists; fall through to a fresh scrape only when needed. Every fresh /scrape and /archive/scrape ingests its result into the corpus automatically.

Endpoint Credits Behavior
GET /archive/lookup?url=&max_age=&min_quality=&screenshot_format=1Latest snapshot with metadata + presigned artifact URLs. 404 + refund on miss, 410 + refund on redacted.
GET /archive/timeline?url=&limit=&offset=&max_age=&min_quality=1Every snapshot of a URL ordered newest-first. 404 + refund on url_unknown.
GET /archive/search?q=&domain=&since=&until=&limit=&offset=&quality_tier=2Meili full-text search across the entire corpus.
POST /archive/scrape {url, tier?, prefer?}2 flatCache-first. Cache hit serves immediately at the same price. Miss (or prefer:"fresh") falls through to a fresh agent dispatch and auto-ingests the result. prefer:"cache" only โ€” 404 + refund on miss.
Freshnessmax_age as suffixed duration: 6h / 24h / 7d / 30d. min_quality: metadata / text / full. screenshot_format on lookup: png (default) / jpeg / avif.

Have a question this doesn't answer? Open a GitHub issue or email support@lanagent.net.