🎉 Black Friday: 30% off your first payment — ends Monday, Nov 30Claim 30% off
Docs
/v1/generations · Generations

Generations API

Generate posts with the same engine as the XBeast app. Generation saves a history post, so nothing is scheduled or published until you call the posts endpoints. Every call consumes credits.

Generate text

POST/api/v1/generations/text

Body

FieldTypeRequiredDescription
typestringYesai, search, youtube, x, x-news, link, list or article.
formatstringNotweet, thread, long, article or same (same only for type x). Default tweet.
promptstringsee noteRequired for ai, search, list and article.
style_idstringNoOwned or community writing style.
account_idstringsee noteRequired for x-news; used for voice and media otherwise.
media_typestringNooff, images, videos, mixed or ai. Default off.
video_urlstringsee noteYouTube URL for type youtube.
tweet_urlstringsee noteX post URL for type x.
news_querystringsee noteSearch query for type x-news.
link_urlstringsee noteWeb page URL for type link.
ai_image_modelstringNoAI image model id.
ai_image_aspect_ratiostringNoe.g. 1:1, 3:2, 2:3.
Generate a thread from a topic
curl -X POST "https://xbeast.io/api/v1/generations/text" \
  -H "Authorization: Bearer xb_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "ai",
    "format": "thread",
    "prompt": "5 lessons from shipping a micro-SaaS",
    "media_type": "off"
  }'
Response: { data: { post, tweets, article_title, credits_used } }. Use post.id with POST /api/v1/posts/:id/queue or PATCH /api/v1/posts/:id to schedule it.

Beast Mode

POST/api/v1/generations/beast-mode
One tweet built from the account's profile and recent history. Body: account_id (required) and optional prompt. Costs 1 credit.

Chat-edit tweets

POST/api/v1/generations/chat

Body

FieldTypeRequiredDescription
tweetsarrayYesCurrent { text, media_url? } tweets.
messagestringYesInstruction, e.g. “shorten and add a hook”.
conversation_historyarrayNoPrevious user/assistant messages.
post_idstringNoOwned post to update when save is true.
savebooleanNoPersist the edited tweets into post_id.
Returns the assistant response, annotations, edited tweets, media results and credits_used. Sent posts cannot be edited.

Credits

  • Text generation costs 1–10 credits depending on the source, format and media.
  • Beast Mode costs 1 credit.
  • Chat editing costs at least 1 credit, plus extra for edits and media.
  • GET /api/v1/workspace shows available credits and the reset date.

Related