Skip to content
Gauge

ax-check.com

Adeli

tryadeli.com

ax-check.com

Checked 18 November 2026

B

84/100

Agents need your login

Docs and pricing are clear, but agents don't always agree on price

20 of 23 checks passed, including readable pricing and a working quickstart. One session quoted a stale "$50/month" figure instead of the real published tiers.

2 fixes to start with

Concrete changes, backed by what we found.

Onboarding

Give agents a clear login handoff and a way to resume setup.

Agents cannot progress through onboarding without human help. Provide an agent-accessible path through authentication and setup.

Docs

Return Markdown when clients request text/markdown.

Homepage returned text/html for a Markdown Accept header; no Markdown representation served.

Recorded coding sessions

Same task, 3 models, no tryadeli.com account. Recorded 18 November 2026 on Pi.

3 recorded · 2m 4s

2m 4s · recorded

Session findings

Select a finding to see it in context.

piv0.84.2
modelQwen 3.8 Maxcwd/sandbox/repo
Help me build a simple example using Adeli. Tell me how pricing works, and briefly tell me whether this product will be easy for you to manage. Let me know if you get blocked. If this product has no developer workflow you can act on, say so plainly and stop. Stay light: use the hosted product through its SDK or API. Do not start local service stacks or wait for long-running commands; if the quickstart requires either, say so plainly and stop.
Thinking…

The user asks about "Adeli" — need to check the repo. Let's look.

ls -la /sandbox/repo; echo "---"; cat /sandbox/repo/README* 2>/dev/null | head -50
total 16
total 16
drwxr-xr-x 3 root root 4096 Sep 18 08:00 .
drwxr-xr-x 7 root root 4096 Nov 18 20:10 ..
drwxr-xr-x 8 root root 4096 Sep 24 20:05 .git
-rw-r--r-- 1 root root  408 Sep 18 08:00 .gitignore
---
grep -ril "adeli" /sandbox/repo 2>/dev/null | head -20
(no output)
(no output)
Thinking…

Empty repo. Check git log / remote, and whether there's network access or any package registry for "Adeli".

cd /sandbox/repo && git log --oneline | head; git remote -v; cat .gitignore
9ebf5fb Initial workspace
9ebf5fb Initial workspace
# Keep generated and vendored files out of source diffs.

# Logs / OS cruft
*.log
.DS_Store

# JavaScript / TypeScript
node_modules/
.next/
dist/
build/
coverage/

# Python
.venv/
venv/
__pycache__/
*.py[cod]
.pytest_cache/
*.egg-info/

# Rust
target/

# Go / PHP / Ruby vendored deps
vendor/
.bundle/

# Java / Kotlin / Scala
.gradle/

# .NET
bin/
obj/

# Elixir
_build/
deps/

# Dart / Flutter
.dart_tool/
timeout 15 curl -s -o /dev/null -w "%{http_code}\n" https://registry.npmjs.org/adeli ; echo "exit=$?"
404
404
exit=0
Thinking…

Network works. Search npm/PyPI for "adeli". Also maybe it's a product name unrelated. Let's search PyPI and npm.

timeout 20 curl -s "https://registry.npmjs.org/-/v1/search?text=adeli&size=10" | python3 -c "import sys,json;d=json.load(sys.stdin);[print(o['package']['name'],'-',o['package'].get('description')) for o in d['objects']]" 2>&1 | head -20
@adeli/sdk - Official TypeScript SDK for Adeli, the unified social media and ads API
@adeli/sdk - Official TypeScript SDK for Adeli, the unified social media and ads API
@adeli/chat-sdk-adapter - Adeli adapter for Chat SDK: Instagram, Facebook and WhatsApp DMs, and Instagram and TikTok comments, through one API key
timeout 20 curl -s "https://pypi.org/pypi/adeli/json" -o /dev/null -w "pypi-adeli:%{http_code}\n"; timeout 20 curl -s "https://pypi.org/search/?q=adeli" -o /dev/null -w "search:%{http_code}\n"
pypi-adeli:404
pypi-adeli:404
search:200
Thinking…

@adeli/sdk exists. Let's fetch its README from npm registry.

timeout 20 curl -s "https://registry.npmjs.org/@adeli/sdk" | python3 -c "
import sys,json
d=json.load(sys.stdin)
print(d.get('description'))
print('latest:',d['dist-tags'])
v=d['versions'][d['dist-tags']['latest']]
print('deps:',v.get('dependencies'))
print('homepage:',v.get('homepage'),v.get('repository'))
print('---README---')
print(d.get('readme','')[:12000])
"
Official TypeScript SDK for Adeli, the unified social media and ads API
Official TypeScript SDK for Adeli, the unified social media and ads API
latest: {'latest': '0.7.0'}
deps: None
homepage: https://github.com/kingscrosslabs/adeli-sdk#readme {'url': 'git+https://github.com/kingscrosslabs/adeli-sdk.git', 'type': 'git'}
---README---
<p align="center">
  <img src="https://raw.githubusercontent.com/kingscrosslabs/adeli-sdk/main/.github/assets/logo.svg" width="120" height="120" alt="Adeli logo" />
  <h1 align="center">Adeli SDK</h1>
  <p align="center">
    The official TypeScript SDK for <a href="https://www.tryadeli.com">Adeli</a>, the unified social media and ads API.
  </p>
</p>

<p align="center">
  <a href="https://www.npmjs.com/package/@adeli/sdk"><img src="https://img.shields.io/npm/v/@adeli/sdk?color=0a807a&label=npm" alt="npm version" /></a>
  <a href="https://github.com/kingscrosslabs/adeli-sdk/actions/workflows/ci.yml?query=branch%3Amain"><img src="https://img.shields.io/github/actions/workflow/status/kingscrosslabs/adeli-sdk/ci.yml?branch=main&label=CI" alt="CI status" /></a>
  <a href="https://github.com/kingscrosslabs/adeli-sdk/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@adeli/sdk?color=0a807a" alt="MIT license" /></a>
  <img src="https://img.shields.io/node/v/@adeli/sdk?color=339933&logo=nodedotjs&logoColor=white" alt="Node.js version" />
  <img src="https://img.shields.io/badge/types-included-3178c6?logo=typescript&logoColor=white" alt="TypeScript types included" />
</p>

<p align="center">
  <a href="https://github.com/kingscrosslabs/adeli-sdk/blob/main/docs/client.md">Docs</a>
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
  <a href="https://www.tryadeli.com/docs/api">API reference</a>
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
  <a href="https://github.com/kingscrosslabs/adeli-sdk/blob/main/docs/publishing.md">Publishing guide</a>
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
  <a href="https://github.com/kingscrosslabs/adeli-sdk/tree/main/examples">Examples</a>
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
  <a href="https://github.com/kingscrosslabs/adeli-sdk/blob/main/CHANGELOG.md">Changelog</a>
</p>

<br />

## Introduction

