<!-- https://cutedyno.com/docs/sdks -->

# SDKs

Official clients, and what to do when there isn't one for your language.

## Node.js

```bash
npm install @cutedyno/node
```

Types are generated from the same OpenAPI document the API validates against, so request bodies, filters, and responses are checked at compile time. A typo in a field name is a build error, not a runtime `invalid_request`.

```typescript
import { CuteDyno } from '@cutedyno/node';

const cutedyno = new CuteDyno(); // reads CUTEDYNO_API_KEY
```

What the client handles so you don't:

- **Retries** on `429` and `5xx`, with backoff that honours `Retry-After`.
- **Idempotency keys** on every write, so an automatic retry cannot publish twice.
- **Rate limit visibility** through an `onRateLimit` callback that receives the current headers.
- **Media uploads** as a single call — presign, transfer, and the URL to post with.
- **Webhook verification** with constant-time comparison and a timestamp check.
- **Pagination** as an async iterator, so you never write a page loop.

```typescript
const cutedyno = new CuteDyno({
  apiKey: process.env.CUTEDYNO_API_KEY,
  baseUrl: 'https://api.cutedyno.com',
  timeout: 30_000,
  maxRetries: 2,
  profileId: 'prof_customer_42', // default profile for every call
  onRateLimit: ({ remaining, reset }) => {
    metrics.gauge('cutedyno.rate_limit.remaining', remaining);
  },
});
```

Setting `profileId` on the client is the shortcut for a per-customer worker: construct one client per customer and drop `profileId` from every call site.

Errors throw `CuteDynoError` with a stable `code`, plus `isRetryable`, `isRateLimit`, and `isAuthError` for the common branches. See [Errors](/docs/errors).

The full method table lives in the [package README](https://www.npmjs.com/package/@cutedyno/node).

## Python

Not yet published. Until it is, the REST API is straightforward from `httpx` or `requests` — see the curl examples throughout these docs, and generate a client from the spec if you want types:

```bash
pip install openapi-python-client
openapi-python-client generate --url https://cutedyno.com/docs/api/openapi.json
```

## Any other language

Start from [`/docs/api/openapi.json`](/docs/api/openapi.json). It is a committed artifact generated from the server's own schemas, so a generated client matches the running API rather than a hand-maintained description of it.

Whatever you generate or write by hand, four things are worth implementing rather than skipping:

1. **Send `Idempotency-Key` on writes.** Without it, a timeout leaves you unable to retry safely. See [Idempotency](/docs/guides/idempotency).
2. **Retry `429` and `5xx` only**, and wait for `Retry-After`. Retrying a `400` just fails again. See [Rate limits](/docs/guides/rate-limits).
3. **Branch on `error.code`, never on `error.message`.** Codes are contractual; messages are prose.
4. **Log `requestId` from failures.** It is the fastest route to an answer when you need support.

## MCP

For agents rather than code, the [MCP server](/docs/mcp) exposes the same API as tools:

```bash
npx -y cutedyno-mcp
```
