# Generate an image with the PostEverywhere API **Source:** https://posteverywhere.ai/docs/api/generate-image --- [🤖Connect ChatGPT, Claude or any AI agent to manage your social media end to endConnect your AI agent to manage your social media](https://posteverywhere.ai/agents)POST/ai/generate-image # Generate an image with the PostEverywhere API Generates one image via FAL AI, stores it in the media library and returns a ready `media_id` for `createPost`. Credit cost depends on the model; credits are reserved atomically and refunded on failure. Free-trial organizations without a paid subscription get `402 upgrade_required`. Prompts are safety-filtered (`400 prompt_rejected`). Additional AI burst limits apply on top of the API-key limit. Error codes: `validation_error`, `prompt_rejected`, `upgrade_required`, `insufficient_credits`, `rate_limit_exceeded`, `generation_failed`, `internal_error`. Guide: [AI caption guide](https://posteverywhere.ai/docs/generate-caption) Copy MarkdownCopy for LLMThis endpoint accepts a JSON request body. See the [ai guide](https://posteverywhere.ai/docs/generate-caption) for a worked example. ## Responses - 201Image generated and stored - 400 - 401 - 402 - 403 - 429 - 500 ## More in AI - [Generate a caption](https://posteverywhere.ai/docs/api/generate-caption) [← Generate a caption](https://posteverywhere.ai/docs/api/generate-caption)[← All endpoints](https://posteverywhere.ai/docs/api/reference)