> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wazoo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript SDK

> Use @wazoo/api to manage Wazoo platform resources.

`@wazoo/api` is the TypeScript SDK for the Wazoo Platform API. It manages
platform resources; it does not replace `@worlds/client` for graph data
operations.

Use `@wazoo/api` for organizations, groups, world metadata, platform tokens,
world auth tokens, usage, limits, and billing state. Use `@worlds/client` for
import, export, search, SPARQL, and graph updates.

## Install

```bash theme={null}
npm install @wazoo/api
```

## Create a client

```typescript theme={null}
import { createClient } from "@wazoo/api";

const wazoo = createClient({
  org: "acme",
  token: process.env.WAZOO_PLATFORM_TOKEN!,
});
```

The token must be a platform token with the `wzp_` prefix.

You can pass either an organization slug or an organization ID:

```typescript theme={null}
const wazoo = createClient({
  orgId: "org_123",
  token: async () => getPlatformToken(),
});
```

## Manage worlds

```typescript theme={null}
const worlds = await wazoo.worlds.list();

const world = await wazoo.worlds.create({
  slug: "support-knowledge",
  label: "Support Knowledge",
});
```

This creates platform metadata for a world. Use the Worlds Data API or
`@worlds/client` for graph data inside that world.

## Create a world auth token

```typescript theme={null}
const authToken = await wazoo.worlds.createToken(world.id);
```

World auth tokens are data-plane credentials with the `wzw_` prefix. Store them
separately from platform tokens.

## Read usage

```typescript theme={null}
const usage = await wazoo.usage.get();
const worldUsage = await wazoo.worlds.usage(world.id);
```

Usage and limits are billed by compute time. Data-plane limit enforcement is a
separate integration point: world operations should report compute-time usage,
and the Platform API should aggregate it against organization and world limits.

## Billing state

Billing is part of the production Platform API. Stripe is the source of truth
for billing and subscription state, while Wazoo mirrors the entitlement state
needed for product behavior and limit enforcement.

The SDK should expose billing and entitlement operations when the server
supports the end-to-end Stripe-backed flow.

## Runtime

The SDK is a fetch-based JavaScript package with ESM and CommonJS builds. The
project is developed with Node.js and npm, but the SDK is intended to run in any
modern JavaScript runtime that provides `fetch`.
