---
docId: doc_fd37db0b46d04828b77d27f38c4cf0e0
title: Install the SDK
description: Install platic-sdk, check the requirements and make your first call.
sidebarTitle: Install
---

<script>
  import { Steps, Note } from '$lib/components';
</script>

# Install the SDK

Add `platic-sdk` to a Node.js project and make a first call with your API key.

## Before you start

- Node.js 20.3 or newer.
- A server to run the SDK. The API key is sent with every request; the SDK does not start in a browser to keep it from being exposed (see [The client](/sdk/client#browsers)).
- An API key (`pl_key_…`) or an OAuth access token (`pl_at_…`). Create a key in [API keys](/help/settings/api-keys) and read [Authentication](/authentication).

<Steps>
<Steps.Step title="Install the package">

```bash
npm install platic-sdk
```

pnpm and yarn work the same way: `pnpm add platic-sdk`, `yarn add platic-sdk`.

</Steps.Step>
<Steps.Step title="Keep the key in an environment variable">

```bash
export PLATIC_API_KEY=pl_key_...
```

Never put the key in your code or in a repository.

</Steps.Step>
<Steps.Step title="Make a call">

```ts
import { Platic } from "platic-sdk";

const platic = new Platic({ apiKey: process.env.PLATIC_API_KEY! });

const { data } = await platic.agents.list({ limit: 5 });
console.log(data.map((agent) => agent.name));
```

</Steps.Step>
</Steps>

## Check it worked

The script prints a list of agent names (an empty list if the workspace has none). A wrong key throws `AuthenticationError`, status 401. See [Errors](/sdk/errors).

## ESM and CommonJS

The package ships both builds, each with its declarations. In CommonJS:

```js
const { Platic } = require("platic-sdk");

const platic = new Platic({ apiKey: process.env.PLATIC_API_KEY });
```

For TypeScript, the SDK is tested with TypeScript 5.9, `strict`, and `module` and `moduleResolution` set to `nodenext`.

## Next steps

- [The client](/sdk/client): options for the base URL, workspace, timeouts and `fetch`.
- [Quickstart example](/sdk/examples/quickstart): create an agent and talk to it.
- [Create an agent](/api-reference/agents/create): the endpoint behind `platic.agents.create`.
