Use case · AI agents
Hosting for AI agents and AI-powered apps
Run the agent, chatbot or AI-powered API you built on zeroconfig. Your code calls any model provider's API with keys stored encrypted, keeps state in key-value or SQL storage, and runs on a schedule or when a webhook arrives.
What kind of AI agents can I host?
- Chatbots and assistants behind your website or app, like our demo support assistant.
- AI-powered APIs: summarise, classify, extract or generate on request.
- Scheduled agents that wake up on a cron schedule: daily reports, inbox or feed triage, data clean-up.
- Webhook agents that react to events from Stripe, GitHub, Slack, forms or any service that can send an HTTPS request.
- Long-running or stateful agents (WebSockets, queues, Python frameworks) on an app server.
How do serverless AI agents work on zeroconfig?
A serverless app is a JavaScript or TypeScript module for the Workers runtime that exports a fetch(request, env) handler. There is no server for you to keep running or patch, and every request reaches it over HTTPS through Cloudflare's network.
- Model APIs: call any provider over HTTPS (OpenAI, Anthropic, Google, Mistral, your own endpoint).
- Encrypted secrets: store API keys as environment variables. They are encrypted, write-only and never shown to you or to an AI assistant again. Your code reads them from
env. - Key-value storage: every app has its own store at
env.KVfor conversation state, caches and settings. - SQL database: bind a SQLite-compatible database as
env.DBfor structured data (included on Pro and Scale, add-on on One). - Scheduled jobs: set a cron schedule (UTC, at most once a minute) and export a
scheduled()handler. Each run counts as one dynamic request and shows in the app's log. - Webhooks: any path of your app can receive HTTPS requests, on your free
*.zeroconfig.cloudaddress or your own domain.
What does an example agent look like?
A support agent with one serverless app: the website posts questions to /ask, the agent calls a model API, keeps the conversation in key-value storage, logs tickets to SQL, and a nightly job emails a summary through your mail provider's API.
// worker.js (deployed as a serverless app)
export default {
async fetch(request, env) {
const url = new URL(request.url);
if (url.pathname === '/ask' && request.method === 'POST') {
const { session, question } = await request.json();
const history = JSON.parse((await env.KV.get(session)) ?? '[]');
history.push({ role: 'user', content: question });
// Any model provider's HTTPS API; the key is an encrypted env variable.
const res = await fetch(env.MODEL_API_URL, {
method: 'POST',
headers: { authorization: `Bearer ${env.MODEL_API_KEY}`, 'content-type': 'application/json' },
body: JSON.stringify({ model: env.MODEL, messages: history }),
});
const answer = (await res.json()).choices[0].message.content;
history.push({ role: 'assistant', content: answer });
await env.KV.put(session, JSON.stringify(history));
await env.DB.prepare('INSERT INTO questions (session, question) VALUES (?, ?)').bind(session, question).run();
return Response.json({ answer });
}
return new Response('Not found', { status: 404 });
},
// Runs on the app's cron schedule, e.g. "0 6 * * *" (06:00 UTC).
async scheduled(controller, env, ctx) {
const { results } = await env.DB.prepare('SELECT COUNT(*) AS n FROM questions').all();
await fetch(env.MAIL_API_URL, { method: 'POST', headers: { authorization: `Bearer ${env.MAIL_API_KEY}` }, body: `Questions so far: ${results[0].n}` });
},
};
Your AI assistant can deploy this, set the schedule and bind the database for you. Set the API keys in the dashboard or through an assistant that supports it.
What are the limits for AI workloads?
Waiting for a model's answer does not count as server time. What counts is the time your own code computes. Each call to an outside service, such as a model API, counts toward the per-request limit.
| One | Pro | Scale | |
|---|---|---|---|
| Price per month | $5 | $19 | $49 |
| Dynamic requests / month | 100K | 2M | 10M |
| Server time / month | 10M ms | 30M ms | 100M ms |
| Server time per request | 10 ms | 50 ms | 200 ms |
| Outside calls per request | 10 | 50 | 200 |
| SQL databases | Add-on | 1 | 3 |
| Key-value storage, cron, encrypted env | Included | Included | Included |
| Request log history | 7 days | 14 days | 30 days |
Enterprise (from $199 per month) has custom limits. At a limit, the limited feature pauses instead of billing you more; you can add more or upgrade at any time. See pricing and what each limit means.
What if my agent needs Python, WebSockets or long-running work?
Add an app server: an always-on container built from your code: we detect Python, Node.js, Go and Rust projects and build them for you, or you bring your own Dockerfile for any other language. Use it for Python agent frameworks, WebSockets, queues, background workers or tasks that run for minutes. Managed Postgres 17 and Redis 7 connect through DATABASE_URL and REDIS_URL.
- Small (0.5 vCPU, 512 MB): $7 per month. Standard (1 vCPU, 2 GB): $25 per month.
- Managed Postgres 17 (10 GB): $7 per month. Managed Redis 7 (256 MB): $10 per month.
- They are set up automatically as soon as you add them, usually within a minute. Then you, or your assistant, deploy to them like any other app.
What is not supported?
- GPUs and running or fine-tuning models yourself. Call a model provider's API instead.
- Python, native modules, WebSockets and long-running processes in serverless apps (use an app server).
- Serverless apps reaching private network addresses.
- Uptime SLAs, except on Enterprise.
Frequently asked questions
Can I host an AI agent on zeroconfig?
Yes. Agents written in JavaScript or TypeScript run as serverless apps that call model APIs, store state in key-value or SQL storage, and run on a schedule or on webhooks. Agents in Python or that need long-running processes run on an app server.
Where do I keep my OpenAI or Anthropic API key?
In the app's environment variables. They are stored encrypted, are write-only and are never shown again to you or to any AI assistant. Your code reads them from env, for example env.OPENAI_API_KEY.
Does waiting for the model count against my limits?
No. Server time counts only the time your code computes, not time spent waiting for a model or another service. Each outside call counts toward the per-request call limit (10 on One, 50 on Pro, 200 on Scale).
Can my agent run on a schedule?
Yes. Set a cron schedule (in UTC, at most once a minute) and export a scheduled() handler. Each run counts as one dynamic request and appears in the app's log.
Can I run a Python agent framework?
Yes, on an app server: an always-on container from your Dockerfile, from $7 per month, set up by our team, usually within one business day.
Can my AI assistant deploy the agent for me?
Yes. Connect zeroconfig to Claude, ChatGPT, Cursor or another MCP client and ask it to deploy. It can also set the schedule, bind a database and read the logs.
Will I get a surprise bill if my agent loops?
No. Plans have fixed allowances. When one runs out, the limited feature pauses instead of charging more, and you get warnings in your dashboard before that.