Hosted AI agent API with a private sandbox per agent
Run Lovely Agent in its own cloud sandbox. Create agents per project or per user, send them tasks over the API, share what they build, pay per second.
A cloud agent is Lovely Agent, an AI agent app, running in a Linux sandbox of its own. It chats with Claude, GPT or Gemini, runs commands, writes code, edits files, and calls the data tools and the browser agent. Create one per project or one per user of your product, use it in the browser or send it tasks over the API, and pay for its sandbox per second while it runs.
Hand it to your AI agent
Copy this prompt into Claude Code, Cursor, Codex or any coding agent. It tells the agent where the docs are and how to use your API key.
Use Lovely Router cloud agents in this project: hosted agents, each with its own private sandbox and files, driven over an API. - Docs (read first): https://lovelyrouter.com/docs/agents.md and https://lovelyrouter.com/docs/api/agents.md - Create one with POST https://lovelyrouter.com/v1/agents, give it work with POST https://lovelyrouter.com/v1/agents/<id>/runs and read its files with GET https://lovelyrouter.com/v1/agents/<id>/files/<path>. Billed per hour while it runs. - 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 what you want to build or get>
How it works
Create an agent
Give it a name and, if it serves one of your users, your own id for them. A budget caps what it can spend.
cURLcurl https://lovelyrouter.com/v1/agents \ -H "Authorization: Bearer $LOVELY_API_KEY" \ -H "content-type: application/json" \ -d '{"name": "Support bot", "user": "cust-42", "budget_micros": 5000000}'Send it a task
Post a task to the agent's runs. A stopped agent wakes up by itself, does the work in its sandbox with its tools and settings, and stops again a few seconds after its last run ends.
cURLcurl https://lovelyrouter.com/v1/agents/agt_3f9a1c7e0b2d4e6f8a9b0c1d/runs \ -H "Authorization: Bearer $LOVELY_API_KEY" \ -H "content-type: application/json" \ -d '{"input": "Summarize README.md in three bullets.", "wait": 120}'Get what it made
The run returns the agent's answer, its token usage and the files it delivered, each with a download URL. A share link opens a file, or a whole folder as a website, for anyone who has it.
What's inside each agent
: chat, sessions, plan mode, subagents, skills, scheduled tasks, plugins and a terminal, at the agent's own address.
New sessions start on Claude Haiku 5.5, our least expensive; pick another default per agent, or switch inside a session. See all models.
The data tools and the browser agent appear as MCP tools, so the agent can search the web, get structured data from YouTube, Reddit, Google Maps or Amazon in one call, make images or drive a browser.
with Node.js 22, Python 3, git, build tools and ripgrep, and internet access, isolated from every other agent and customer. Its workspace persists between runs.
The runs API
POST /v1/agents/{id}/runs sends one task of up to 100,000 characters. Set wait to hold the request up to 300 seconds for the result, or stream to get the run's events as server-sent events: status with token usage, tool calls and results, text and the final answer. Pass a session_id from an earlier run to continue that conversation.
A finished run carries output, usage, steps, tool_calls and files. You can also list runs, stream a run's events later or cancel it. Each agent works on up to 4 runs at once.
Agents for your own users
Build agents into your product: one agent per user of yours, each with its own workspace, all paid from your balance.
Create each agent with {"user": "cust-42"} and any metadata, and list a user's agents with GET /v1/agents?user=cust-42.
An agtok_ token reaches one agent only and expires by itself, after 1 minute to 30 days. Scope api sends runs and reads files; scope ui comes with a link that opens the agent's page, signed in. Revoke an agent's tokens at any time.
caps what each user can spend; the agent stops once it has spent that much.
List or download anything in the agent's home folder, even while it is stopped, and make links that need no sign-in and last from a minute to a year.
Give agents a branding and your users see your name, logo and colors instead of ours. See white-label agents.
Settings per agent
In the console or with PATCH /v1/agents/{id}, each agent gets its own default model; data tools and browser agent on or off; up to 8 remote MCP servers of yours, with header values stored encrypted; instructions of up to 4,000 characters added to every session; a size; stop when idle (5 minutes to 24 hours, 30 minutes by default); a longest session (1 to 24 hours, 8 by default); and wake up when called, on by default, so a run or a page visit starts a stopped agent.
What people build
One agent per account in your product, an api token for your backend, a budget each, and the data tools for web search and platform data.
A medium or large agent with your conventions in its instructions that clones the repo, runs the tests and reports what failed.
The agent builds an HTML report or a static site into a folder, and a share link publishes the folder.
Your cron posts a run; the agent wakes up, does the task and goes back to sleep, so you pay only for the time it ran.
What you pay
You pay for each agent's sandbox while it runs, per second, plus what it uses at the usual prices: model tokens, data tool results and browser steps.
| Size | CPU | Memory | Per hour running |
|---|---|---|---|
| Small | 2 shared vCPUs | 2 GiB | $0.05 |
| Medium | 4 shared vCPUs | 4 GiB | $0.10 |
| Large | 8 shared vCPUs | 8 GiB | $0.20 |
Bursts, such as a build, cost nothing extra. Between sessions an agent is kept ready, so it starts again in seconds: $0.36 per month plus $0.30 per GB-month of disk and $0.16 per GB-month of daily backups (a new agent: about $0.66 per month). After 7 days without use it is archived at $0.20 per GiB-month of its files. Starting an agent needs a balance that covers 15 minutes of its size; there is no subscription. See pricing.
Frequently asked questions
What is a hosted AI agent?+
It is Lovely Agent running in a private cloud sandbox that we operate: agent as a service. It keeps its files, sessions and settings between runs, and you reach it in the browser or through the /v1/agents API without running any infrastructure.
Can I run background AI agents in the cloud?+
Yes. Post a run from your backend or a cron job; the agent wakes up, does the task in its sandbox and stops a few seconds after its last run ends. Stream the run's events or read the result later.
How many agents can I run?+
Up to 1,000 agents per account, 20 of them running at once. Each agent works on up to 4 API runs at once.
Can my users use an agent without seeing my API key?+
Yes. Give each user an agent token for their own agent. It reaches that one agent only, expires by itself, and can be revoked at any time.
Do I pay while an agent is stopped?+
Only for its workspace storage. The sandbox is billed from the moment it starts until it stops, and an agent stops by itself after a period without use.
Which models can an agent use?+
Every chat model on the model list, including Claude, GPT and Gemini, already configured. The default is Claude Haiku 5.5; you can set another default per agent or switch models inside a session.
Can an agent use a GPU?+
No. Agents run on CPU sandboxes in three sizes, and a session lasts at most 24 hours before it needs a new start; the workspace is kept.
Read the cloud agents docs and the agent API reference, or see the MCP server to give your own agents the same tools.