# SDKs

Pozy has no published client libraries yet. Call the REST API with curl, fetch or any HTTP client, generate a client from the OpenAPI spec, or connect an assistant to the MCP server.

Pozy does not publish any client libraries yet: there is no npm, PyPI or other package to install. The supported ways to use Pozy today are the REST API, called with any HTTP client, and the [MCP server](https://pozy.ai/docs/mcp) at `https://mcp.pozy.ai/mcp` for AI assistants.

> **Do not install packages named after Pozy:**
> 
> No package on npm, PyPI or any other registry is published by Pozy today. If you find one that claims to be a Pozy SDK, do not install it, and tell us at support@pozy.ai.

## What to use today

| You are writing | Use |
| --- | --- |
| A backend, script or worker in any language | The REST API with your language's HTTP client. Every page in these docs shows cURL, Node (`fetch`) and Python (`requests`) |
| Typed code | A client generated from the [OpenAPI spec](https://pozy.ai/docs/sdks/openapi) |
| An AI assistant workflow | The [MCP server](https://pozy.ai/docs/mcp), with OAuth sign-in |
| A no-code automation | [Zapier, Make or n8n](https://pozy.ai/docs/integrations) with an HTTP step |

## Call the API

The API is plain HTTPS and JSON. Send your key in the `Authorization` header:

```bash cURL
curl https://api.pozy.ai/v1/accounts \
  -H "Authorization: Bearer $POZY_API_KEY"
```
```ts Node
const res = await fetch("https://api.pozy.ai/v1/accounts", {
  headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
const body = await res.json();
if (!res.ok) throw new Error(body.error);
for (const account of body.accounts) {
  console.log(account.platform, account.username, account._id);
}
```
```python Python
import os
import requests

resp = requests.get(
    "https://api.pozy.ai/v1/accounts",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    timeout=30,
)
resp.raise_for_status()
for account in resp.json()["accounts"]:
    print(account["platform"], account.get("username"), account["_id"])
```

The Node examples use the `fetch` built into Node.js 18 and later, so they need nothing installed. The Python examples use [`requests`](https://requests.readthedocs.io).

With plain HTTP you take care of a few things yourself:

- Send `Authorization: Bearer pz_live_...` on every request. See [Authentication](https://pozy.ai/docs/getting-started/authentication).
- Read errors from the JSON body: `error`, `type`, `code` and sometimes `param` and `details`. See [Errors](https://pozy.ai/docs/getting-started/errors).
- Back off on `429` using the `Retry-After` and `X-RateLimit-Reset` headers. See [Rate limits](https://pozy.ai/docs/getting-started/rate-limits).
- Send an `Idempotency-Key` on writes you might retry. See [Idempotency](https://pozy.ai/docs/getting-started/idempotency).

[Node.js](https://pozy.ai/docs/sdks/node) has a small `fetch` wrapper that does all four, which you can copy into your project.

## Operation ids

Every endpoint has an `operationId` in the spec, such as `createPost`. It is the last part of each [API reference](https://pozy.ai/docs/api) URL, the method name most generated clients use, and the name the [MCP server](https://pozy.ai/docs/mcp) runs through `call_tool`.

## Keep keys on the server

Call Pozy from server-side code: backends, workers, scripts and serverless functions. Never ship a `pz_live_` key to a browser or a mobile app, because anyone can read it there. For a user-facing app, call Pozy from your backend, or create a [profile-scoped, read-only key](https://pozy.ai/docs/getting-started/authentication) for the narrowest job.

## Next steps

- [Node.js](https://pozy.ai/docs/sdks/node): A copyable fetch wrapper, uploads, idempotency, errors and retries.
- [OpenAPI spec](https://pozy.ai/docs/sdks/openapi): Generate a client in any language, or import into Postman.
- [MCP server](https://pozy.ai/docs/mcp): The same API from Claude, ChatGPT, Cursor and other assistants.
