# Generate social media captions with the PostEverywhere API

**Source:** https://posteverywhere.ai/docs/api/generate-caption

---

[Works with ChatGPT, Claude and every AI agent Works with all AI agents Connect yours](https://posteverywhere.ai/agents)

POST /ai/generate-caption

# Generate social media captions with the PostEverywhere API

Generates 1-5 captions for a topic, styled per platform/tone/length. Costs 1 AI credit per caption returned; credits are reserved atomically before generation and refunded for captions that fail. `402 insufficient_credits` when the plan's monthly credit budget (plus bonus credits) cannot cover the request; `502 ai_no_content` when the model returns nothing. Unknown platform/tone/length values silently fall back to defaults. Every caption fits the platform's character limit, counted the way the platform counts (X weighted length, Bluesky graphemes): X 280, Bluesky 300, Threads 500, Pinterest 500, Google Business Profile 1500, Instagram and TikTok 2200, LinkedIn 3000, Facebook 5000, YouTube 5000 (the description). A caption the model writes too long is cut at a word break; `char_limit` gives the limit used and `trimmed_to_fit` how many captions were cut.

Guides: [AI caption guide](https://posteverywhere.ai/docs/generate-caption) · [Brand Kit API guide](https://posteverywhere.ai/docs/brand)

This endpoint accepts a JSON request body. See the [ai guide](https://posteverywhere.ai/docs/generate-caption) for a worked example.

## Responses

- 200 Captions generated
- 400
- 401
- 402
- 403
- 404
- 429
- 500
- 502 AI model returned no content (credits refunded)

## More in AI

- [Get the workspace's brand](https://posteverywhere.ai/docs/api/get-brand)
- [Generate an image](https://posteverywhere.ai/docs/api/generate-image)

[← Get the workspace's brand](https://posteverywhere.ai/docs/api/get-brand) [Generate an image →](https://posteverywhere.ai/docs/api/generate-image)

[← All endpoints](https://posteverywhere.ai/docs/api/reference)
