AI エージェントに任せる
このプロンプトを Claude Code、Cursor、Codex などのコーディングエージェントに貼り付けてください。ドキュメントの場所と API キーの使い方をエージェントに伝えます。
Use the Lovely Router browser agent API: a real browser that clicks, types, fills forms and logs in for a task, and returns an answer plus JSON in a schema I choose.
- Docs (read first): https://lovelyrouter.com/docs/browser-agent.md and https://lovelyrouter.com/docs/api/browser.md
- Start a run: POST https://lovelyrouter.com/v1/browser/runs with `{"goal": "...", "start_url": "https://...", "output_schema": {...}}`. Put every value the task needs in the goal. It returns 202 at once; poll the `poll` path (or stream `events`) until the run ends, then read `answer` and `data`.
- Billed per step (fast mode by default). Set `max_steps` to cap a run. For unattended runs send `"human": false`; by default the agent pauses before purchases, sending or deleting (`approve`).
- If you support MCP, you can instead connect the server https://lovelyrouter.com/mcp (Streamable HTTP, same key; https://lovelyrouter.com/docs/tools/mcp.md) and use suggest_tools, get_tool and run_tool.
- Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt.
My task: <describe the site and what the agent should do or extract>入力
goalstring必須What to do, in plain words, with every value the task needs
start_urlstring必須Page to start on
modestringfast (default, $0.006/step) or accurate ($0.012/step: screenshots when unsure + read-only page code; higher success on hard sites)
fast · accurate
output_schemaobjectOptional JSON Schema (or {"field": "type"} shorthand) for structured output in `data`; omit for data: null
modelstringOptional model id from /v1/models (e.g. claude-sonnet-5.5) for the agent's reasoning; its tokens are billed at the normal price × 1.2 on top of the step price
secretsstring[]Names of vault secrets the agent may fill (never shown to the model)
profilestringSaved browser profile (cookies) to start from
save_profilestringSave cookies under this profile name when done
human_timeout_minutesnumberHow long to wait for a human reply or approval, 1–1440 minutes (default 30); time beyond 1 minute per step costs $0.005/min
approvestringPause for approval before risky submits (default risky)
none · risky · submit
試す
コードから呼び出す
実行・ポーリング・課金の仕組み →curl https://lovelyrouter.com/v1/tools/browser-agent/run \
-H "Authorization: Bearer $LOVELY_API_KEY" \
-H "content-type: application/json" \
-d '{"input":{"goal":"Find the price of the book '\''A Light in the Attic'\''","start_url":"https://books.toscrape.com/"},"max_results":50}'# MCP (agents): suggest_tools → get_tool → run_tool
run_tool({
"tool": "browser-agent",
"input": {"goal":"Find the price of the book 'A Light in the Attic'","start_url":"https://books.toscrape.com/"},
"max_results": 50
})料金の目安
| 結果 | 実行回数(1 回あたり最大 100 件) | 原価 |
|---|---|---|
| 100 | 1 | $0.60 |
| 1,000 | 10 | $6.00 |
| 10,000 | 100 | $60.00 |
プリペイド、サブスクリプションなし。結果が要求より少なければ料金も下がります。 料金
用途
よくある質問
Browser agent API の料金はいくらですか?
$0.006 / step。1 回最大 100 件で 1,000 件取得すると $6.00 です。サブスクリプションはなく、プリペイド残高から支払います。
これはブラウザエージェント APIですか?
はい。ブラウザエージェント API、AI ブラウザ自動化、AI Web操作 自動化をお探しなら、これです:Give it a goal and a start page; an AI agent drives a real browser to do it: navigate, fill forms, log in with saved secrets, ask you for codes, hand over for CAPTCHAs, wait for your approval before purchases, and return structured JSON in your schema. For tasks that need interaction; to just read a page, use Read a web page (web-fetch). $0.006 per step in fast mode, $0.012 in accurate mode (looks at screenshots when unsure, can run read-only code to read data). Each step includes 1 minute; time beyond that (e.g. waiting for your approval) costs $0.005/min. Full API: /v1/browser.
1 回の実行で何件の結果が返りますか?
既定は 50 件、1 回あたり最大 100 件。max_results で上限を設定でき、届いた結果の分だけ課金されます。
AI エージェントはこのツールを使えますか?
はい。Claude Code・Cursor などの MCP クライアントを Lovely Router の MCP サーバーにつなぐと、エージェントが suggest_tools でこのツールを見つけ、run_tool と ID browser-agent で実行します。
実行が失敗するとどうなりますか?
失敗または停止した実行は、届いた結果の分だけを支払い、呼び出し料金はかかりません。実行開始時に最大費用を確保し、精算時に残りを解放します。