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

# SDK 0.13

> The TypeScript SDK for the developer platform: createNaive, tools, resources, approvals, usage and logs.

```bash theme={"system"}
npm i @usenaive-sdk/naive
```

`@usenaive-sdk/naive` is the developer platform SDK. It re-exports `@usenaive-sdk/managed-agents` 0.13 (same client,
versions in lockstep), so code that imports from `@usenaive-sdk/managed-agents` keeps working. Nothing was removed or
renamed: `createClient` and every existing namespace work exactly as before.

## createNaive

```ts theme={"system"}
import { createNaive } from "@usenaive-sdk/naive";

const client = createNaive(); // reads NAIVE_API_KEY, and NAIVE_BASE_URL if set
```

`createNaive` is `createClient` with the newest API version (`2026-12-01`) pinned. `apiKey` falls back to
`NAIVE_API_KEY`; `baseUrl` to `NAIVE_BASE_URL`, then `https://api.vetta.sh`. Clients made with `createClient` keep the
version they had, so their responses do not change shape.

## What is new

| Namespace | What it does | Reference |
| - | - | - |
| `client.tools` | `search`, `get`, `run`, `runs.list`, `runs.get` | [tools](https://vetta.sh/docs/sdk/tools.md) |
| `client.resources` | `list`, `get`, `forIdentity` (read-only) | [resources](https://vetta.sh/docs/sdk/resources.md) |
| `client.approvals` | `list`, `get`, `wait`, `approve`, `deny`, `rules.get`, `rules.set`, `rules.workspace.*` | [approvals](https://vetta.sh/docs/sdk/approvals.md) |
| `client.usage` | `get` by key, identity, tool or day | [usage](https://vetta.sh/docs/sdk/usage.md) |
| `client.logs` | `list`, `get` | [logs](https://vetta.sh/docs/sdk/logs.md) |
| `client.keys` | adds `preset`, `expiresAt`, `budget`, `description`; new `get` and `update`; `rotate` takes `graceSeconds` | [keys](https://vetta.sh/docs/sdk/keys.md) |

Resource writes use the namespaces you already know: `client.emails`, `client.domains`, `client.trading`,
`client.computers`, `client.vaults`, `client.phones`, `client.social`, and `client.identities.cards`,
`client.identities.wallet` and `client.identities.legal`.

## An end-to-end example

```ts theme={"system"}
import { createNaive } from "@usenaive-sdk/naive";

const client = createNaive();

// A tool
const image = await client.tools.run("image.generate", { prompt: "a ceramic mug on a walnut desk" }, { wait: true });

// An identity with an inbox, then a send
const support = await client.identities.create({ name: "Support" });
const inbox = await client.emails.create(support.id, {});
await client.emails.send(support.id, inbox.id, { to: ["you@example.com"], subject: "Hi", text: "From my agent." });

// Everything the identity owns
const owned = await client.resources.forIdentity(support.id);

// What it cost
const spend = await client.usage.get({ by: "tool" });
```

## Held calls

When an identity's rules hold a call, the API answers `202` with an `approval` instead of the usual object. Methods
take `approvals: "return" | "throw" | "wait"`:

| Mode | Behaviour |
| - | - |
| `"return"` | The `Approval` comes back (default for the new namespaces). |
| `"throw"` | Throws `ApprovalRequiredError`; the approval is on `.approval` (default for older namespaces, so their return types never change). |
| `"wait"` | Waits for a person to decide, then returns the original call's result. |

Held calls only happen in developer workspaces.

## Compatibility

* New response fields (`grants`, `budget`, `expires_at`, `client`, `last_used_at` and others) are parsed tolerantly, and
  older SDK versions ignore them.
* The legacy `scopes` field on keys and MCP sessions keeps only the original values, so older SDKs keep parsing it.
* Older methods that the new ones supersede are marked `@deprecated` in the types; none were removed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.