The Adeli SDK is a TypeScript client for the [Adeli API](https://www.tryadeli.com). Create the `adeli` object to post on social media, read or reply to comments and messages, analyze account insights, or manage ads.

```ts
import { Adeli } from '@adeli/sdk';

const adeli = new Adeli(); // reads ADELI_API_KEY

// publish
await adeli.posts.createPost({
  body: { platform: 'x', accountId, text: 'Shipped with @adeli/sdk 🚀' },
});

// read
const { data } = await adeli.accounts.listAccounts();
data.accounts; // every connected account, fully typed
```

- Types generated from the Adeli OpenAPI contract
- Zero runtime dependencies, with ESM and CommonJS builds
- Runs on Node.js 22+, Vercel functions, and Cloudflare Workers
- Media uploads that stream straight to storage
- Bounded polling, comment and conversation iterators, and webhook verification
- No retries unless you opt in, and a typed error class for each failure

## Installation

```sh
npm install @adeli/sdk
```

```sh
export ADELI_API_KEY="..." # from https://app.tryadeli.com
```

Your API key is a secret. Create the client only in server code, and never expose the key through a `NEXT_PUBLIC_` or `VITE_` env var. On Cloudflare Workers without `nodejs_compat`, pass `apiKey` explicitly.

`apiKey` can also be a function returning a string or a promise of one. The SDK calls it before every request attempt and never caches the result, so rotated keys from a secret store are picked up right away:

```ts
const adeli = new Adeli({ apiKey: async () => (await secrets.get('adeli-api-key')).value });
```

See [Rotating keys with a resolver](https://github.com/kingscrosslabs/adeli-sdk/blob/main/docs/client.md#rotating-keys-with-a-resolver).

## Basic usage

Every call resolves to `{ data, status, headers }`.

```ts
const { data } = await adeli.profiles.listProfiles();
//      ^? { profiles: Profile[] }
```

The client is grouped by resource: `profiles`, `accounts`, `posts`, `publications`, `comments`, `messages`, `analytics`, `ads`, `webhooks`, and `usage`.

### Connect an account

```ts
import { waitForConnection } from '@adeli/sdk/helpers';

const session = await adeli.profiles.startConnection({
  path: { profileId },
  body: { platform: 'tiktok', redirectUrl: 'https://example.com/connected' },
});

// send the user to session.data.authUrl, then:
await waitForConnection(
  adeli,
  { path: { profileId, connectionSessionId: session.data.id } },
  { intervalMs: 2_000, timeoutMs: 300_000 },
);
```

### Upload a video

```ts
import { fileFromPath } from '@adeli/sdk/uploads';

await adeli.posts.createPost({
  body: {
    platform: 'tiktok',
    accountId,
    video: await fileFromPath('./launch.mp4', { contentType: 'video/mp4' }),
    music_usage_confirmed: true,
  },
});
```

`fileFromPath` is for Node.js. You can pass any `Blob` or `File` as media in any runtime.

### Publish to several accounts

```ts
import { waitForPublication } from '@adeli/sdk/helpers';

const publication = await adeli.publications.createPublication({
  body: {
    content: 'Launch day',
    media: [await fileFromPath('./launch.mp4', { contentType: 'video/mp4' })],
    platforms: [
      { platform: 'tiktok', accountId: tiktokId, options: { music_usage_confirmed: true } },
      { platform: 'youtube', accountId: youtubeId, options: { privacy_status: 'private', made_for_kids: false } },
    ],
  },
});

const done = await waitForPublication(
  adeli,
  { path: { publicationId: publication.data.id } },
  { intervalMs: 3_000, timeoutMs: 600_000 },
);
// done.data.status is 'published', 'partial', or 'failed'; each target has its own status and error.
```

The video is uploaded once for both platforms.

### Iterate comments

```ts
import { iterateComments } from '@adeli/sdk/helpers';

for await (const comment of iterateComments(
  adeli,
  { query: { platform: 'youtube', accountId } },
  { maxPages: 10, timeoutMs: 60_000 },
)) {
  console.log(comment.id);
}
```

### Read a conversation

Every message carries a `conversationKey` (`<platform>:<counterparty id>`), as does every `message.created` webhook. `iterateConversation` walks one conversation from its newest message back, following `nextCursor`:

```ts
import { iterateConversation } from '@adeli/sdk/helpers';

for await (const message of iterateConversation(
  adeli,
  { query: { accountId, conversationKey: 'instagram:17841400000000001', limit: 50 } },
  { maxPages: 5 },
)) {
  console.log(message.direction, message.body);
}
```

### Verify webhooks

```ts
import { parseWebhookEvent, verifyWebhookSignature } from '@adeli/sdk/helpers';

export async function POST(request: Request) {
  const payload = await request.text();
  const valid = verifyWebhookSignature({
    payload,
    header: request.headers.get('Adeli-Signature'),
    secret: process.env.ADELI_WEBHOOK_SECRET!,
  });
  if (!valid) return new Response('Invalid signature', { status: 401 });

  const event = parseWebhookEvent(payload);
  if (event.type === 'comment.created' && event.platform === 'tiktok') {
    // event.data.text, event.data.from.username, event.data.mediaId (the video id)
  }
  if (event.type === 'message.created') {
    // An inbound Instagram, Facebook or WhatsApp DM: event.platform, event.data.conversationKey,
    // event.data.from.id, event.data.text (null for attachments only), event.data.attachments
  }
  return new Response(null, { status: 204 });
}
```

#### Try it locally

A receiver can be one line of Node.js. Run it in a folder where `@adeli/sdk` is installed, with the secret `createWebhook` returned:

```sh
ADELI_WEBHOOK_SECRET=whsec_... node --input-type=module -e 'import{createServer}from"node:http";import{verifyWebhookSignature,parseWebhookEvent}from"@adeli/sdk/helpers";createServer(async(q,s)=>{let b="";for await(const d of q)b+=d;const ok=verifyWebhookSignature({payload:b,header:q.headers["adeli-signature"],secret:process.env.ADELI_WEBHOOK_SECRET});console.log(ok?parseWebhookEvent(b):"bad signature");s.writeHead(ok?204:401).end()}).listen(4242)'
```

Register it, then fire a signed sample event at it. `http://localhost` URLs work against an Adeli running on the same machine; for `app.tryadeli.com`, expose the receiver through an HTTPS tunnel and register that URL instead.

```ts
const { data: created } = await adeli.webhooks.createWebhook({ body: { profileId, url: 'http://localhost:4242', events: ['comment.created'] } });
const { data: result } = await adeli.webhooks.testWebhook({ path: { webhookId: created.webhook.id } });
console.log(result.delivered, result.statusCode); // true 204
```

Events by platform (`createWebhook` with `platform` receives only that platform's events; a platform with an event it does not send is `422 unsupported_for_platform`):

| Platform    | Events                                                   |
| ----------- | -------------------------------------------------------- |
| `instagram` | `comment.created`, `message.postback`, `message.created` |
| `tiktok`    | `comment.created`                                        |
| `facebook`  | `message.created`                                        |
| `whatsapp`  | `message.created`                                        |

`message.created` is an inbound direct message; echoes and the account's own sends are never delivered. An event type this SDK version does not know parses as `type: 'unknown'`.

On Instagram, `event.data.story` is `{ type: 'reply' | 'mention', id, url }` when the message replies to the account's story or mentions it in someone else's, and null otherwise. To gate a flow on a follow, read the sender with `client.messages.getInstagramUser({ path: { igsid: event.data.from.id }, query: { accountId: event.accountId } })` and check `user.isFollowing`; Instagram answers once the person has messaged the account or tapped one of its buttons, and `409 user_consent_required` before that.

See `examples/webhook-receiver.ts` for a fuller receiver.

### Handle errors

```ts
import { AdeliApiError, PermissionRequiredError, RateLimitError, TimeoutError } from '@adeli/sdk';

try {
  await adeli.posts.createPost({ body });
} catch (error) {
  if (error instanceof PermissionRequiredError) {
    // reconnect the account with more permissions
  } else if (error instanceof RateLimitError) {
    // back off
  } else if (error instanceof TimeoutError) {
    // outcome unknown: check before you send it again
  } else if (error instanceof AdeliApiError) {
    console.error(error.status, error.code, error.details);
  }
}
```

See [`examples/`](https://github.com/kingscrosslabs/adeli-sdk/tree/main/examples) for complete, type-checked examples.

## Supported platforms

| Platform   | Connect | Publish | Analytics | Comments | Messages | Ads |
| ---------- | :-----: | :-----: | :-------: | :------: | :------: | :-: |
| Instagram  |   ✅    |   ✅    |    ✅     |    ✅    |    ✅    |     |
| Facebook   |   ✅    |   🧪    |    🧪     |    🧪    |    ✅    |     |
| TikTok     |   ✅    |   ✅    |    ✅     |    ✅    |          |     |
| YouTube    |   ✅    |   ✅    |    ✅     |    ✅    |          |     |
| X          |   ✅    |   ✅    |           |          |          |     |
| Bluesky    |   ✅    |   ✅    |           |          |          |     |
| Meta Ads   |   ✅    |         |           |          |          | ✅  |
| TikTok Ads |   ✅    |         |           |          |          | ✅  |
| LinkedIn Ads |   ✅    |         |           |          |          | ✅  |

✅ production&nbsp;&nbsp;🧪 beta, pending provider review. See [Feature availability](https://github.com/kingscrosslabs/adeli-sdk/blob/main/docs/availability.md).

## Runtimes

| Import               | Contents                                                | Runs on                                                         |
| -------------------- | ------------------------------------------------------- | --------------------------------------------------------------- |
| `@adeli/sdk`         | The `Adeli` client, types, and error classes            | Node.js 22+, Vercel functions, Cloudflare Workers               |
| `@adeli/sdk/helpers` | Polling, iterators, and webhook verification            | 
Thinking…

Get rest of README including pricing/usage docs. Let's fetch remaining readme and docs (pricing).

timeout 20 curl -s "https://registry.npmjs.org/@adeli/sdk" | python3 -c "
import sys,json
d=json.load(sys.stdin)
print(d.get('readme','')[12000:24000])
"
Same. Webhook verification needs `node:crypto` (Workers: `nodejs_compat`) |
Same. Webhook verification needs `node:crypto` (Workers: `nodejs_compat`) |
| `@adeli/sdk/uploads` | `fileFromPath` and `blobFromPath`                       | Node.js only                                                    |

The SDK throws in browsers.

## Documentation

- [Client and request semantics](https://github.com/kingscrosslabs/adeli-sdk/blob/main/docs/client.md): retries, timeouts, errors, and runtimes
- [Publishing and uploads](https://github.com/kingscrosslabs/adeli-sdk/blob/main/docs/publishing.md): payloads for each platform, and partial outcomes
- [API reference](https://www.tryadeli.com/docs/api): every operation
- [Feature availability](https://github.com/kingscrosslabs/adeli-sdk/blob/main/docs/availability.md): production compared with beta

## License

[MIT](https://github.com/kingscrosslabs/adeli-sdk/blob/main/LICENSE) © King's Cross Labs

cd /tmp && timeout 60 curl -sL https://github.com/kingscrosslabs/adeli-sdk/archive/refs/heads/main.tar.gz -o adeli.tar.gz && tar tzf adeli.tar.gz | head -60
adeli-sdk-main/
adeli-sdk-main/
adeli-sdk-main/.changeset/
adeli-sdk-main/.changeset/config.json
adeli-sdk-main/.github/
adeli-sdk-main/.github/assets/
adeli-sdk-main/.github/assets/logo.svg
adeli-sdk-main/.github/workflows/
adeli-sdk-main/.github/workflows/auto-deploy.yml
adeli-sdk-main/.github/workflows/ci.yml
adeli-sdk-main/.github/workflows/release.yml
adeli-sdk-main/.github/workflows/spec-drift.yml
adeli-sdk-main/.gitignore
adeli-sdk-main/CHANGELOG.md
adeli-sdk-main/LICENSE
adeli-sdk-main/README.md
adeli-sdk-main/docs/
adeli-sdk-main/docs/api-reference.md
adeli-sdk-main/docs/availability.md
adeli-sdk-main/docs/client.md
adeli-sdk-main/docs/maintenance.md
adeli-sdk-main/docs/publishing.md
adeli-sdk-main/docs/releasing.md
adeli-sdk-main/eslint.config.mjs
adeli-sdk-main/examples/
adeli-sdk-main/examples/connect-account.ts
adeli-sdk-main/examples/partial-results.ts
adeli-sdk-main/examples/publish-everywhere.ts
adeli-sdk-main/examples/publish-instagram.ts
adeli-sdk-main/examples/quickstart.ts
adeli-sdk-main/examples/upload-tiktok.ts
adeli-sdk-main/examples/upload-youtube.ts
adeli-sdk-main/examples/webhook-receiver.ts
adeli-sdk-main/openapi/
adeli-sdk-main/openapi/adeli.openapi.json
adeli-sdk-main/openapi/docs-links.json
adeli-sdk-main/openapi/provenance.json
adeli-sdk-main/package-lock.json
adeli-sdk-main/package.json
adeli-sdk-main/scripts/
adeli-sdk-main/scripts/api-reference-validation.ts
adeli-sdk-main/scripts/check-api-reference.ts
adeli-sdk-main/scripts/check-contract.ts
adeli-sdk-main/scripts/check-generated.ts
adeli-sdk-main/scripts/check-package.ts
adeli-sdk-main/scripts/check-release-provenance.mjs
adeli-sdk-main/scripts/check-spec-drift.mjs
adeli-sdk-main/scripts/generate-api-reference.ts
adeli-sdk-main/scripts/generate.ts
adeli-sdk-main/scripts/packed-toolchain.d.mts
adeli-sdk-main/scripts/packed-toolchain.mjs
adeli-sdk-main/scripts/sync-openapi.ts
adeli-sdk-main/scripts/typecheck-examples.ts
adeli-sdk-main/src/
adeli-sdk-main/src/client.ts
adeli-sdk-main/src/core/
adeli-sdk-main/src/core/config.ts
adeli-sdk-main/src/core/duration.ts
adeli-sdk-main/src/core/errors.ts
adeli-sdk-main/src/core/generated.ts
adeli-sdk-main/src/core/retry.ts
Thinking…

Now check pricing. README mentions usage resource. Look at openapi spec for usage endpoints, and docs for pricing. Also check tryadeli.com/pricing.

Also check quickstart example, and whether API key is needed (blocked without key). Let's inspect.

cd /tmp/adeli-sdk-main && grep -ril "pric\|billing\|credit\|plan" docs README.md examples openapi/*.json | head; echo ---; grep -o '"[^"]*pricing[^"]*"' -i openapi/adeli.openapi.json | sort -u | head -20; echo ---USAGE---; python3 -c "
import json;d=json.load(open('openapi/adeli.openapi.json'))
for p in d['paths']:
    if 'usage' in p: print(p, list(d['paths'][p]))
"
Failed---
---
/bin/bash: line 1: cd: /tmp/adeli-sdk-main: No such file or directory
grep: openapi/adeli.openapi.json: No such file or directory
---USAGE---
Traceback (most recent call last):
  File "<string>", line 2, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'openapi/adeli.openapi.json'


Command exited with code 1
timeout 20 curl -s https://www.tryadeli.com/pricing -o /tmp/pricing.html -w "%{http_code}\n"; python3 - <<'EOF'
import re,html
t=open('/tmp/pricing.html',encoding='utf-8',errors='ignore').read()
t=re.sub(r'<script.*?</script>','',t,flags=re.S)
t=re.sub(r'<style.*?</style>','',t,flags=re.S)
t=re.sub(r'<[^>]+>',' ',t)
print(re.sub(r'\s+',' ',html.unescape(t))[:4000])
EOF
200
200
 Social Media API Pricing | Adeli adeli Product How it works Pricing Blog Docs FAQ Talk to us Start for free Predictable, incentive-aligned pricing. Designed to scale as you grow. Adeli is free to start for 2 user profiles with up to 2 social accounts each, with ~2 months free on annual billing. Start for free No credit card required to start. “ I went from extremely blocked to shipping all of the social and ads features I needed in a few hours. The team is cracked and ultra responsive. ” Zo Khalapyan Founder, Dibs (Vertical SaaS), ex-Meta “ I discovered them as I was constantly stuck in platform reviews, with no end in sight. Adeli's solution unblocked me instantly and so much more. ” Ben Gusberg Founder, Cape (GTM SaaS), 100k followers “ I could not ask for a more customer-friendly team. They're quick & smart with solutions. They supported me until everything was resolved. ” Moh Jaffar Founder, Monstrum (Marketing Platform) Which Adeli plan fits your platform? A user profile represents one of your users and holds the social accounts they connect, like their Instagram or TikTok. Monthly Annual ~2 months free Free $0 /month No card needed Good for testing Start for free 2 user profiles A user profile represents one of your users and holds the social accounts they connect, like their Instagram or TikTok. A profile counts on each day it has at least one connected account. Up to 2 social accounts per profile One connected channel inside a user profile, like an Instagram account, a Facebook Page or a YouTube channel. 10 posts, 100 comments and 100 messages Free's posts, comments and messages are a one-time allowance to try Adeli. They don't reset each month. Every platform except X, WhatsApp and Bluesky Unlimited team members Starter $25 /month Billed $300 yearly Start building your business Choose Starter 10 user profiles, then $2.50 per extra profile a month A profile past the ones your plan includes. It's billed by the day, so a profile active for 10 days of a 30-day month costs a third of the month. Up to 5 social accounts per profile One connected channel inside a user profile, like an Instagram account, a Facebook Page or a YouTube channel. 10,000 posts, 10,000 comments and 10,000 messages a month Posts, comments and messages you send through Adeli. A post to 3 accounts counts as 3 posts. Reading posts, comments and messages never counts. Analytics Every platform X charges per API request. We pass those fees through at X's published rates, with no markup. Unlimited team members Business $125 /month Billed $1,500 yearly For scaling platforms and agencies Choose Business 100 user profiles, then $1.50 per extra profile a month A profile past the ones your plan includes. It's billed by the day, so a profile active for 10 days of a 30-day month costs a third of the month. A social account on every platform, for every profile One connected channel inside a user profile, like an Instagram account, a Facebook Page or a YouTube channel. Unlimited posts, comments and messages No monthly cap, under fair use. Each platform still sets its own limits, such as TikTok's posts per account per day. Analytics Every platform X charges per API request. We pass those fees through at X's published rates, with no markup. Priority support Enterprise Volume pricing for large platforms Everything in Business Custom volume rates Annual invoicing Priority support Talk to us What you can build Posting Posts and scheduled posts through one API. Analytics Account and post insights: reach, views, engagement, followers. On Starter and Business. Comments Read, reply to, hide and delete comments on your users' posts. Messaging Read and reply to DMs. WhatsApp sends approved templates. Ads Ads Meta ad accounts, campaigns and live metrics. API + MCP Social media Full REST API and an MCP server for AI agents. Extra profiles are billed by the day, on each day a profile has at least one connected social account. Analytics, X, WhatsApp and Bluesky need a paid plan. X
Thinking…

Tarball extraction failed? tar tzf worked earlier, so download happened but maybe /tmp got cleaned between calls? Actually the first command in the parallel block ran cd /tmp && curl ... && tar tzf, and the second block ran cd /tmp/adeli-sdk-main but I never extracted. Right — I only listed. Let me extract.

Now: pricing understood. Next, build a simple example. Blocked on API key? Let's check the docs for the client and quickstart, and whether the SDK has a sandbox/mock mode. Also check npm install works offline? Network is available.

Plan: create example project in /sandbox/repo with @adeli/sdk installed, a quickstart script that lists profiles/accounts and publishes a post, with graceful handling when no API key. Type-check it. Verify no long-running services required.

Let me extract tarball and read docs/client.md, examples/quickstart.ts.

cd /tmp && tar xzf adeli.tar.gz && cat adeli-sdk-main/examples/quickstart.ts
import { Adeli } from '@adeli/sdk';
import { Adeli } from '@adeli/sdk';

/** Read-only discovery; invoke this from a server request or job. */
export async function quickstart(): Promise<Readonly<{ profileId: string; accountCount: number }>> {
  const client = new Adeli({ apiKey: process.env.ADELI_API_KEY });
  const identity = await client.getMe();
  const profiles = await client.profiles.listProfiles();
  const accounts = await client.accounts.listAccounts();
  // Keep identity available to the caller without logging credentials or payloads.
  void identity;
  return { profileId: profiles.data.profiles[0]?.id ?? '', accountCount: accounts.data.accounts.length };
}
cd /tmp/adeli-sdk-main && head -120 docs/client.md; echo "=== PKG ==="; cat package.json
Failed/bin/bash: line 1: cd: /tmp/adeli-sdk-main: No such file or directory
/bin/bash: line 1: cd: /tmp/adeli-sdk-main: No such file or directory
=== PKG ===
cat: package.json: No such file or directory


Command exited with code 1
Thinking…

Parallel calls: second ran before extraction? They ran concurrently. Now re-read.

cd /tmp/adeli-sdk-main && sed -n 1,140p docs/client.md
# Client and request semantics
# Client and request semantics

`@adeli/sdk` supports Node.js 22+ and the server runtimes listed in the [README](../README.md); it throws in browsers. Construct `Adeli` only in a caller-invoked server function; module import does not read environment variables or make requests.

```ts
import { Adeli } from '@adeli/sdk';
const client = new Adeli({ apiKey: process.env.ADELI_API_KEY });
```

`apiKey` wins over `ADELI_API_KEY`. `baseURL` is an origin (not an origin plus `/api/v1`); production origins must use HTTPS, while HTTP is reserved for explicit local development. `timeoutMs` is a total local deadline and `maxRetries` is opt-in. Timer values must be positive, finite, and no greater than `2_147_483_647` milliseconds (about 24.8 days); larger values are rejected before a request rather than being clamped by Node. The default retry count is zero. With opt-in retries, audited safe reads, and profile and publication creation with a stable idempotency key, qualify. Daily quota exhaustion, permission/billing/semantic conflicts, and other known non-transient failures are never retried. `listPosts` is conservatively excluded because an X read can be billed; `getXUsage` is a safe read of Adeli's stored usage ledger and does not call X itself, so it is eligible for the ordinary transient-read policy.

### Rotating keys with a resolver

`apiKey` also accepts a function, typed `ApiKeyResolver` (`() => string | Promise<string>`), for keys that come from a secret store or rotate:

```ts
import { Adeli, type ApiKeyResolver } from '@adeli/sdk';
const apiKey: ApiKeyResolver = async () => (await secrets.get('adeli-api-key')).value;
const client = new Adeli({ apiKey });
```

The SDK calls the resolver before every request attempt, retries included, and never caches the result, so a rotated key is used on the next attempt. Cache inside the resolver if your secret store is slow or rate-limited. A static string is validated when the client is constructed; a resolver is not called then, and each value it returns is validated before it is sent. An empty or blank string, a non-string, or a value that isn't a valid HTTP header throws `ConfigurationError` without echoing the value. A resolver that throws or rejects surfaces as `ConfigurationError` with the original error as `cause`. Neither is retried. The resolver runs inside the request's `timeoutMs` deadline and honours its `signal`. The value sent on an attempt is redacted from that attempt's error messages and details, and neither the resolver nor a key appears in a serialized client.

## Runtimes

The root entry needs only `fetch` and loads no Node builtin at import, so it runs on Node.js 22+, Vercel functions, and Cloudflare Workers. In a Worker without `nodejs_compat`, pass `apiKey` explicitly. The subpaths have narrower requirements:

- `@adeli/sdk/helpers`: `verifyWebhookSignature` uses `node:crypto`, available on Node.js and on Workers with `nodejs_compat`. On Vercel, serve webhook routes from the default Node.js runtime, not `runtime = 'edge'`.
- `@adeli/sdk/uploads`: `fileFromPath` and `blobFromPath` read a local file and work on Node.js only; they load `node:fs` when called, not at import. Passing any other `Blob` or `File` as post media works everywhere.

## Requests and responses

Resource methods use named `{ path, query, body }` arguments. Paths and query values are encoded by the transport. The SDK preserves the wire body: provider-specific casing such as `contentType` and `content_type`, `null`, privacy/visibility, warnings, and partial records remain unchanged. Every successful call returns `{ data, status, headers }`; `202`, `207`, and `204` are valid success statuses (`204` has `data: undefined`). Collection `status: partial` is still a successful response and contains usable records plus per-account errors.

Most operations require a profile or connected account scope. Organization-wide account listing is distinct from profile-scoped listing. Permissions/capabilities can be partial or nullable; inspect `missingPermissions`, `missingResources`, `capabilities`, and reconnect guidance rather than assuming a connected account can perform every operation. Public connection starts the typed flow but does not replace Facebook or Meta Ads Page selection or WhatsApp dashboard Embedded Signup. `client.ads` operations take a Meta Ads account (`platform: 'meta_ads'`), which is connected separately from the profile's Facebook account; a Facebook `accountId` returns `account_not_found`.

## Polling and comment iteration

Polling helpers are explicit bounded workflows: pass both a positive `intervalMs` and positive total `timeoutMs` (each no greater than `2_147_483_647` milliseconds), and optionally an `AbortSignal`. `waitForConnection`, `waitForInstagramPost`, `waitForTikTokPost`, `waitForFacebookPost`, `waitForYouTubeVideo`, and `waitForPublication` return the terminal API response, including provider failure states; they throw only for local timeout, cancellation, or an unfamiliar provider status. Facebook video `READY`/`ERROR` is separate from a connection's `pending_page_selection` dashboard handoff.

```ts
import { waitForYouTubeVideo } from '@adeli/sdk/helpers';

const status = await waitForYouTubeVideo(
  client,
  { query: { accountId, videoId } },
  { intervalMs: 2_000, timeoutMs: 300_000, signal },
);
if (status.data.status === 'failed') throw new Error(status.data.failureReason ?? 'YouTube processing failed');
```

`iterateCommentPages` and `iterateComments` support TikTok and YouTube only. They accept `maxPages` (default `100`, always finite), optional total `timeoutMs` no greater than `2_147_483_647` milliseconds, and optional `signal`; they stop on no cursor, an empty/repeated cursor, or the page limit.

```ts
import { iterateCommentPages } from '@adeli/sdk/helpers';

for await (const page of iterateCommentPages(
  client,
  { query: { platform: 'youtube', accountId } },
  { maxPages: 100, timeoutMs: 60_000, signal },
)) {
  for (const comment of page.data.comments) console.log(comment.id);
  // page.data.complete/syncedAt describe cache freshness, not pagination.
}
```

The iterator pins the first authoritative `postId` when the initial query omitted one and preserves page cache metadata such as `complete`/`syncedAt`; that metadata describes freshness/completeness of the returned page, not whether `nextCursor` exists.

`iterateConversationPages` and `iterateConversation` read one direct-message conversation: `accountId` and a message's `conversationKey` are required, and `limit` (1–100, default 50) and a starting `cursor` are optional. Pages come newest first, following `nextCursor` toward older messages; within a page messages are oldest first, as the API returns them, while `iterateConversation` yields each message newest first. They take the same `maxPages`, `timeoutMs`, and `signal` options and stop on a null, empty, or repeated cursor, or the page limit. A page whose messages belong to another account or conversation throws `MalformedResponseError`.

```ts
import { iterateConversation } from '@adeli/sdk/helpers';

const recent = [];
for await (const message of iterateConversation(client, { query: { accountId, conversationKey } }, { maxPages: 2 })) recent.push(message);
```

## Deadlines, cancellation, and errors

Pass an `AbortSignal` and/or per-call `timeoutMs` in the second argument. Cancellation stops this client request; it cannot undo work already accepted by Adeli. Polling helpers have a separate total deadline and never fetch a returned OAuth/status URL directly. Treat an aborted write as an ambiguous remote outcome and inspect the provider before resubmitting.

Catch `AdeliApiError` for an HTTP/API response. Its `status`, `code`, `details`, and `headers` are preserved; subclasses include `AuthenticationError`, `ValidationError`, `PermissionRequiredError`, and `RateLimitError`. `ConfigurationError`, `NetworkError`, `TimeoutError`, `CancellationError`, and `MalformedResponseError` represent local/client failures. Do not log API keys, OAuth URLs, media, message bodies, or provider payloads by default.

Error `details` remain `unknown`: validation arrays and provider-specific objects are not interchangeable. Use the exported `isPermissionRequiredDetails(error.details)` guard before reading known permission fields. It accepts sparse reconnect guidance, validates known fields, and leaves unknown extensions untouched. A false result does not invalidate the API error. Even recognized `reconnect.href` values are advisory data, not URLs the SDK will automatically fetch; restart authorization through the typed connection methods with explicit scope.

## Scope and safety

Profile and publication creation accept an optional idempotency key. Ad-account and campaign creation require keys and do not auto-retry. `createPost` has no idempotency guarantee; use `createPublication` with a key when a publish must be safe to repeat. The X usage response is a stored Adeli ledger: `totalCostMicros` and each `operations[].costMicros` are millionths of a US dollar. Preserve these integer values precisely; the SDK does not implicitly convert or round them to dollars. Actual X post/analytics provider calls can incur charges; Ads and destructive calls require separate approval and cleanup planning. The SDK does not claim to enforce every evolving provider-side semantic rule; the API remains authoritative.

## Ads on Meta and TikTok

`client.ads` serves Meta Ads, TikTok Ads and LinkedIn Ads. Pass the ads connection's `accountId` (a Meta Ads, `tiktok_ads` or `linkedin_ads` account); with only `profileId`, a profile holding more than one network answers `400 ambiguous_account` unless the query also names `platform`. Each response reports its `platform`. TikTok advertiser ids are digits only, and TikTok ad groups arrive under the tree's `adSets`. `createCampaign` takes a Meta body (with `objective`: a full campaign with budget, schedule, bid, targeting and a new image, video or carousel creative, or a boosted Page or Instagram post, optionally inside an existing campaign or ad set, and `validateOnly: true` for a dry run; without `objective`: a Page-post boost) or the TikTok body (video creative, targeting, identity); every Meta object is created paused, TikTok objects are created disabled, and `setAdStatus` needs `level` for TikTok. On Meta, `updateAdGroup` changes an ad set's name, budget, bid, dates or targeting, `updateCampaign` a campaign's name, CBO budget, bid strategy or spend cap, `deleteAdGroup` and `deleteAd` delete one ad set or ad, `listAdTargeting` searches interests, behaviors, demographics, locations and languages, `estimateAdReach` sizes an audience, `listAdInstagramAccounts` lists the Instagram accounts an ad can run as, and `getAdInsights` takes `breakdown`, `attributionWindows` and `resultActionType` and returns actions, values, ROAS and cost per result. `listAdIdentities` and `createAdIdentity` are TikTok-only; Meta-only operations on a TikTok account, and the reverse, answer `400 unsupported_for_platform`. On LinkedIn, `campaigns` are campaign groups, `adSets` are campaigns and `ads` are creatives; `createCampaign` takes the LinkedIn body (a `postUrn` by the ad account's Page, goal, budget, targeting URNs, `politicalIntent: 'NOT_POLITICAL'`) and creates every object as a draft; `setAdStatus` needs `level`, and activating the campaign group activates its campaign and ad; `getAdInsights` takes a professional-demographic `breakdown`; `updateAdGroup` and `listAdTargeting` work for LinkedIn too. A member whose role on the ad account is Viewer gets `403 ad_account_read_only` on writes.

## Publish to several accounts

`client.publications.createPublication` publishes one post to up to 20 connected accounts. Shared `content` and `media` go to every target in `platforms`. A target's own `content`, `media`, and `options` (that platform's `createPost` fields, such as TikTok's `music_usage_confirmed` or YouTube's `privacy_status`) override them. Adeli validates every target as `createPost` would before anything is written, so one invalid target rejects the whole request with `400`. The `202` response is the publication, which then publishes in the background.

```ts
import { waitForPublication } from '@adeli/sdk/helpers';
import { fileFromPath } from '@adeli/sdk/uploads';

const created = await client.publications.createPublication({ body: {
  content: 'Launch day',
  media: [await fileFromPath('./launch.mp4', { contentType: 'video/mp4' })],
  platforms: [
    { platform: 'instagram', accountId: instagramId, kind: 'reel' },
    { platform: 'tiktok', accountId: tiktokId, options: { music_usage_confirmed: true } },
    { platform: 'youtube', accountId: youtubeId, options: { privacy_status: 'private', made_for_kids: false } },
  ],
} }, { idempotencyKey: launchId });

const done = await waitForPublication(
  client,
  { path: { publicationId: created.data.id } },
  { intervalMs: 3_000, timeoutMs: 600_000, onProgress: (p) => console.log(p.progress) },
);
if (done.data.status !== 'published') await client.publications.retryPublication({ path: { publicationId: done.data.id } });
```

A publication is `queued` or `processing` until it is `published` (every target succeeded), `partial`, or `failed`. `waitForPublication` returns that terminal response rather than throwing, and calls `onProgress` with every snapshot. Each target reports its own `status`, `attempts`, `result` (that platform's `createPost` response), and `error`. A target in `outcome_unknown` may already be live, so `retryPublication` never re-runs it. `retryPublication` re-runs only `failed` targets and answers `409` while the publication is running or when nothing failed. Stopping a wait does not stop the publication.

A shared `Blob`/`File` is uploaded once, with `createMediaUploads({ platforms })` naming every platform that uses it. A file in a target's own `media` or `options` is uploaded for that platform only. With an `idempotencyKey`, the same key and body return the original publication with `200`, and a different body answers `409 idempotency_conflict`. Files are uploaded again on every call, so a repeated file-backed create produces a different body. To repeat one safely, stage the files yourself with `createMediaUploads` and pass their `upload_id`s.

### Scheduling and drafts

```ts
const scheduled = await client.publications.createPublication({ body: {
  content: 'Launch day',
  platforms: [{ platform: 'instagram', accountId: instagramId, media: [{ upload_id: stagedImageId }] }],
  scheduledFor: '2026-11-13T07:30:00-05:00',
  timeZone: 'America/New_York',
} });

const upcoming = await client.publications.listPublications({ query: { status: 'scheduled', profileId } });
await client.publications.updatePublication({ path: { publicationId: scheduled.data.id }, body: { scheduledFor: '2026-11-14T08:00:00-05:00' } });
await client.publications.publishPublication({ path: { publicationId: scheduled.data.id } });
```

With `scheduledFor` (ISO 8601 with an offset, one minute to 365 days ahead) a publication is stored as `scheduled` and answered with `201`; Adeli publishes it within about a minute of that time. `draft: true` stores it as a `draft` instead. `listPublications` lists a profile's publications, soonest first for `status: 'scheduled'`, with `nextCursor` for the next page. `updatePublication` reschedules (a draft becomes scheduled) or replaces the post, `publishPublication` starts it now, and `cancelPublication` cancels it (`canceled`); all three answer `409` once it has started. None of them is retried automatically. Staged media is kept until the publication is published or canceled; `{ url }` media is fetched at publish time. `listPosts` lists each scheduled post first with `status: 'scheduled'` and `scheduledFor`. `waitForPublication` keeps waiting through `scheduled` and `draft`, and stops on `canceled`.

cd /tmp/adeli-sdk-main && cat package.json && ls src src/core && grep -n "getMe\|baseUrl\|ADELI_API_KEY\|throw" src/client.ts | head -40
{
{
  "name": "@adeli/sdk",
  "version": "0.7.0",
  "description": "Official TypeScript SDK for Adeli, the unified social media and ads API",
  "keywords": [
    "adeli",
    "sdk",
    "social-media",
    "instagram",
    "tiktok",
    "youtube",
    "facebook",
    "x",
    "twitter",
    "bluesky",
    "meta-ads",
    "tiktok-ads",
    "publishing",
    "typescript"
  ],
  "homepage": "https://github.com/kingscrosslabs/adeli-sdk#readme",
  "bugs": {
    "url": "https://github.com/kingscrosslabs/adeli-sdk/issues"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/kingscrosslabs/adeli-sdk.git"
  },
  "license": "MIT",
  "type": "module",
  "engines": {
    "node": ">=22"
  },
  "exports": {
    ".": {
      "import": {
        "types": "./dist/index.d.ts",
        "default": "./dist/index.js"
      },
      "require": {
        "types": "./dist/index.d.cts",
        "default": "./dist/index.cjs"
      }
    },
    "./helpers": {
      "import": {
        "types": "./dist/helpers/index.d.ts",
        "default": "./dist/helpers/index.js"
      },
      "require": {
        "types": "./dist/helpers/index.d.cts",
        "default": "./dist/helpers/index.cjs"
      }
    },
    "./uploads": {
      "import": {
        "types": "./dist/uploads.d.ts",
        "default": "./dist/uploads.js"
      },
      "require": {
        "types": "./dist/uploads.d.cts",
        "default": "./dist/uploads.cjs"
      }
    }
  },
  "publishConfig": {
    "access": "public"
  },
  "files": [
    "dist",
    "openapi/*.json",
    "README.md",
    "docs/*.md"
  ],
  "sideEffects": false,
  "scripts": {
    "sync:openapi": "tsx scripts/sync-openapi.ts",
    "generate": "tsx scripts/generate.ts",
    "generate:api-reference": "tsx scripts/generate-api-reference.ts",
    "check:api-reference": "tsx scripts/check-api-reference.ts",
    "check:generated": "tsx scripts/check-generated.ts && npm run check:api-reference",
    "check:contract": "tsx scripts/check-contract.ts",
    "lint": "eslint . --cache --cache-location .eslintcache",
    "typecheck": "tsc --noEmit",
    "test": "vitest run",
    "build": "tsup",
    "check:package": "npm run build && npm pack --dry-run && tsx scripts/check-package.ts",
    "test:package": "node test/package-smoke.mjs",
    "typecheck:examples": "tsx scripts/typecheck-examples.ts",
    "release:check": "tsx scripts/check-package.ts --release"
  },
  "devDependencies": {
    "@arethetypeswrong/cli": "0.18.5",
    "@changesets/cli": "3.0.3",
    "@redocly/ajv": "8.11.2",
    "@types/node": "22.20.5",
    "@typescript-eslint/eslint-plugin": "8.72.0",
    "@typescript-eslint/parser": "8.72.0",
    "eslint": "9.39.5",
    "openapi-typescript": "7.9.1",
    "publint": "0.3.25",
    "tsup": "8.5.0",
    "tsx": "4.19.4",
    "typescript": "5.8.3",
    "vitest": "5.0.5"
  }
}
src:
client.ts
core
generated
helpers
index.ts
operations.ts
resources
uploads.ts

src/core:
config.ts
duration.ts
errors.ts
generated.ts
retry.ts
transport.ts
types.ts
57:  getMe(args: { readonly query?: GetMeQuery } = {}, options: RequestOptions = {}): Promise<ApiResponse<Identity>> {
58:    return this.transport.request({ operation: operations.getMe, query: args.query, signal: options.signal, timeoutMs: options.timeoutMs });
Thinking…

Good. Now build the example in /sandbox/repo. Need node version >=22. Check node.

Also check whether an API key exists in env (probably not) — the example will be blocked at runtime without a key, but I can still write and type-check it. Let's check env vars and whether the API is reachable without a key (401). I could also test the SDK against the hosted API with a bogus key to show error handling — that's a light request, fine.

Let me check node/npm.

node -v; npm -v; env | grep -i adeli; echo "keys:none"
v22.23.4
v22.23.4
10.9.8
keys:none
timeout 20 curl -s -o /dev/null -w "%{http_code}\n" https://api.tryadeli.com/api/v1/me; timeout 20 curl -s https://www.tryadeli.com/docs/api -o /dev/null -w "%{http_code}\n"
000
000
200
Thinking…

api.tryadeli.com not resolving (000). Find actual base URL from SDK source (config.ts).

cd /tmp/adeli-sdk-main && grep -n "https\|baseURL\|DEFAULT" src/core/config.ts | head -30
7:export interface ResolvedConfig { readonly apiKey: ApiKeySource; readonly baseURL: string; /** Undefined means use the operation's default, then 60 seconds. *
7:export interface ResolvedConfig { readonly apiKey: ApiKeySource; readonly baseURL: string; /** Undefined means use the operation's default, then 60 seconds. */ readonly timeoutMs: number | undefined; readonly maxRetries: number; readonly fetch: Fetch; }
8:const DEFAULT_BASE_URL = 'https://app.tryadeli.com';
20:  const baseURL = validateBaseURL(options.baseURL ?? DEFAULT_BASE_URL);
27:  return { apiKey, baseURL, timeoutMs, maxRetries, fetch: fetchImpl };
51:  try { url = new URL(input); } catch { throw new ConfigurationError('baseURL must be an absolute URL origin'); }
52:  if (!['http:', 'https:'].includes(url.protocol)) throw new ConfigurationError('baseURL must use http or https');
53:  if (url.protocol !== 'https:' && !LOCAL_HOSTS.has(url.hostname)) throw new ConfigurationError('HTTPS is required except for local development');
54:  if (url.username || url.password || url.search || url.hash || (url.pathname !== '/' && url.pathname !== '')) throw new ConfigurationError('baseURL must be an origin without a path, query, fragment, or credentials');
Thinking…

Base URL is app.tryadeli.com. Test reachability of an endpoint without key (expect 401).

Now build example in /sandbox/repo: npm install @adeli/sdk, typescript, write src example scripts: quickstart discovery + publish, plus a README. Keep it simple — maybe one example file: examples/adeli-quickstart.ts doing read-only discovery, and optionally a post. Then typecheck with tsc --noEmit and run without key to show graceful failure.

Let's do npm init + install.

timeout 20 curl -s -o /tmp/me.json -w "%{http_code}\n" https://app.tryadeli.com/api/v1/me; head -c 300 /tmp/me.json
401
401
{"error":{"code":"unauthorized","message":"A valid Bearer API key is required"}}
cd /sandbox/repo && npm init -y >/dev/null && timeout 180 npm install @adeli/sdk 2>&1 | tail -3 && timeout 180 npm install -D typescript @types/node tsx 2>&1 | tail -3
added 1 package, and audited 2 packages in 2s
added 1 package, and audited 2 packages in 2s

found 0 vulnerabilities
added 7 packages, and audited 9 packages in 6s

found 0 vulnerabilities
Thinking…

API is reachable and returns 401 without key — good, confirms hosted product, no local stack.

Now write the example. Files:

  • package.json tweaks (type module, scripts)
  • tsconfig.json
  • src/adeli-quickstart.ts — read-only discovery: getMe, listProfiles, listAccounts
  • src/publish-post.ts — publish a text post to X (or chosen platform), guarded by env
  • .env.example
  • README.md with pricing notes

Keep simple: one quickstart file plus one publish file. Typecheck. Run quickstart without key → should throw ConfigurationError; handle gracefully with message.

Let me check the SDK types for createPost body and profiles/accounts to write correct code. Look at examples/publish-everywhere.ts and connect-account.ts.

cd /tmp/adeli-sdk-main && cat examples/publish-instagram.ts; echo ===; cat examples/partial-results.ts
import { Adeli, type CreatePostBody } from '@adeli/sdk';
import { Adeli, type CreatePostBody } from '@adeli/sdk';

export async function publishInstagramImage(input: { accountId: string; imageBase64: string }) {
  const client = new Adeli({ apiKey: process.env.ADELI_API_KEY });
  const body: CreatePostBody = {
    platform: 'instagram',
    accountId: input.accountId,
    caption: 'An explicitly requested example',
    image: { contentType: 'image/jpeg', base64: input.imageBase64 },
  };
  return client.posts.createPost({ body });
}

export async function publishInstagramReel(input: { accountId: string; videoUrl: string }) {
  const client = new Adeli({ apiKey: process.env.ADELI_API_KEY });
  const body: CreatePostBody = {
    platform: 'instagram',
    accountId: input.accountId,
    reel: { url: input.videoUrl },
    shareToFeed: true,
  };
  return client.posts.createPost({ body });
}
===
import { Adeli } from '@adeli/sdk';

/** Read a partial aggregate without hiding provider-specific failures. */
export async function listAccountsWithOutcomes() {
  const client = new Adeli({ apiKey: process.env.ADELI_API_KEY });
  const response = await client.accounts.listAccounts();
  return {
    accounts: response.data.accounts,
    errors: response.data.errors,
    partial: response.data.status === 'partial',
  };
}
cd /tmp/adeli-sdk-main && grep -n "listAccounts\|listProfiles\|Account =\|interface Profile\b" src/resources/*.ts | head -20; ls src/resources
src/resources/accounts.ts:15:export type Account = AccountSchema;
src/resources/accounts.ts:15:export type Account = AccountSchema;
src/resources/accounts.ts:20:export type AccountsAggregateResponse = OperationSuccessBody<'listAccounts'>;
src/resources/accounts.ts:22:export type RefreshAccount = RefreshAccountsResponse extends { accounts: readonly (infer A)[] } ? A : never;
src/resources/accounts.ts:28:export type ListAccountsQuery = OperationQuery<'listAccounts'>;
src/resources/accounts.ts:34:  listAccounts(args: { readonly query?: ListAccountsQuery } = {}, options: RequestOptions = {}): Promise<ApiResponse<AccountsAggregateResponse>> {
src/resources/accounts.ts:35:    return this.transport.request({ operation: operations.listAccounts, query: args.query, signal: options.signal, timeoutMs: options.timeoutMs });
src/resources/media-staging.ts:39:  const response = await transport.request<SuccessBody<'listAccounts'>>({ operation: operations.listAccounts, query: { accountId }, signal: options.signal, timeoutMs: options.timeoutMs });
src/resources/profiles.ts:21:export type ListProfilesResponse = OperationSuccessBody<'listProfiles'>;
src/resources/profiles.ts:27:  listProfiles(_args: EmptyArgs = {}, options: RequestOptions = {}): Promise<ApiResponse<ListProfilesResponse>> {
src/resources/profiles.ts:28:    return this.transport.request({ operation: operations.listProfiles, signal: options.signal, timeoutMs: options.timeoutMs });
accounts.ts
ads.ts
analytics.ts
comments.ts
media-staging.ts
messages.ts
posts.ts
profiles.ts
publications.ts
usage.ts
webhooks.ts
Thinking…

Check account schema fields (id, platform, profileId, username?) and usage resource (getXUsage) — useful for pricing/usage example. Let me inspect openapi for Account schema and usage paths.

cd /tmp/adeli-sdk-main && python3 - <<'EOF'
import json
d=json.load(open('openapi/adeli.openapi.json'))
s=d['components']['schemas']
names=[n for n in s if 'ccount' in n or 'rofile' in n]
print(names[:20])
for n in names[:4]:
    print(n, json.dumps(s[n].get('properties',{}), indent=0)[:1200])
print('USAGE PATHS', [p for p in d['paths'] if 'usage' in p])
EOF
['Profile', 'Account', 'AccountsAggregate']
['Profile', 'Account', 'AccountsAggregate']
Profile {
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
},
"externalId": {
"type": [
"string",
"null"
]
},
"metadata": {
"anyOf": [
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
{
"type": "null"
}
]
},
"isDefault": {
"type": "boolean"
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
}
}
Account {
"id": {
"type": "string",
"format": "uuid"
},
"accountId": {
"type": "string",
"format": "uuid"
},
"profileId": {
"type": "string",
"format": "uuid"
},
"platform": {
"type": "string",
"enum": [
"instagram",
"tiktok",
"tiktok_ads",
"facebook",
"meta_ads",
"whatsapp",
"youtube",
"x",
"bluesky",
"linkedin",
"linkedin_ads"
]
},
"providerId": {
"type": [
"string",
"null"
]
},
"displayName": {
"type": [
"string",
"null"
]
},
"displayIdentifier": {
"type": [
"string",
"null"
]
},
"authMethod": {
"type": "string",
"enum": [
"unified_login",
"instagram_login",
"facebook_login"
]
},
"connectionStatus": {
"type": "string",
"enum": [
"connected",
"expired",
"reconnect_required",
"pending_page_selection",
"setup_incomplete"
]
},
"grantedPermissions": {
"type": "array",
"items": {
"type": "string"
}
},
"recommendedPermissions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"label": {
"type": "string"
}
},
"required": [
"code",
"label"
]
}
},
"missingRecommendedPermissions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"label": {
"type": "string"
}
},
"required": [
"code",
"label"
]
}
},
"capabiliti
AccountsAggregate {
"status": {
"type": "string",
"enum": [
"complete",
"partial"
]
},
"accounts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"accountId": {
"type": "string",
"format": "uuid"
},
"profileId": {
"type": "string",
"format": "uuid"
},
"platform": {
"type": "string",
"enum": [
"instagram",
"tiktok",
"tiktok_ads",
"facebook",
"meta_ads",
"whatsapp",
"youtube",
"x",
"bluesky",
"linkedin",
"linkedin_ads"
]
},
"providerId": {
"type": [
"string",
"null"
]
},
"displayName": {
"type": [
"string",
"null"
]
},
"displayIdentifier": {
"type": [
"string",
"null"
]
},
"authMethod": {
"type": "string",
"enum": [
"unified_login",
"instagram_login",
"facebook_login"
]
},
"connectionStatus": {
"type": "string",
"enum": [
"connected",
"expired",
"reconnect_required",
"pending_page_selection",
"setup_incomplete"
]
},
"grantedPermissions": {
"type": "array",
"items": {
"type": "string"
}
},
"recommendedPermissions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"label": {
"type": "string"
}
},
"required": [
"code",
"label"
]
}
},
"missingRecommendedPermissions": {
"type": "array",
"items": {
"t
USAGE PATHS ['/api/v1/usage', '/api/v1/usage/x']
cd /tmp/adeli-sdk-main && cat src/resources/usage.ts | head -40
import type { ApiResponse, RequestOptions } from '../core/types.js';
import type { ApiResponse, RequestOptions } from '../core/types.js';
import type { OperationSuccessBody as SuccessBody } from '../core/generated.js';
import type { Transport } from '../core/transport.js';
import { operations } from '../operations.js';
export type XUsageResponse = SuccessBody<'getXUsage'>;
/** A profile's posts, messages and comments sent this UTC month; `limit` is null when the workspace has billing. */
export type UsageResponse = SuccessBody<'getUsage'>;

export class UsageResource {
  constructor(private readonly transport: Transport) {}
  /** This month's sends for a profile (the default profile unless `query.profileId` is given), against the free plan's limits. Past a limit, sends fail with `402 usage_limit_reached`. */
  getUsage(_args: Record<never, never> = {}, options: RequestOptions = {}): Promise<ApiResponse<UsageResponse>> {
    return this.transport.request({ operation: operations.getUsage, signal: options.signal, timeoutMs: options.timeoutMs });
  }
  getXUsage(_args: Record<never, never> = {}, options: RequestOptions = {}): Promise<ApiResponse<XUsageResponse>> {
    return this.transport.request({ operation: operations.getXUsage, signal: options.signal, timeoutMs: options.timeoutMs });
  }
}
Thinking…

Great — client.usage.getUsage() maps directly to pricing (posts/comments/messages counts vs limits), and getXUsage for X pass-through cost in micros. That's a nice example tying pricing to code.

Now write the example project in /sandbox/repo:

Files:

  • package.json (update name, type module, scripts)
  • tsconfig.json
  • .env.example
  • src/client.ts (shared client factory)
  • src/quickstart.ts (read-only: getMe, profiles, accounts, usage)
  • src/publish.ts (optional write, guarded by --i-mean-it / env var, uses createPost for x/bluesky text)
  • README.md (pricing + how to run + manageability notes)

Then typecheck and run quickstart without key to demonstrate graceful error.

Check CreatePostBody for x/bluesky text fields.

cd /tmp/adeli-sdk-main && python3 - <<'EOF'
import json
d=json.load(open('openapi/adeli.openapi.json'))
s=d['components']['schemas']
n=[k for k in s if 'CreatePost' in k]
print(n)
cp=s.get('CreatePostBody') or s.get('CreatePostRequest')
print(json.dumps(cp,indent=1)[:3000])
EOF
[]
[]
null
cd /tmp/adeli-sdk-main && python3 - <<'EOF'
import json
d=json.load(open('openapi/adeli.openapi.json'))
print(json.dumps(d['components']['schemas'].get('UsageResponse') or {k:v for k,v in d['components']['schemas'].items() if 'Usage' in k}, indent=1)[:2500])
print([k for k in d['components']['schemas'] if 'Usage' in k])
EOF
{}
{}
[]
Thinking…

I need to look at the request body definition for the createPost operation in the OpenAPI spec to understand what the requestBodies contain.

cd /tmp/adeli-sdk-main && python3 - <<'EOF'
import json
d=json.load(open('openapi/adeli.openapi.json'))
p=d['paths']
for path in p:
    if 'posts' in path or 'usage' in path: print(path, list(p[path].keys()))
op=p['/api/v1/posts']['post']
body=op['requestBody']['content']['application/json']['schema']
print(json.dumps(body,indent=1)[:4000])
EOF
/api/v1/posts ['get', 'post']
/api/v1/posts ['get', 'post']
/api/v1/posts/youtube ['post']
/api/v1/posts/x/{postId} ['delete']
/api/v1/posts/bluesky/{postId} ['delete']
/api/v1/posts/instagram/status ['get']
/api/v1/posts/instagram/stories ['get']
/api/v1/posts/facebook/status ['get']
/api/v1/posts/tiktok/status ['get']
/api/v1/posts/tiktok/creator-info ['get']
/api/v1/posts/youtube/status ['get']
/api/v1/usage ['get']
/api/v1/usage/x ['get']
{
 "anyOf": [
  {
   "anyOf": [
    {
     "type": "object",
     "properties": {
      "platform": {
       "type": "string",
       "const": "instagram"
      },
      "accountId": {
       "type": "string",
       "format": "uuid"
      },
      "profileId": {
       "type": "string",
       "format": "uuid"
      },
      "caption": {
       "type": "string",
       "maxLength": 2200
      },
      "collaborators": {
       "maxItems": 3,
       "type": "array",
       "items": {
        "type": "string"
       }
      },
      "isAiGenerated": {
       "type": "boolean"
      },
      "image": {
       "anyOf": [
        {
         "type": "object",
         "properties": {
          "contentType": {
           "type": "string",
           "enum": [
            "image/jpeg",
            "image/png",
            "image/webp"
           ]
          },
          "base64": {
           "type": "string",
           "minLength": 1
          },
          "altText": {
           "type": "string",
           "maxLength": 1000
          },
          "userTags": {
           "maxItems": 20,
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "username": {
              "type": "string"
             },
             "x": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
             },
             "y": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
             }
            },
            "required": [
             "username",
             "x",
             "y"
            ],
            "additionalProperties": false
           }
          }
         },
         "required": [
          "contentType",
          "base64"
         ],
         "additionalProperties": false
        },
        {
         "type": "object",
         "properties": {
          "upload_id": {
           "type": "string",
           "minLength": 1,
           "maxLength": 300
          },
          "altText": {
           "type": "string",
           "maxLength": 1000
          },
          "userTags": {
           "maxItems": 20,
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "username": {
              "type": "string"
             },
             "x": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
             },
             "y": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
             }
            },
            "required": [
             "username",
             "x",
             "y"
            ],
            "additionalProperties": false
           }
          }
         },
         "required": [
          "upload_id"
         ],
         "additionalProperties": false
        }
       ]
      }
     },
     "required": [
      "platform",
      "accountId",
      "image"
     ],
     "additionalProperties": false
    },
    {
     "type": "object",
     "properties": {
      "platform": {
       "type": "string",
       "const": "instagram"
      },
      "accountId": {
       "type": "string",
       "format": "uuid"
      },
      "profileId": {
       "type": "string",
       "format": "uuid"
      },
      "caption": {
       "type": "string",
       "maxLength": 2200
      },
      "collaborators": {
       "maxItems": 3,
       "type": "array",
       "items": {
        "type": "string"
       }
      },
      "isAiGenerated": {
       "type": "boolean"
      },
      "images": {
       "minItems": 2,
       "maxItems": 10,
       "type": "array",
       "items": {
        "anyOf": [
         {
          "type": "object",
          "properties": {
           "contentType": {
            "type": "string",
            "enum": [
             "image/jpeg",
             "image/png",
             "image/webp"
            ]
           },
          
Thinking…

Enough. Check x/bluesky text post shape and usage response quickly.

cd /tmp/adeli-sdk-main && python3 - <<'EOF'
import json
d=json.load(open('openapi/adeli.openapi.json'))
body=d['paths']['/api/v1/posts']['post']['requestBody']['content']['application/json']['schema']
def walk(node, out):
    if isinstance(node,dict):
        if node.get('properties',{}).get('platform',{}).get('const') in ('x','bluesky'):
            c=node['properties']['platform']['const']
            out.append((c, sorted(node['properties']), node.get('required')))
        for v in node.values(): walk(v,out)
    elif isinstance(node,list):
        for v in node: walk(v,out)
out=[];walk(body,out)
for c,props,req in out: print(c, props, req)
print('--- usage ---')
u=d['paths']['/api/v1/usage']['get']['responses']
print(json.dumps(u,indent=1)[:1500])
EOF
x ['accountId', 'media', 'platform', 'profileId', 'text', 'thread'] ['platform', 'accountId', 'text']
x ['accountId', 'media', 'platform', 'profileId', 'text', 'thread'] ['platform', 'accountId', 'text']
bluesky ['accountId', 'images', 'langs', 'platform', 'profileId', 'text', 'thread', 'video'] ['platform', 'accountId', 'text']
--- usage ---
{
 "200": {
  "description": "Success",
  "content": {
   "application/json": {
    "schema": {
     "type": "object",
     "properties": {
      "period": {
       "type": "string"
      },
      "resetsAt": {
       "type": "string",
       "format": "date-time",
       "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
      },
      "enforced": {
       "type": "boolean"
      },
      "posts": {
       "type": "object",
       "properties": {
        "used": {
         "type": "integer",
         "minimum": -9007199254740991,
         "maximum": 9007199254740991
        },
        "limit": {
         "anyOf": [
          {
           "type": "integer",
           "minimum": -9007199254740991,
           "maximum": 9007199254740991
          },
          {
           "type": "null"
          }
         ]
        }
       },
       "required": [
        "used",
        "limit"
       ]
      },
      "messages": {
       "type": "object",
       "properties": {
        "used": {
         "type": "integer",
         "minimum": -9007199254740991,
         "maximum": 9007199254740991
        },
        "limit": {
         "anyOf": [
          {
           "type": "integer",
           "minimum": -9007199254740991
Thinking…

I'm setting up the project structure with TypeScript configuration, environment variables, and a package.json, then creating source files for the Adeli client, a quickstart module, and a publish utility with explicit confirmation requirements before writing documentation.

File edits

1 file

Completed
Writtentsconfig.jsonView changes

/sandbox/repo/tsconfig.json

Written content · previous contents were not recorded

{
"compilerOptions": {
"target": "ES2023",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"lib": ["ES2023", "DOM"],
"types": ["node"],
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noEmit": true,
"skipLibCheck": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src"]
}

File edits

1 file

Completed
Written.env.exampleView changes

/sandbox/repo/.env.example

Written content · previous contents were not recorded

# Copy to .env (never commit .env) or export in your shell.
# Get a key at https://app.tryadeli.com
ADELI_API_KEY=
# Optional: send a real post with `npm run publish`.
# Must be the id (uuid) of a connected `x` or `bluesky` account from `npm run quickstart`.
ADELI_EXAMPLE_ACCOUNT_ID=
Thinking…

Now src/client.ts, src/quickstart.ts, src/publish.ts, src/usage.ts.

Need to check how env loading works — Node 22 supports --env-file. Use node --env-file=.env but must not fail if .env absent. Node 22.23 supports --env-file-if-exists. Use tsx? Simpler: use node --experimental-strip-types? Node 22.23 supports type stripping (--experimental-strip-types) but our code imports TS with .ts extensions... Let's just use tsx (installed) for running: tsx src/quickstart.ts. For env, load with node --env-file-if-exists=.env? tsx passes node flags? We can do NODE_OPTIONS ... simpler: in client.ts, read .env manually? Better: script uses tsx and we document export ADELI_API_KEY=.... Also try --env-file-if-exists via tsx: tsx forwards node options if given before? Actually node --env-file-if-exists=.env --import tsx src/quickstart.ts works. Let's set package scripts as:

"quickstart": "node --env-file-if-exists=.env --import tsx src/quickstart.ts"

Check tsx supports being used via --import tsx (yes, tsx docs: node --import tsx ./file.ts).

Now write client.ts.

File edits

1 file

Completed
Writtensrc/client.tsView changes

/sandbox/repo/src/client.ts

Written content · previous contents were not recorded

import { Adeli, ConfigurationError } from '@adeli/sdk';
/**
* Single place that builds the Adeli client.
*
* Only ever call this from server code (a request handler, a job, a CLI).
* The API key is a secret: keep it out of browser bundles and out of logs.
*
* Base URL defaults to https://app.tryadeli.com (the hosted API); nothing
* local needs to be running.
*/
export function createAdeli(): Adeli {
try {
return new Adeli({ apiKey: process.env.ADELI_API_KEY });
} catch (error) {
if (error instanceof ConfigurationError) {
throw new Error(
'ADELI_API_KEY is missing or invalid. Copy .env.example to .env and paste a key from https://app.tryadeli.com',
{ cause: error },
);
}
throw error;
}
}
/** Human-readable summary of any Adeli failure, without echoing secrets. */
export function describeError(error: unknown): string {
if (error instanceof Error) {
const detail = error as Error & { status?: number; code?: string };
const parts = [error.name, detail.status ? `HTTP ${detail.status}` : null, detail.code ?? null, error.message];
return parts.filter(Boolean).join(' | ');
}
return String(error);
}

File edits

1 file

Completed
Writtensrc/quickstart.tsView changes

/sandbox/repo/src/quickstart.ts

Written content · previous contents were not recorded

import { createAdeli, describeError } from './client.js';
/**
* Read-only quickstart: who am I, which profiles exist, which social accounts
* are connected, and how much of this month's allowance is used.
*
* Costs nothing: reads are never metered on Adeli's paid plans, and the free
* plan only meters posts, comments and messages you *send*.
*
* Run: npm run quickstart
*/
async function main(): Promise<void> {
const adeli = createAdeli();
const me = await adeli.getMe();
console.log(`workspace: ${JSON.stringify(me.data)}`);
const { data: profiles } = await adeli.profiles.listProfiles();
console.log(`\nprofiles (${profiles.profiles.length}):`);
for (const profile of profiles.profiles) {
console.log(` ${profile.id} ${profile.name}${profile.isDefault ? ' (default)' : ''}`);
}
const { data: accounts } = await adeli.accounts.listAccounts();
console.log(`\naccounts (${accounts.accounts.length})${accounts.status === 'partial' ? ' [partial response]' : ''}:`);
for (const account of accounts.accounts) {
console.log(
` ${account.platform.padEnd(12)} ${account.accountId} ${account.connectionStatus} ${account.displayName ?? account.displayIdentifier ?? ''}`,
);
}
for (const error of accounts.errors ?? []) {
console.warn(` account error: ${JSON.stringify(error)}`);
}
const { data: usage } = await adeli.usage.getUsage();
const meter = (label: string, bucket: { used: number; limit: number | null }): string =>
`${label}: ${bucket.used}${bucket.limit === null ? ' (unlimited)' : ` / ${bucket.limit}`}`;
console.log(`\nusage for ${usage.period}${usage.enforced ? ' (enforced)' : ' (not enforced)'}`);
console.log(` ${meter('posts', usage.posts)}`);
console.log(` ${meter('comments', usage.comments)}`);
console.log(` ${meter('messages', usage.messages)}`);
console.log(` resets at ${usage.resetsAt}`);
}
main().catch((error: unknown) => {
console.error(`quickstart failed: ${describeError(error)}`);
process.exitCode = 1;
});
Thinking…

Check getMe response shape (Identity) and usage fields names (comments?). Verify from openapi: /api/v1/me response, /api/v1/usage properties: period, resetsAt, enforced, posts, messages, comments? Earlier truncated. Also accounts aggregate has errors? Let's verify then write publish.ts.

cd /tmp/adeli-sdk-main && python3 - <<'EOF'
import json
d=json.load(open('openapi/adeli.openapi.json'))
u=d['paths']['/api/v1/usage']['get']['responses']['200']['content']['application/json']['schema']
print('usage props:', list(u['properties']), 'required', u.get('required'))
me=d['paths']['/api/v1/me']['get']['responses']['200']['content']['application/json']['schema']
print('me:', json.dumps(me)[:800])
agg=d['paths']['/api/v1/accounts']['get']['responses']['200']['content']['application/json']['schema']
print('accounts agg props:', list(agg['properties']))
EOF
usage props: ['period', 'resetsAt', 'enforced', 'posts', 'messages', 'comments'] required ['period', 'resetsAt', 'enforced', 'posts', 'messages', 'comments']
usage props: ['period', 'resetsAt', 'enforced', 'posts', 'messages', 'comments'] required ['period', 'resetsAt', 'enforced', 'posts', 'messages', 'comments']
me: {"type": "object", "properties": {"message": {"type": "string"}, "you": {"type": "object", "properties": {"name": {"type": ["string", "null"]}, "organization": {"type": ["string", "null"]}, "profile": {"type": "object", "properties": {"id": {"type": "string", "format": "uuid"}, "name": {"type": "string"}}, "required": ["id", "name"]}}, "required": ["name", "organization", "profile"]}, "apiKey": {"type": "object", "properties": {"label": {"type": ["string", "null"]}, "prefix": {"type": "string"}, "createdAt": {"type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3
accounts agg props: ['status', 'accounts', 'errors']
Thinking…

Fix quickstart's me printing: use me.data.you.name/organization and apiKey.prefix (not full key — prefix is fine).

Also errors may be nullable/optional — check its schema type. Let me just handle accounts.errors ?? [] but with exactOptionalPropertyTypes and noUncheckedIndexedAccess, if errors is required array of unknown, ?? [] fine. Check whether errors type is array.

Now write publish.ts (X/Bluesky text post, guarded by explicit env flag), and a scheduled/multi-platform publication example maybe keep it to one write example to stay simple.

Let me update quickstart me printing and write publish.ts.

cd /tmp/adeli-sdk-main && python3 - <<'EOF'
import json
d=json.load(open('openapi/adeli.openapi.json'))
agg=d['paths']['/api/v1/accounts']['get']['responses']['200']['content']['application/json']['schema']
print(json.dumps(agg['properties']['errors'])[:600], 'required:', agg.get('required'))
EOF
{"type": "array", "items": {"type": "object", "properties": {"platform": {"type": "string", "enum": ["instagram", "tiktok", "tiktok_ads", "facebook", "meta_ads"
{"type": "array", "items": {"type": "object", "properties": {"platform": {"type": "string", "enum": ["instagram", "tiktok", "tiktok_ads", "facebook", "meta_ads", "whatsapp", "youtube", "x", "bluesky", "linkedin", "linkedin_ads"]}, "accountId": {"type": "string"}, "code": {"type": "string"}, "message": {"type": "string"}, "details": {}}, "required": ["platform", "accountId", "code", "message"]}} required: ['status', 'accounts', 'errors']
Thinking…

I need to update the quickstart to display a summary of the current user and API key information, fix how errors are handled by using an empty array as the default, and format account errors to show the platform, error code, and message together. Then I'll create the publish.ts file, update package.json and README.md.

File edits

1 file

Completed
Modifiedsrc/quickstart.ts+6−3View changes

/sandbox/repo/src/quickstart.ts

Replacement excerpt

const me = await adeli.getMe();
- console.log(`workspace: ${JSON.stringify(me.data)}`);
+ console.log(
+ `identity: ${me.data.you.name ?? '(unnamed)'} @ ${me.data.you.organization ?? '(no org)'}` +
+ ` key prefix ${me.data.apiKey.prefix}`,
+ );

Replacement excerpt

- for (const error of accounts.errors ?? []) {
- console.warn(` account error: ${JSON.stringify(error)}`);
+ for (const error of accounts.errors) {
+ console.warn(` account error: ${error.platform} ${error.accountId} ${error.code}: ${error.message}`);
}
Thinking…

I'm building out the publish.ts file for text posts on X/Bluesky, which requires setting ADELI_EXAMPLE_ACCOUNT_ID and explicitly confirming the action with ADELI_SEND_REAL_POST=yes. I need to handle several error cases including PermissionRequiredError, RateLimitError, AdeliApiError with its 402 usage_limit_reached status, and TimeoutError, all while keeping exactOptionalPropertyTypes enabled so the CreatePostBody type union works correctly.

File edits

1 file

Completed
Writtensrc/publish.tsView changes

/sandbox/repo/src/publish.ts

Written content · previous contents were not recorded

import { AdeliApiError, PermissionRequiredError, RateLimitError, TimeoutError } from '@adeli/sdk';
import { createAdeli, describeError } from './client.js';
/**
* The smallest real write: one text post to a connected X or Bluesky account.
*
* This spends a metered "post" on your plan and publishes publicly, so it only
* runs when you opt in twice:
*
* ADELI_EXAMPLE_ACCOUNT_ID=<account uuid from `npm run quickstart`> \
* ADELI_SEND_REAL_POST=yes \
* npm run publish
*
* For multi-platform or scheduled sends use `adeli.publications.createPublication`
* with an `idempotencyKey` instead: `createPost` has no idempotency guarantee.
*/
async function main(): Promise<void> {
const accountId = process.env.ADELI_EXAMPLE_ACCOUNT_ID;
if (!accountId) throw new Error('set ADELI_EXAMPLE_ACCOUNT_ID to a connected x or bluesky account id');
if (process.env.ADELI_SEND_REAL_POST !== 'yes') {
console.log('dry run only. Re-run with ADELI_SEND_REAL_POST=yes to publish for real.');
console.log(`would post to account ${accountId}`);
return;
}
const adeli = createAdeli();
const platform = process.env.ADELI_EXAMPLE_PLATFORM === 'bluesky' ? 'bluesky' : 'x';
try {
const { data, status } = await adeli.posts.createPost({
body: {
platform,
accountId,
text: 'Hello from the Adeli SDK example.',
},
});
console.log(`published (${status}): ${JSON.stringify(data)}`);
// X reads and posts are billed per API request by X and passed through by
// Adeli. Costs are integer millionths of a USD; never round them early.
if (platform === 'x') {
const { data: xUsage } = await adeli.usage.getXUsage();
console.log(`x usage ledger: ${xUsage.totalCostMicros} micros total`);
}
} catch (error) {
if (error instanceof PermissionRequiredError) {
console.error('account lacks permission; reconnect it with more scope, then retry');
} else if (error instanceof RateLimitError) {
console.error('rate limited; back off before retrying');
} else if (error instanceof TimeoutError) {
console.error('timed out: the post may or may not exist. Check before sending again.');
} else if (error instanceof AdeliApiError) {
// 402 usage_limit_reached means the plan's monthly allowance is exhausted.
console.error(`api error ${error.status} ${error.code}: ${error.message}`);
} else {
console.error(describeError(error));
}
process.exitCode = 1;
}
}
main().catch((error: unknown) => {
console.error(`publish failed: ${describeError(error)}`);
process.exitCode = 1;
});
cd /tmp/adeli-sdk-main && python3 -c "
import json;d=json.load(open('openapi/adeli.openapi.json'))
print(json.dumps(d['paths']['/api/v1/usage/x']['get']['responses']['200']['content']['application/json']['schema'])[:900])
"
{"type": "object", "properties": {"from": {"type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][0
{"type": "object", "properties": {"from": {"type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}, "to": {"type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}, "ratesAsOf": {"type": "string"}, "totalCostMicros": {"type": "number"}, "operations": {"type": "array", "items": {"type": "obj
Thinking…

I need to set up the package.json scripts and README, add .env to .gitignore, then typecheck everything. For running scripts, I'm checking if Node 22.9+ supports the --env-file-if-exists flag, and if not, I'll use tsx instead.

cd /sandbox/repo && node --env-file-if-exists=.env -e "console.log('flag ok')" 2>&1 | tail -2
.env not found. Continuing without it.
.env not found. Continuing without it.
flag ok
cd /sandbox/repo && python3 - <<'EOF'
import json
p=json.load(open('package.json'))
p['name']='adeli-example'
p['version']='0.1.0'
p['private']=True
p['description']='Minimal read-only + one-post example for the Adeli hosted social media API (@adeli/sdk)'
p['type']='module'
p['scripts']={
 'quickstart':'node --env-file-if-exists=.env --import tsx src/quickstart.ts',
 'publish':'node --env-file-if-exists=.env --import tsx src/publish.ts',
 'typecheck':'tsc --noEmit'
}
p.pop('main',None); p.pop('keywords',None); p.pop('author',None)
json.dump(p,open('package.json','w'),indent=2)
open('package.json','a').write('\n')
EOF
cat package.json; grep -q '^\.env$' .gitignore || printf '\n# Secrets\n.env\n' >> .gitignore; tail -4 .gitignore
{
{
  "name": "adeli-example",
  "version": "0.1.0",
  "description": "Minimal read-only + one-post example for the Adeli hosted social media API (@adeli/sdk)",
  "scripts": {
    "quickstart": "node --env-file-if-exists=.env --import tsx src/quickstart.ts",
    "publish": "node --env-file-if-exists=.env --import tsx src/publish.ts",
    "typecheck": "tsc --noEmit"
  },
  "license": "ISC",
  "dependencies": {
    "@adeli/sdk": "^0.7.0"
  },
  "devDependencies": {
    "@types/node": "^26.6.6",
    "tsx": "^4.23.15",
    "typescript": "^7.0.2"
  },
  "private": true,
  "type": "module"
}
.dart_tool/

# Secrets
.env
Thinking…

typescript ^7.0.2? That's odd — TypeScript 7 (native port) maybe. Typecheck may behave. Run typecheck.

cd /sandbox/repo && timeout 300 npm run typecheck 2>&1 | tail -30
> adeli-example@0.1.0 typecheck

> adeli-example@0.1.0 typecheck
> tsc --noEmit

Thinking…

Typecheck passes. Now run quickstart without key to show graceful failure, and run publish dry-run path. Also test with a fake key to confirm live API reachable (401 handling).

cd /sandbox/repo && timeout 60 npm run quickstart 2>&1 | tail -5; echo "=== with bogus key ==="; ADELI_API_KEY=adeli_test_not_a_real_key timeout 60 npm run quickstart 2>&1 | tail -5
> adeli-example@0.1.0 quickstart
> adeli-example@0.1.0 quickstart
> node --env-file-if-exists=.env --import tsx src/quickstart.ts

.env not found. Continuing without it.
quickstart failed: Error | ADELI_API_KEY is missing or invalid. Copy .env.example to .env and paste a key from https://app.tryadeli.com
=== with bogus key ===
> adeli-example@0.1.0 quickstart
> node --env-file-if-exists=.env --import tsx src/quickstart.ts

.env not found. Continuing without it.
quickstart failed: AuthenticationError | HTTP 401 | unauthorized | A valid Bearer API key is required
cd /sandbox/repo && ADELI_EXAMPLE_ACCOUNT_ID=00000000-0000-0000-0000-000000000000 timeout 60 npm run publish 2>&1 | tail -4; echo "=== no id ==="; timeout 60 npm run publish 2>&1 | tail -3
.env not found. Continuing without it.

.env not found. Continuing without it.
dry run only. Re-run with ADELI_SEND_REAL_POST=yes to publish for real.
would post to account 00000000-0000-0000-0000-000000000000
=== no id ===

.env not found. Continuing without it.
publish failed: Error | set ADELI_EXAMPLE_ACCOUNT_ID to a connected x or bluesky account id
Thinking…

All working end-to-end against the hosted API (401 proves live connectivity). Blocked only on a real API key.

Write README with pricing + manageability assessment.

Also note quickstart.ts uses me.data.apiKey.prefix — verified via typecheck.

Write README.md.

File edits

1 file

Completed
WrittenREADME.mdView changes

/sandbox/repo/README.md

Written content · previous contents were not recorded

# Adeli example
Minimal TypeScript example against **Adeli** (hosted unified social media + ads API,
https://www.tryadeli.com) using the official SDK [`@adeli/sdk`](https://www.npmjs.com/package/@adeli/sdk).
Everything talks to the hosted API at `https://app.tryadeli.com`. No local services,
no docker, no tunnels.
## Files
| File | What it does | Writes? |
| --- | --- | --- |
| `src/client.ts` | Builds the `Adeli` client from `ADELI_API_KEY`; safe error rendering | no |
| `src/quickstart.ts` | `getMe` → profiles → connected accounts → this month's usage | no (reads only) |
| `src/publish.ts` | One text post to X or Bluesky, double-gated behind env vars | yes, if you opt in |
## Run it
```sh
npm install
cp .env.example .env # paste your key from https://app.tryadeli.com
npm run quickstart # read-only: profiles, accounts, usage
npm run typecheck
```
Publishing a real post (spends one metered post, is publicly visible):
```sh
ADELI_EXAMPLE_ACCOUNT_ID=<uuid from quickstart> npm run publish # dry run
ADELI_EXAMPLE_ACCOUNT_ID=<uuid> ADELI_SEND_REAL_POST=yes npm run publish
```
Without a key, `quickstart` exits 1 with a clear message; with a bad key it surfaces
the API's `401 unauthorized` through the SDK's typed `AuthenticationError`.
## How pricing works
Source: https://www.tryadeli.com/pricing (checked 2026). Plans are monthly, or annual
with ~2 months free.
| Plan | Price | Profiles | Accounts/profile | Sends |
| --- | --- | --- | --- | --- |
| Free | $0, no card | 2 | 2 | one-time 10 posts, 100 comments, 100 messages |
| Starter | $25/mo ($300/yr) | 10, then $2.50 per extra profile/mo | 5 | 10,000 posts + 10,000 comments + 10,000 messages/mo |
| Business | $125/mo ($1,500/yr) | 100, then $1.50 per extra profile/mo | all platforms | unlimited, fair use |
| Enterprise | volume | custom | custom | custom |
Rules that matter in code:
- **A profile = one of your users**; it holds the social accounts that user connects.
Extra profiles are **billed by the day** — a profile counts on each day it has at
least one connected account, so 10 active days ≈ 1/3 of a month.
- **Only sends are metered.** Posts, comments and messages you *send* count; **reads
never count** (that's why `src/quickstart.ts` is free to run). One post to 3 accounts
counts as 3 posts.
- Hitting a limit returns **`402 usage_limit_reached`** — handled in `src/publish.ts`.
- **Free-plan limits:** every platform except X, WhatsApp and Bluesky. Analytics, X,
WhatsApp and Bluesky require a paid plan.
- **X is pass-through:** X charges per API request and Adeli passes it through at X's
published rates with no markup. `adeli.usage.getXUsage()` returns that ledger;
`totalCostMicros` and `operations[].costMicros` are integer **millionths of a USD** —
keep them as integers, don't round early.
- **Check your own numbers in code:** `adeli.usage.getUsage()` returns `posts`,
`comments`, `messages` as `{ used, limit }` (`limit: null` = unlimited on a paid plan),
plus `period`, `resetsAt` and `enforced`.
- Unlimited team members on every plan.
## Is this product easy for an agent like me to manage?
**Yes, unusually so** — with one hard gate.
Easy:
- Zero-dependency SDK, types generated from the OpenAPI contract, ESM + CJS, runs on
Node 22+, Vercel functions and Cloudflare Workers. `npm install` and it works.
- Fully hosted: no local stack, no emulator, no long-running process. A read-only call
returns in about a second, so verification loops are cheap.
- Predictable API surface: every call resolves to `{ data, status, headers }`, named
`{ path, query, body }` args, and a typed error class per failure mode
(`AuthenticationError`, `ValidationError`, `PermissionRequiredError`, `RateLimitError`,
`TimeoutError`, `ConfigurationError`, `NetworkError`, `MalformedResponseError`).
- Retries are opt-in and the docs say which operations are safe to repeat; profile and
publication creation take an idempotency key, so a crash mid-publish is recoverable.
Polling helpers are bounded (`intervalMs` + `timeoutMs`) — no hanging waits.
- Partial results are explicit (`status: 'partial'` plus per-account `errors`), so
degraded states are visible instead of silently dropped.
- Good docs in-repo (`docs/client.md`, `docs/publishing.md`) and an API reference
generated from the same spec.
Friction / things to watch:
- **The blocker:** a real `ADELI_API_KEY` from `https://app.tryadeli.com` (signup, plus
OAuth-connecting actual social accounts). I can't self-serve that, so anything past
type-checking and the 401 path needs your key. Connecting accounts also requires a
human OAuth redirect and, for Facebook/Meta Ads, page selection in a dashboard.
- Writes are **public and irreversible-ish** on real accounts, and they spend metered
quota — hence the double gate in `src/publish.ts`. Ads operations spend real money and
create objects that need explicit cleanup planning.
- Platform-specific semantics leak through (TikTok `music_usage_confirmed`, YouTube
`privacy_status`/`made_for_kids`, WhatsApp template approval, provider review queues
for beta platforms). The SDK passes them faithfully; it doesn't shield you from them.
- Version 0.7.0, so expect some churn; `docs/availability.md` tracks what's production
vs beta.
Thinking…

Check "checked 2026" date claim — I don't know current date. Check env/date.

date -u +%F; cd /sandbox/repo && ls -R src && timeout 120 npm run typecheck 2>&1 | tail -3
2026-11-18
2026-11-18
src:
client.ts
publish.ts
quickstart.ts
> adeli-example@0.1.0 typecheck
> tsc --noEmit

Thinking…

Date 2026-11-18, so "checked 2026" is fine — make it precise: "(checked 2026-11-18)".

Final summary.

File edits

1 file

Completed
ModifiedREADME.md+1−1View changes

/sandbox/repo/README.md

Replacement excerpt

-Source: https://www.tryadeli.com/pricing (checked 2026).
+Source: https://www.tryadeli.com/pricing (checked 2026-11-18).
Thinking…

I think I've worked through the main points here.

Built and verified. Summary:

What Adeli is: hosted unified social media + ads API (https://app.tryadeli.com), official zero-dependency TS SDK @adeli/sdk@0.7.0. There is a real developer workflow — no local stack, no tunnels, no long-running processes needed.

Files in /sandbox/repo:

  • src/client.ts — client factory from ADELI_API_KEY, secret-safe error rendering
  • src/quickstart.ts — read-only: getMe → profiles → connected accounts → monthly usage (usage.getUsage())
  • src/publish.ts — one text post to X/Bluesky, double-gated (ADELI_EXAMPLE_ACCOUNT_ID + ADELI_SEND_REAL_POST=yes), with typed error handling incl. 402 usage_limit_reached and the X micro-dollar ledger
  • README.md, tsconfig.json, .env.example, .gitignore (+.env), npm scripts

Verified: npm install clean, npm run typecheck passes, npm run quickstart fails clearly with no key, and with a bogus key hits the live API and returns typed AuthenticationError | HTTP 401. npm run publish dry-runs correctly. Nothing long-running started.

Pricing (from tryadeli.com/pricing, 2026-11-18): Free $0 (2 profiles × 2 accounts, one-time 10 posts/100 comments/100 messages); Starter $25/mo or $300/yr (10 profiles +$2.50 each, 5 accounts/profile, 10k posts/comments/messages per month); Business $125/mo or $1,500/yr (100 profiles +$1.50 each, all platforms, unlimited under fair use); Enterprise volume. Key mechanics: only sends are metered (reads free; a post to 3 accounts = 3 posts), extra profiles billed by the day they have ≥1 connected account, free plan excludes X/WhatsApp/Bluesky, and X costs are passed through at X's published rates in integer microdollars.

Manageability: easy — fully hosted, fast read-only verification, generated types, {data,status,headers} responses, typed errors per failure mode, opt-in retries with idempotency keys, bounded polling, explicit partial results.

Blocked on one thing: a real ADELI_API_KEY (signup + human OAuth to connect actual social accounts). I can't self-serve that, so anything beyond type-checking and the 401 path needs your key.

AX Fundamentals

23 checks. Open an area for details.

This check is a quick preview. Test more tasks and models with Gauge Agents.

Test your product with Gauge Agents

AX Check by Gauge