# SDKs

Nothing in these clients reaches an endpoint you could not call yourself with
`curl`. What they add is the three things that are tedious to get right every
time and dangerous to get wrong once: an idempotency key on the one mutation
that is deduplicated, a retry policy that honours the server’s own
`retryAfter` and refuses to repeat anything the server does not deduplicate,
and errors that carry `remediation` as a field rather than as prose.

## TypeScript

```bash
npm install apublished
```

```ts
import { Apublished } from 'apublished';

const ap = new Apublished({ apiKey: process.env.APUBLISHED_API_KEY! });

const post = await ap.posts.create({
  body: { items: [{ text: 'Shipping today.' }] },
  targets: [{ channelId }],
  scheduleMode: 'NEXT_SLOT',
});
```

A command line comes with it:

```bash
npx apublished channels
npx apublished post "Shipping today." --to <channelId>
npx apublished import ./schedule.xlsx --files ./clips --to <channelId>
```

## Python, and anything else

Generate one from the spec: [`https://apublished.com/openapi.json`](https://apublished.com/openapi.json).
It is plain JSON, needs no key to read, and is built from the same contracts
the server validates against — so a generated client cannot describe an
endpoint that does not exist.

## Or no SDK at all

- [Recipes](https://apublished.com/docs/agents/recipes.md) — the five things worth doing, as curl
- [Errors](https://apublished.com/docs/agents/errors.md) — every code, what causes it, what to do
- [MCP](https://apublished.com/mcp) — the same operations as tools, if that is how you are wired up
