---
title: "Write a native post per network, without publishing"
method: POST
path: "/api/generate"
---

# Write a native post per network, without publishing

`POST /api/generate`

## Request

- Base URL: `https://postwire.io`
- URL: `https://postwire.io/api/generate`
- Auth: HTTP bearer

Returns one draft per requested network. Feed `drafts` straight back into /api/post as `per_platform` to publish exactly what was written. A draft may carry thread (X, Bluesky, Mastodon: when the idea asks for a thread; Bluesky and Mastodon also when it is too long for one post) and first_comment (LinkedIn, X, Bluesky, Mastodon: the idea's link, out of the body). platforms may be an array or a comma-separated string ("tiktok, instagram"); the idea may be sent as prompt, idea, text or topic. With no platforms, the account's connected networks are used. 400 codes: prompt_required, platforms_required, unknown_platform; 502 ai_failed when the writer fails. When the idea asks for a thread ("write a thread about…") and x is one of the networks, the X draft also has thread: ["…"] (the posts after text), ready for per_platform.x.thread; otherwise X gets one post. Same single AI call either way.

## Request body

- GenerateRequest
  - `prompt` string, required: The idea to communicate.
  - `platforms` string[], required
  - `media_url` string, uri
  - `brand_voice` string

## Response `200`

{ drafts: { <platform>: { text } } }

- object
  - `drafts` object

## Other responses

- `400`: prompt or platforms[] missing
- `429`: ai_daily_limit (the plan's AI drafts a day) or ai_month_limit (the month's AI drafts and any AI credits used up; with buy_ai_credits links and the plan above)
- `503`: AI not configured

---

[API](https://skmtc.dev/postwire/apis/postwire-api.md) · [All operations](https://skmtc.dev/postwire/apis/postwire-api/llms.txt) · [OpenAPI document](https://skmtc.dev/postwire/apis/postwire-api/revisions/513a409ab8f7?raw)
