DeepAPI

How to run AI agents 24/7 in the cloud

Agents on your laptop pause when the lid closes. Here is how to keep AI agents working overnight in the cloud, with web search, scraping, and research behind one API key.

You give your agent a long task. You close your laptop. You come back in the morning.

Nothing happened.

That is the default for most agents today. They run on your computer, so they stop when your computer sleeps. Cloudroom's own comparison shows the problem in one line: "Mac asleep. Agents on it are paused."

If you want agents that work while you sleep, they need two things your laptop can't give them overnight:

  1. A computer that stays on.
  2. Tools to act on the web, without you there to paste API keys and fix failed setups.

Here is how to get both.

Your options at a glance

OptionRuns with the lid closedSetupState between runsCost
Agent on your laptopNoNoneYesNo extra cost
Your own serverYesSSH, installs, updates, cleanupYesYour server bill
DeepAPI VM (/v1/vm/run)Yes, up to 10 minutes per runOne API callNo, discarded after each run$0.01 per run
Cloud agent in CloudroomYesSign in, pick your agentOwn sandbox and git branchFree plan includes 3,000 Cloud Credits a month

Cloudroom pricing is from cloudroom.dev/pricing, checked on 2026-10-28.

The DeepAPI VM is great for short experiments. Your agent sends a program, gets the result, and the machine disappears. We covered it in The $0.01 Computer.

But a VM run is one program, not a whole agent. When the job is "work through these 12 tasks tonight", the agent itself has to live in the cloud.

Step 1: Move the agent to the cloud

Cloudroom runs coding agents in the cloud. It is open source under the Apache-2.0 license.

A few things matter for overnight work:

  • One computer per agent. Every agent runs in its own isolated sandbox with full admin rights. Agents don't fight over one CPU, one screen, or one mouse.
  • Its own git branch. Each agent works on a separate branch, so parallel tasks don't overwrite each other.
  • Your existing plans. It runs harnesses like Claude Code, Codex, Cursor, OpenCode, and Pi on the subscriptions and API keys you already pay for.

Start the tasks, close the lid, and check the results in the morning.

Step 2: Give the agent tools

A cloud agent still needs to search, read websites, and research. Without tools, it guesses.

DeepAPI gives it all of that behind one key: web search, deep research with sources, scraping for websites and public platforms, email, and image generation.

Set the key as an environment variable in the agent's workspace:

export DEEPAPI_API_KEY="dapi_..."

To install the DeepAPI skill as well, tell the agent:

Read https://deepapi.co/setup.md and follow it.

The hosted setup prompt is built for remote machines where pasting a long prompt is hard. The agent asks you for the key, then installs everything.

Here is a real web search a cloud agent can run:

curl -sS -X POST "https://deepapi.co/v1/search/web" \
  -H "Authorization: Bearer $DEEPAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"query":"Node.js 24 LTS end of life date","maxResults":2,"maxCostUsd":"0.05"}'

The response, trimmed:

{
  "status": "succeeded",
  "debitMicrousd": 3000,
  "output": {
    "results": [
      {
        "title": "Node.js Releases",
        "url": "https://nodejs.org/en/about/previous-releases",
        "snippet": "... v24, Krypton, May 06, 2025, Oct 20, 2026, LTS"
      },
      {
        "title": "Node.js",
        "url": "https://endoflife.date/nodejs",
        "snippet": "24 ( LTS ) ... Ends in 6 months (30 Apr 2027) ..."
      }
    ]
  }
}

That call cost $0.003. Amounts are in micro-dollars, so 3000 means $0.003.

Step 3: Write tasks that finish without you

Nobody is watching at 3 AM. Write each task so the agent knows when it is done.

  • One clear goal. "Research these 5 companies and write a one-page brief for each" beats "look into our competitors".
  • A definition of done. Say what file, branch, or report you expect.
  • A budget. Every paid DeepAPI endpoint already has a default spend cap. Set maxCostUsd when you want a lower one. Calls that fail are free.
  • A report. Ask the agent to list what it finished, what failed, and why.

Add this to your project's AGENTS.md so every agent follows the same rules:

For web search, research, and scraping, use DeepAPI (POST /v1/search/web,
POST /v1/research/deep, POST /v1/scrape/*). Read DEEPAPI_API_KEY from the
environment and never print it. When the task is done, report what finished,
what failed, and why.

The DeepAPI skill has the full workflow, and the docs list every endpoint.

Close the lid

Your laptop doesn't need to stay awake for your agents to keep working.

Put the agents on their own computers with Cloudroom. Give them real web tools with one key.

Get a DeepAPI key and start with $1 in free credit.

FAQ

Can AI agents keep working when my laptop is closed?
Only if they run on another computer. When a laptop sleeps, the agents running on it pause. A cloud agent runs on its own machine, so closing the lid does not stop it.
Do I need to rent and manage my own server?
No. You can set up a server yourself, but then you handle SSH, installs, updates, and cleanup. A cloud agent workspace such as Cloudroom gives every agent its own isolated sandbox without that setup.
What is the difference between the DeepAPI VM and a cloud agent?
POST /v1/vm/run runs one program in a fresh Linux VM for up to 10 minutes and costs $0.01 per run. The VM is discarded afterward. A cloud agent is a whole agent session that keeps working on its own computer while your laptop is closed.
Which agents can run in the cloud with Cloudroom?
Cloudroom runs agent harnesses such as Claude Code, Codex, Cursor, OpenCode, and Pi on the plans and keys you already have. Each agent gets its own sandbox and its own git branch.
How does a cloud agent get web search, scraping, and research?
Give it a DeepAPI key as the DEEPAPI_API_KEY environment variable. One key covers web search, deep research, scraping, email, and image generation.
How do I stop an unattended agent from overspending?
Every paid DeepAPI endpoint has a default spend cap, and you can set a lower maxCostUsd per request. Calls that fail are not charged.

Originally published at https://deepapi.co/blog/how-to-run-ai-agents-24-7-in-the-cloud.