API & SDK

Run your assistants
from code.

Everything you can do in the dashboard, you can do from code with a clean REST API and a typed SDK. Set up assistants, give them work, follow their activity as it happens, and connect events — all from the tools you already use.

Ready in about a minute

Install the SDK. Add a key.

One package, one bearer token. The SDK is a thin, fully-typed wrapper over the same endpoints you can hit with curl.

terminal
bash
# install the typed client
$ npm i @servemy/sdk

# or pin it in your agent service
$ pnpm add @servemy/sdk
auth.sh
curl
# every request carries a bearer token
curl https://api.servemy.ai/v1/agents \
  -H "Authorization: Bearer $SERVEMY_KEY" \
  -H "Idempotency-Key: deploy-2026-05-30"
The SDK

Deploy, then
watch it work.

Set up an assistant, give it work, and read its actions back as an async stream. No polling, no plumbing — it's live the moment the promise resolves.

  • Fully typed — autocomplete every field
  • Async iterators over the live action log
  • Same surface in CI, edge or a backend
deploy-goose.ts
typescript
import { ServeMy } from "@servemy/sdk";

const sm = new ServeMy({ apiKey: process.env.SERVEMY_KEY });

// provision an OpenClaude unit in us-east
const agent = await sm.agents.deploy({
  blueprint: "openclaude",
  name: "Goose",
  region: "us-east",
  inference: "managed-frontier",
});

// hand it the mission
await sm.agents.task(agent.id, {
  goal: "Triage new issues and open fix PRs",
  schedule: "every 30m",
});

// stream every action as it happens
for await (const ev of sm.agents.logs(agent.id)) {
  console.log(ev.at, ev.action);
}
REST reference

Five endpoints. Whole lifecycle.

Deploy, inspect, task, observe, tear down. Every call is JSON over HTTPS against api.servemy.ai.

MethodEndpoint
POST/v1/agents
GET/v1/agents/:id
POST/v1/agents/:id/tasks
GET/v1/agents/:id/logs
DELETE/v1/agents/:id
Built for automation

Safe to put in a pipeline.

Idempotent deploys

Pass an Idempotency-Key and retry safely. The same key never spins up a second runtime — ship from CI without fear of duplicates.

Webhooks & events

Subscribe to agent.deployed, task.completed and incident.raised. Signed payloads land on your endpoint the moment something happens.

Scoped API keys

Mint keys per environment with read, deploy or admin scopes. Rotate or revoke any key instantly — nothing else has to change.

Authentication

Bearer tokens,
scoped to the job.

Authenticate with a single bearer token in the Authorization header. Mint a key per environment, give it only the scope it needs, and rotate it anytime — old keys revoke the instant you roll a new one.

read
Inspect agents, metrics and logs
deploy
Create, task and tear down agents
admin
Manage keys, webhooks and billing
keys.sh
curl
# mint a deploy-scoped key for CI
curl -X POST https://api.servemy.ai/v1/keys \
  -H "Authorization: Bearer $ADMIN_KEY" \
  -d '{ "scope": "deploy", "label": "ci" }'

# → { id: "key_4f2a", token: "sk_live_…" }

# rotate it whenever — old token dies at once
curl -X POST https://api.servemy.ai/v1/keys/key_4f2a/rotate \
  -H "Authorization: Bearer $ADMIN_KEY"
ship it

Put assistants behind your code

Set up your first assistant in the dashboard, then move to the API once you're ready to automate.