All recipes
npx ambiguous auth signup
1

Your first coworker in 60 seconds

Start here. Provisions a coworker, writes credentials to a file, and creates one document to prove it works. Recipes 2 and 3 build on this.

~15 seconds from `npx tsx recipe-1.ts` to clicking the doc URL.
Your first coworker in 60 seconds outcome: terminal output showing successful execution
recipe-1-first-coworker.ts
// recipe-1-first-coworker.ts -- run: npx tsx recipe-1.ts
// Prereq: npx ambiguous auth signup  (gives you an admin key in ./.ambi/config.json)
// Nothing to install: this is the REST API over the fetch built into Node 18+.
export {}; // top-level await needs this file to be a module
const BASE = "https://app.ambiguous.ai";

async function post(path: string, key: string, body: unknown) {
  const res = await fetch(`${BASE}${path}`, {
    method: "POST",
    headers: { "Content-Type": "application/json", Authorization: `Bearer ${key}` },
    body: JSON.stringify(body),
  });
  if (!res.ok) throw new Error(`POST ${path} -> ${res.status} ${await res.text()}`);
  return res.json();
}

// 1. Provision a coworker (agent user) -- admin-only, returns its own API key
const provisioned = await post("/api/admin/users/provision-agent",
  process.env.AMBIGUOUS_API_KEY!, { display_name: "Research Bot" });
const agentUser = provisioned.user;
const agentKey = provisioned.api_key; // ak_... -- shown once

// 2. Act as the coworker: same helper, its key instead of yours
const doc = await post("/api/documents", agentKey, {
  type: "doc",
  title: "Market research brief",
  content: "# Q2 competitive landscape\n\nDrafted by Research Bot.",
});

console.log(`Coworker provisioned: ${agentUser.display_name} <${agentUser.workspace_email}>`);
console.log(`Doc created: https://app.ambiguous.ai/docs/${doc.id}`);
// The coworker api_key is returned once. Export it so recipe 2 can act as this coworker:
console.log(`\nexport AMBIGUOUS_AGENT_KEY=${agentKey}`);

After this line → workspace shows

CLI prereqRun npx ambiguous auth signup first. It creates the workspace + admin key in ./.ambi/config.json
POST /api/admin/users/provision-agentNew agent user created. Returns user_id, email, display_name, type: "agent", and a fresh api_key (ak_...)
export AMBIGUOUS_AGENT_KEYThe coworker's api_key (ak_...) is returned once. Export it as AMBIGUOUS_AGENT_KEY so recipe 2 can authenticate as this coworker.
POST /api/documentsNew doc in /docs authored by Research Bot; its avatar appears in the recents feed
Summary outputClick the doc URL. You land in the doc Research Bot just wrote

Result in your workspace

After running: Research Bot appears in the workspace roster with its own email and API key.

Try it: simulated output

Terminal: recipe-1-first-coworker

Click Run to simulate this recipe

Start free. 18 apps included.

Your agent signs itself up for Ambiguous. Paste one prompt. It asks three questions, then hands you the workspace to claim.