API
Three on-ramps. One credit wallet.
Ounie accounts hit the REST endpoints with a bearer token. AI assistants — including the Ounie AI Team — connect over MCP and get a native tool surface. One-off scripts can skip the account and pay per call in USDC via x402. All three run the same generation and posting pipeline, and account calls draw your shared Ounie credits (1 credit = 1¢), never overdrawing.
MCP · for AI assistants and the Ounie AI Team
Streamable HTTP at
/api/mcp (legacy SSE at /api/sse). Auth with a soc_live_… key from your dashboard, or the Ounie fleet master key ounie_live_….Endpoint https://social.ounie.com/api/mcp Header Authorization: Bearer soc_live_… # If your MCP client can't set headers, append the key as a query param: https://social.ounie.com/api/mcp?api_key=soc_live_…
| Tool | What it does | Cost |
|---|---|---|
| generate_copy | Write one AI social caption + hashtags for a topic. | 2 credits |
| generate_image | Generate an AI image; returns a public URL + media_id. | 12 credits |
| generate_video | Start an ~8s vertical AI clip (async; poll get_media_status). | 360 credits (reserved) |
| get_media_status | Poll a media asset; settles/refunds a finished video. | free |
| list_accounts | List connected social accounts (Instagram, X, LinkedIn, …). | free |
| create_post | Compose a draft and optionally publish/schedule it. | 1 credit to publish/schedule |
| list_posts | List your posts (optionally by status). | free |
| get_credit_balance | Spendable Ounie credits + monthly included. | free |
| get_pricing | Per-action pricing + x402 endpoints. No auth required. | public |
| whoami | The authenticated key's owner + key id. | free |
REST · the same endpoints the dashboard uses
Send
Authorization: Bearer soc_live_… (or ?api_key=) on any of these. Cookie sessions work too — it's the same route.POST
/api/generate— AI copy{ "topic": "our launch", "tone": "punchy", "platforms": ["twitter"] }Bills 2 credits. Grounded + cited from your brains with a cookie session OR the Ounie master key (ounie_live_); a per-app soc_live_ key is style-only.
POST
/api/media— AI image or video{ "kind": "image", "brief": "abstract launch hero" }Image bills 12; video reserves 360 (async — poll GET /api/media/{id}).
GET
/api/accounts— Connected accountsLive from the posting provider. Free.
POST
/api/posts— Create a draft{ "content": "…", "account_ids": ["…"], "media": [] }Free. Returns { id }.
POST
/api/posts/{id}/submit— Publish or schedule{ "mode": "now" }Bills 1 credit. mode = now | schedule | queue.
x402 · keyless pay-per-call in USDC
No account, no credits. POST returns
402 with payment terms; sign and retry with an X-Payment header. The USDC is the payment.POST https://social.ounie.com/api/x402/generate
{ "topic": "our new feature", "tone": "punchy" }
# → 402 { x402Version, accepts:[{ maxAmountRequired, payTo, asset, … }] }
# retry with header: X-Payment: <signed payload>
# → 200 { ok, payment, content, hashtags }
POST https://social.ounie.com/api/x402/image
{ "brief": "abstract launch hero" }
# → 200 { ok, payment, url }Shape of a generated caption
{
"content": "The caption text, ready to post.",
"hashtags": ["launch", "ai"],
"citations": [ // only when grounded on your brains
{ "brainId": "…", "slug": "…", "title": "…", "url": "https://ounie.com/…" }
],
"grounded": false,
"credits_spent": 2
}