StartQuickstart
Start

Quickstart

From nothing to a service at its own address.

You need a workspace on Zeroko Cloud, free to start, or a panel of your own (see Self-hosting).

Zeroko CloudSelf-hosted
The API (ZEROKO_URL)https://<workspace>.zeroko.spacehttps://panel.example.com
The skillhttps://zeroko.space/workspaces/<workspace>/skill.mdhttps://panel.example.com/skill.md
Serviceshttps://<name>--<workspace>.zeroko.spacehttps://<name>.example.com

The examples use the self-hosted addresses; on Zeroko Cloud, use your workspace's.

1. Make a token

In the panel, open Tokens and make one. It starts with zk_ and is shown once: keep it for your agent.

sh
export ZEROKO_URL=https://panel.example.com
export ZEROKO_TOKEN=zk_...

2. Give your agent the skill

The panel serves the skill, filled in with where your agent's API is and its limits. Point your agent at it, with the token (on Zeroko Cloud, the panel gives you this prompt when you make the token):

text
Read https://panel.example.com/skill.md and deploy a guestbook to Zeroko.
The token is in ZEROKO_TOKEN.

The agent writes the service, deploys it and checks its logs. See Teach your agent for Claude and other agents.

3. Or deploy by hand

A service is ES modules whose main module exports a fetch handler:

sh
curl -X POST "$ZEROKO_URL/api/services/hello/deployments" \
  -H "Authorization: Bearer $ZEROKO_TOKEN" \
  -d '{
    "files": {
      "index.js": "export default { fetch: () => new Response(\"Hello from Zeroko\") }"
    }
  }'

The first deployment creates the service. The answer holds its address:

json
{ "deployment": { "id": "...", "status": "ready" }, "url": "https://hello.example.com" }

4. Add a database

Declare a binding and use it from env:

js
// index.js, deployed with "bindings": {"DB": "db"}
export default {
  async fetch(request, env) {
    await env.DB.run(
      "CREATE TABLE IF NOT EXISTS visits (at TEXT); INSERT INTO visits VALUES (datetime())"
    )
    const [{ n }] = await env.DB.query("SELECT count(*) AS n FROM visits")
    return new Response(`Visit number ${n}`)
  },
}

Then read Write a service and the bindings.