> For the complete documentation index, see [llms.txt](https://docs.amigo.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amigo.ai/developer-guide/platform-api/platform-sdk.md).

# Platform SDK

The Amigo Platform SDK (`@amigo-ai/platform-sdk`) provides a typed TypeScript client for the Platform API. It defaults to the US endpoint at `api.platform.amigo.ai`; set `baseUrl` to the hostname assigned to a workspace in another region. It covers customer-facing resources including agents, services, conversations, calls, analytics, simulations, and billing.

{% hint style="info" %}
**Platform API only.** This SDK targets Platform API deployments, using the US endpoint by default and a `baseUrl` override for other assigned regions. For the Classic API (`api.amigo.ai`), see the [Classic API SDKs](/developer-guide/classic-api/sdks.md).
{% endhint %}

## Available SDK

| Property            | Value                                                                                                          |
| ------------------- | -------------------------------------------------------------------------------------------------------------- |
| **Package**         | `@amigo-ai/platform-sdk`                                                                                       |
| **Repository**      | [github.com/amigo-ai/amigo-platform-typescript-sdk](https://github.com/amigo-ai/amigo-platform-typescript-sdk) |
| **Registry**        | [npm](https://www.npmjs.com/package/@amigo-ai/platform-sdk)                                                    |
| **Node.js Version** | 20+                                                                                                            |
| **Language**        | TypeScript (ships ESM + CJS, full `.d.ts` types)                                                               |

## Key Features

* **Typed client surface.** Supported operations expose generated request and response types. Branded ID types (`AgentId`, `ServiceId`, and so on) help prevent cross-resource ID mixups at compile time.
* **Workspace-aware resources.** Resource methods inject the configured workspace ID when the API route requires it; account-level and authentication helpers use their corresponding unscoped routes.
* **Streaming support.** Server-sent event streaming for conversation turns, plus WebSocket URL helpers for real-time text sessions.
* **Built-in request error handling.** Typed request errors with HTTP status codes when a response is available; streaming and webhook helpers expose their own structured errors.
* **Zero-config retries.** Automatic exponential backoff for eligible transient reads and `POST` 429 responses that include `Retry-After`.
* **Dual module output.** ESM and CJS, validated on active LTS Node.js releases (20, 22, and 24).

## Covered Resources

| Resource          | Client Property           | Description                                                                                 |
| ----------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| Workspaces        | `client.workspaces`       | Workspace info and settings                                                                 |
| API Keys          | `client.apiKeys`          | Create and manage API keys                                                                  |
| Agents            | `client.agents`           | Agents and agent versions                                                                   |
| Agent Runs        | `client.agentRuns`        | Dispatch and get framework-native agent runs                                                |
| Runs              | `client.runs`             | Unified conversation and framework run listing, detail, trajectories, and operator controls |
| Agent Definitions | `client.agentDefinitions` | Native framework agent registry                                                             |
| Actions           | `client.actions`          | Reusable AI capabilities agents can call                                                    |
| Services          | `client.services`         | Published deployable services                                                               |
| Context Graphs    | `client.contextGraphs`    | Conversation flow graphs                                                                    |
| Data Sources      | `client.dataSources`      | External data connectors                                                                    |
| World             | `client.world`            | Entities, events, relationships, timelines                                                  |
| Calls             | `client.calls`            | Call records, outbound call creation, and intelligence                                      |
| Conversations     | `client.conversations`    | Text conversations, turns, and streaming                                                    |
| Sessions          | `client.sessions`         | Live session monitoring and fleet status                                                    |
| Use Cases         | `client.useCases`         | Channel use-case ownership and service bindings                                             |
| Integrations      | `client.integrations`     | External system integration configs                                                         |
| Analytics         | `client.analytics`        | Call volume, quality, trends                                                                |
| Simulations       | `client.simulations`      | Voice simulation sessions                                                                   |
| Settings          | `client.settings`         | Voice, branding, outreach, retention                                                        |
| Billing           | `client.billing`          | Usage, invoices, and trends                                                                 |

`client.skills` is a deprecated alias for `client.actions`; the underlying REST path stays `/skills` for backward compatibility. The full client surface, including additional resources such as metrics, recordings, audit, compliance, and surfaces, is listed in the repository's [api.md](https://github.com/amigo-ai/amigo-platform-typescript-sdk/blob/main/api.md).

## Getting Started

1. [**Installation**](/developer-guide/platform-api/platform-sdk/installation.md)**.** Add the SDK to your project.
2. [**Configuration**](/developer-guide/platform-api/platform-sdk/configuration.md)**.** Set up authentication.
3. [**Quickstart**](/developer-guide/platform-api/platform-sdk/quickstart.md)**.** Make your first API call.
4. [**Error Handling**](/developer-guide/platform-api/platform-sdk/error-handling.md)**.** Handle errors gracefully.

## Quick Example

```typescript
import { AmigoClient } from '@amigo-ai/platform-sdk'

const client = new AmigoClient({
  apiKey: process.env.AMIGO_API_KEY!,
  workspaceId: process.env.AMIGO_WORKSPACE_ID!,
})

const { items: agents } = await client.agents.list()
console.log(`You have ${agents.length} agents`)
```

## License

MIT License.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.amigo.ai/developer-guide/platform-api/platform-sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
