LinkedIn Post Studio
API

REST and MCP. One credit wallet.

Drive LinkedIn Post Studio from your own code or an AI assistant — including the Ounie AI Team. Every action is a REST endpoint and a native MCP tool, running the same generation pipeline the dashboard uses and drawing your shared Ounie credits (1 credit = 1¢), never overdrawing. Because every post is grounded and cited from your private Ounie brain, agent generation authenticates with your Ounie master key — there is no keyless / x402 rail.

Authentication · two rails
Send a bearer token on any REST endpoint or the MCP server. Cookie sessions work too — it's the same route.
lps_live_…— this app's key

Mint on Dashboard → API keys (shown once, up to 5 active). Lists, reads, exports a post, and adds an AI image. It has no upstream credential, so it can't reach your private brains — grounded generation returns a clear 403 master_key_required.

ounie_live_… — your Ounie master key

Your ounie.com developer key. Enable fleet access on ounie.com and it works across every Ounie app, drawing the same wallet. It is forwarded upstream, so it unlocks grounded, cited generation.

Authorization: Bearer ounie_live_…

# If your client can't set headers, append the key as a query param:
?api_key=ounie_live_…
MCP · for AI assistants and the Ounie AI Team
Streamable HTTP at /api/mcp (legacy SSE at /api/sse).
Endpoint  https://linkedin-posts.ounie.com/api/mcp
Header    Authorization: Bearer ounie_live_…

# Ounie AI Team (TabTab) — the key rides the URL:
https://linkedin-posts.ounie.com/api/mcp?api_key=ounie_live_…
ToolWhat it doesCost
generate_postsWrite a pack of cited LinkedIn posts from your brain(s). Master key.2 credits / post
regenerate_postRewrite one post from fresh retrieval. Master key.2 credits
generate_imageGenerate/replace an AI image for a post; returns a public URL.12 credits
list_postsList your generated posts (newest first).free
get_postOne post + copy-ready text (the export), citations, image URL.free
list_brainsList your Ounie brains to pick from. Master key.free
get_credit_balanceSpendable Ounie credits + monthly included.free
get_pricingPer-action pricing. No auth required.public
whoamiThe authenticated key's owner + key id.free
REST · the same endpoints the dashboard uses
Send Authorization: Bearer … (or ?api_key=) on any of these.
GET/api/brainsList your brains

Master key (reads ounie.com). Returns { brains:[{ id, name, sourceCount }] }.

POST/api/postsGenerate a content pack
{ "brain_ids": ["…"], "topic": "our launch", "count": 5 }

Master key. Bills 2 credits per post produced; settles on posts actually written (thin material → 422 + full refund). Returns { batch_id, post_ids, grounded, credits_spent }.

GET/api/postsList your posts

Free. Returns { posts:[…] }.

GET/api/posts/{id}Get one post

Free. Includes hook, body, hashtags, char_count, citations, image_url.

PATCH/api/posts/{id}Edit a post
{ "hook": "…", "body": "…", "hashtags": ["growth"] }

Free.

POST/api/posts/{id}/regenerateRewrite a post
{ "topic": "optional new angle" }

Master key. Re-bills 2 credits (thin → refund).

POST/api/posts/{id}/imageAdd an AI image

Bills 12 credits; a failure refunds fully. Returns a public image_url.

DELETE/api/posts/{id}Delete a post

Free. Also removes its stored image.

Why there's no keyless / x402 rail
Every post is generated only from your own private Ounie brain and cited back to your source pages — it publishes under your name, so it never fabricates. That means generation is inherently account-scoped: agent access is API keys / MCP drawing your Ounie credits, authenticated with your Ounie master key for anything that reads a brain. A pay-per-call stranger has no brain to ground in, so there is no x402 endpoint.
Shape of a generated post
{
  "id": "…",
  "format": "story|how_to|listicle|contrarian|lesson|question",
  "hook": "The scroll-stopping first line.",
  "body": "The post body, LinkedIn-native line breaks.",
  "hashtags": ["leadership", "growth"],
  "text": "hook\n\nbody\n\n#leadership #growth",  // copy-ready export
  "citations": [                 // grounded on your brain pages
    { "brainId": "…", "slug": "…", "title": "…", "url": "https://ounie.com/…" }
  ],
  "grounded": true,
  "image_url": null,
  "credits_spent": 2
}