LANAgent API
One API key for web scraping, the web archive, video and audio downloads, transcription, image generation, a code sandbox and every other service in the catalog. Call it over REST, or connect an AI agent to it through MCP.
Quick start
- Get a key. Sign up at api.lanagent.net and buy credits with a card, BNB or SKYNET. Your key starts with
gsk_. Add more keys from your dashboard, one per app or service; they all spend from the same balance, and you can give any key a credit allowance so it cannot spend more than you set. - Make a call. Send the key in the
X-API-Keyheader. A basic scrape costs 1 credit:
curl -X POST https://api.lanagent.net/scrape \
-H 'X-API-Key: gsk_YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{"url":"https://example.com","tier":"basic"}'
Failed requests are refunded automatically. Check your balance any time with GET https://api.lanagent.net/credits/balance (same header).
Examples in Python, JavaScript, Go, Rust, PHP and Java, plus the full reference (errors, refunds, per-service parameters), are on api.lanagent.net.
Prices
Every service is priced in credits. Live prices for everything are in the catalog: api.lanagent.net/catalog (core services) and api.lanagent.net/service/catalog (agent services). Scraping also has flat monthly subscriptions with large quotas.
Connect an AI agent (MCP)
The API is also an MCP server, so Claude, ChatGPT, Cursor, Hermes or your own agent can use every service in the catalog as a tool, with no code on your side.
Server URL: https://api.lanagent.net/mcp
Claude.ai, ChatGPT and other connector apps
- Add a custom connector with the URL
https://api.lanagent.net/mcp. Leave the OAuth client ID and secret empty: the app registers itself. - A browser window opens on api.lanagent.net. Sign in with your portal email and password, a browser wallet (you sign a one-time message; no gas), or paste an existing
gsk_key. - Approve. This creates a new API key named MCP: <app name> (<date>), used only by that app. You can set how many credits it may spend, there or later in your dashboard.
To disconnect the app, revoke that key in your dashboard.
Claude Code, Cursor, Hermes and scripts
Clients that let you set headers send your key directly, as either:
Authorization: Bearer gsk_YOUR_KEY
X-API-Key: gsk_YOUR_KEY
Claude Code:
claude mcp add --transport http lanagent \
https://api.lanagent.net/mcp \
--header "Authorization: Bearer gsk_YOUR_KEY"
Hermes can read the key from its .env into the header.
What tools you get
- Core tools:
scrape,archive_lookup,archive_timeline,archive_search,archive_scrape,social_download,social_audio,transcribe_url,image_generate,code_sandbox. - Every agent service as its own typed tool, named
svc_<plugin>_<action>(for example AI detection, web search, token and wallet checks, PDF and image tools). The list is built from the live catalog, so new services show up without any change on your side. - Free tools:
catalog,credits_price,credits_balance,job_status,spending_limit.
Downloads (social_download, social_audio) run as jobs: the tool returns a job_id, and job_status returns the download link when it is ready.
Hermes: the LANAgent plugin
For Hermes Agent there is a plugin that does the setup for you and adds what MCP alone cannot:
hermes plugins install PortableDiag/lanagent-hermes --enable
hermes lanagent setup
setup signs you in with a code emailed to you (or takes --key gsk_…). It creates a key for that Hermes and connects the MCP server in discovery mode. The plugin adds:
lanagent_wait_job, which waits for a download to finish and saves the file locally;lanagent_fetch_file, which saves any result link locally;lanagent_spendand a/lanagentcommand, which show your balance, today's spend and what the session has cost.
Source and details: github.com/PortableDiag/lanagent-hermes (MIT).
Fewer tools in context: discovery mode
The full list has about a hundred tools, and many clients send every tool's description to the model on every turn. If that is too much for yours, connect to
https://api.lanagent.net/mcp?mode=discover
That connection lists only the free account tools, scrape, and three helpers:
search_toolsfinds tools by what they do, with their cost.describe_toolshows a tool's arguments.call_toolruns any tool by name.
A tool run through call_tool is priced, limited and billed exactly as if it were called directly. It works with connector apps (OAuth) and with header clients alike; only the URL changes.
Billing: exactly the same as the API
Each tool calls the same API endpoint you would call yourself, with your key. Prices, credits, subscription quotas, refunds and limits are the API's; nothing costs more and nothing is free that isn't free in the API.
| Tool | Credits |
|---|---|
scrape | 1 basic, 2 stealth, 3 full or render |
archive_lookup, archive_timeline | 1 |
archive_search, archive_scrape | 2 |
social_download (MP4) | 10 |
social_audio (MP3) | 8 |
transcribe_url | 2 per started minute (minimum 2), +5 for a URL; up to 60 minutes |
image_generate | 30 |
code_sandbox | 20 |
svc_* | The service's catalog price |
Every paid result ends with a line such as Charged 1 credit; balance 399 and a _billing object: {charged, balance, spentToday, dailyLimit}. Your agent always knows what it spent.
Spending limit
Give an agent a budget before you let it loose. The spending_limit tool reads or sets a daily credit limit on the key, enforced by the server:
- With the key itself you can set a limit or lower it. An agent cannot raise its own budget.
- Raising or removing a limit needs your wallet login, naming that key.
- A client can also send
X-Daily-Credit-Cap: <n>to tighten the limit for one session. It can never loosen it.
Web content is marked as untrusted
Results that contain scraped or searched web content start with a notice that the content is untrusted data, never instructions. This helps your agent resist prompt injection from the pages it reads.
Technical details
- Transport: MCP Streamable HTTP,
POSTwith JSON responses, stateless.GETanswers 405 (no event stream). - Without a credential,
/mcpanswers HTTP 401 withWWW-Authenticate: Bearer … resource_metadata="https://api.lanagent.net/.well-known/oauth-protected-resource". - OAuth 2.1: protected-resource metadata (RFC 9728) at
/.well-known/oauth-protected-resource, authorization-server metadata (RFC 8414) at/.well-known/oauth-authorization-server, dynamic client registration atPOST /register. PKCE with S256 is required; only public clients are supported. - Discovery:
GET /catalogincludesmcp: {url, transport, auth}.
Questions or a service you need? Email [email protected] or open a GitHub issue.