Skip to content

Quickstart

Get your first UClaw agent running in 5 minutes. This guide walks you through installing the SDK, creating an API key, and streaming your first agent run.

Prerequisites

  • Node.js 20+ or Bun
  • A UClaw account at uclaw.dev

Step 1: Install the SDK

bash
npm install @uclaw/sdk
# or
bun add @uclaw/sdk

Step 2: Create an API Key

  1. Sign in at uclaw.dev
  2. Go to Developer → API Keys
  3. Click Create Key, then copy the key that starts with uc_live_

Store the key as an environment variable:

bash
export UCLAW_API_KEY="uc_live_..."

Or add it to a .env file in your project root:

bash
UCLAW_API_KEY=uc_live_...

WARNING

Never commit your API key to version control. Add .env to your .gitignore.

Step 3: Run Your First Agent

Create a file called run.mjs:

javascript
import { AppClient } from "@uclaw/sdk";

const app = new AppClient({
  apiKey: process.env.UCLAW_API_KEY,
});

const agent = await app.agents.create({
  title: "Quickstart agent",
  config: {
    model: "anthropic/claude-sonnet-4",
    instructions: "You are a helpful assistant.",
  },
});

console.log(`Agent created: ${agent.id}`);

const run = await agent.run("Hello! What can you do?");
await run.wait({ until: "running", timeoutMs: 60_000 });

for await (const event of run.stream()) {
  if (event.type === "text-delta") {
    process.stdout.write(event.delta);
  }
}

console.log("\\n\\nDone!");

Run it:

bash
node --env-file=.env run.mjs

You should see a streamed response printed to your terminal.

Step 4: Check Your Usage

Head to your UClaw dashboard to see:

  • The amount charged for this run
  • The agent you created
  • Real-time usage metrics

Next Steps

  • Quickstart Script — A complete, copy-pasteable testing harness for the terminal
  • Server-Side Examples — Managing agents, runs, and streaming
  • React Examples — Integrate UClaw into a React frontend with useApp and useAgent
  • Models — Browse all available models and their pricing
  • Pricing — Understand pay-as-you-go billing