PostEverywhere AI API

Generate platform-tuned social media captions and AI images from the API, using your organization's AI credit allowance.

GitHub OpenAPI

Operations 3

GET /brand Get the workspace's brand #
POST /ai/generate-caption Generate social media captions with AI #
POST /ai/generate-image Generate an image with AI and store it in the media library #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/posteverywhere-ai:posteverywhere-ai-ai-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

posteverywhere-ai-ai-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PostEverywhere API Reference AI API
  version: 1.0.1
  description: 'Public v1 API for PostEverywhere: schedule and publish content across

    13 platforms: X (Twitter), Google Business Profile, Instagram, Facebook, LinkedIn, YouTube,

    TikTok, Threads, Pinterest, Bluesky, Telegram, Discord and WordPress.


    New here? Start with the Quick Start (first post in 5

    minutes) and Authentication. Platform-specific

    behavior lives in the Platform Guides, and

    media constraints in Media Requirements.


    ## Authentication

    All endpoints (except the device-login pair under `/auth/device`) accept an

    API key in the `Authorization` header:


    ```

    Authorization: Bearer pe_live_...

    ```


    Keys are created in the dashboard (Developers) or minted by the CLI device

    flow (`POST /auth/device` → `POST /auth/device/token`). Keys carry scopes

    (`read`, `write`, `ai`); each operation''s required scope is noted via

    `x-scope`. A missing scope returns `403 insufficient_scope`. A browser

    session cookie also works as a fallback for interactive testing; scopes are

    then implicitly `read, write, ai` and API-key rate limits are skipped.


    Auth failures return `401` with codes `invalid_api_key`, `api_key_revoked`,

    or `api_key_expired`. Organizations without an active subscription receive

    `402 subscription_required` (the error object additionally carries

    `subscription_status`).


    ## Response envelope

    Every endpoint responds with the same JSON envelope: a `data` object, an

    `error` object and a `meta` object (`meta.request_id`, an 8-character

    correlation id, and `meta.timestamp`, ISO 8601). On success `error` is

    `null`. On failure `data` is `null` and `error` carries `message`, `code`

    (for example `validation_error`), `retryable` and an optional `details`

    object.


    `error.retryable` is `true` for transient failures (HTTP 5xx and 429) and

    `false` for permanent ones; clients should not blindly retry 4xx.

    Exception: the auth layer''s own 401/402 responses omit `retryable` and

    `meta.request_id` (they carry only `meta.timestamp`).


    ## Rate limiting

    API keys are limited to 60 requests/minute and 1,000 requests/hour.

    When the API-key limit is hit the `429` response includes

    `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`

    (unix seconds) headers. Every `429` (including posting-budget and

    AI-budget limits, which are separate from the API-key limit) includes a

    `Retry-After` header (seconds, default 30).


    Posting budgets (per user): immediate publishes 60/min, 200/hour,

    1,000/day; scheduled posts 100/min, 1,000/hour with no daily cap.

    Media uploads: 500/hour, 2,500/day, counted when an upload finishes

    (`/media/ID/complete`, a direct upload, or `/media/upload-from-url`),

    not at presign.


    X: scheduled posts are limited to 100 a day per organisation. A post over

    the limit is held and sent when the window reopens; it is not failed.

    During a free trial each X account can post 15 times a day.


    ## Timestamps

    All timestamps are ISO 8601. `scheduled_for` request values without an

    explicit offset are interpreted as UTC. The `timezone` field is display

    metadata only. It never changes when a post fires.'
  contact:
    name: PostEverywhere Developers
    url: https://posteverywhere.ai/docs
servers:
- url: https://app.posteverywhere.ai/api/v1
  description: Production
security:
- apiKey: []
tags:
- name: AI
  description: Generate platform-tuned social media captions and AI images from the API, using your organization's AI credit allowance.
paths:
  /brand:
    get:
      operationId: getBrand
      x-scope: read
      tags:
      - AI
      summary: Get the workspace's brand
      description: 'The workspace''s Brand Kit (app.posteverywhere.ai/brand), built

        from the business website: what the business does, products, audience,

        voice, language, rules (each with always_applied), banned words,

        required hashtags, colours and fonts. `brand` is null when none is set

        up. `/ai/generate-caption` writes in this brand automatically.

        Scoped to the key''s workspace.'
      responses:
        '200':
          description: The brand (or null)
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      brand:
                        type: object
                        nullable: true
                        properties:
                          id:
                            type: string
                          name:
                            type: string
                          about:
                            type: string
                            nullable: true
                          industry:
                            type: string
                            nullable: true
                          website:
                            type: string
                            nullable: true
                          products:
                            type: array
                            items:
                              type: string
                          audience:
                            type: string
                            nullable: true
                          voice:
                            type: string
                            nullable: true
                          voice_traits:
                            type: array
                            items:
                              type: string
                          voice_example:
                            type: string
                            nullable: true
                          language:
                            type: string
                            nullable: true
                          language_name:
                            type: string
                            nullable: true
                          facts:
                            type: array
                            items:
                              type: string
                          post_ideas:
                            type: array
                            items:
                              type: string
                          rules:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                rule:
                                  type: string
                                always_applied:
                                  type: boolean
                          banned_words:
                            type: array
                            items:
                              type: string
                          required_hashtags:
                            type: array
                            items:
                              type: string
                          colors:
                            type: array
                            items:
                              type: string
                          fonts:
                            type: object
                            properties:
                              heading:
                                type: string
                                nullable: true
                              body:
                                type: string
                                nullable: true
                          has_logo:
                            type: boolean
                      brands:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                            is_default:
                              type: boolean
                      message:
                        type: string
        '401':
          description: Missing or invalid API key
  /ai/generate-caption:
    post:
      operationId: generateCaption
      x-scope: ai
      tags:
      - AI
      summary: Generate social media captions with AI
      description: '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.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - topic
              properties:
                topic:
                  type: string
                  maxLength: 1000
                brand_id:
                  type: string
                  description: 'Which brand to write in: omitted or "default" = the workspace''s Brand Kit (if any), "none" = no brand, or a brand id from GET /v1/brand. Unknown id = 404.

                    '
                platform:
                  type: string
                  enum:
                  - instagram
                  - facebook
                  - x
                  - twitter
                  - linkedin
                  - youtube
                  - tiktok
                  - threads
                  - pinterest
                  - bluesky
                  - wordpress
                  - google_business
                  description: Sets character limit and style. Omit for generic.
                tone:
                  type: string
                  enum:
                  - professional
                  - casual
                  - witty
                  - enthusiastic
                  - urgent
                  - inspirational
                  default: professional
                length:
                  type: string
                  enum:
                  - short
                  - medium
                  - long
                  default: medium
                include_hashtags:
                  type: boolean
                  default: true
                include_emojis:
                  type: boolean
                  default: true
                count:
                  type: integer
                  minimum: 1
                  maximum: 5
                  default: 1
            example:
              topic: Announcing our summer sale, 30% off all plans
              platform: instagram
              tone: enthusiastic
              count: 2
      responses:
        '200':
          description: Captions generated
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                - error
                - meta
                properties:
                  data:
                    type: object
                    required:
                    - captions
                    - credits_used
                    - credits_remaining
                    properties:
                      captions:
                        type: array
                        items:
                          type: string
                      platform:
                        type:
                        - string
                        - 'null'
                      tone:
                        type: string
                      length:
                        type: string
                      count_requested:
                        type: integer
                      count_returned:
                        type: integer
                      credits_used:
                        type: integer
                      credits_remaining:
                        type: integer
                  error:
                    type: 'null'
                  meta:
                    $ref: '#/components/schemas/Meta'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
        '502':
          description: AI model returned no content (credits refunded)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
  /ai/generate-image:
    post:
      operationId: generateImage
      x-scope: ai
      tags:
      - AI
      summary: Generate an image with AI and store it in the media library
      description: '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`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - prompt
              properties:
                add_logo:
                  type: boolean
                  default: false
                  description: 'Stamp the Brand Kit''s real logo onto the finished image (exact, not redrawn by the model). Uses brand_id, else the workspace''s default Brand Kit. Ignored when the Brand Kit has no logo; the response''s logo_added says whether it was added.

                    '
                logo_corner:
                  type: string
                  enum:
                  - bottom-right
                  - bottom-left
                  - top-right
                  - top-left
                  default: bottom-right
                prompt:
                  type: string
                  maxLength: 2000
                aspect_ratio:
                  type: string
                  enum:
                  - '1:1'
                  - '16:9'
                  - '9:16'
                  - '4:3'
                  - '3:4'
                  - '4:5'
                  - '5:4'
                  default: '1:1'
                model:
                  type: string
                  enum:
                  - nano-banana-pro
                  - ideogram-v2
                  - gemini-3-pro
                  - flux-schnell
                  default: gemini-3-pro
                brand_id:
                  type: string
                  description: Optional brand to apply (prefixes brand context to the prompt)
            example:
              prompt: Flat-lay photo of a summer picnic with lemonade, bright pastel palette
              aspect_ratio: '4:5'
      responses:
        '201':
          description: Image generated and stored
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                - error
                - meta
                properties:
                  data:
                    $ref: '#/components/schemas/GeneratedImage'
                  error:
                    type: 'null'
                  meta:
                    $ref: '#/components/schemas/Meta'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    Meta:
      type: object
      description: Response metadata. request_id is an 8-char correlation id (absent on auth-layer 401/402).
      properties:
        request_id:
          type: string
        timestamp:
          type: string
          format: date-time
      required:
      - timestamp
    GeneratedImage:
      type: object
      description: generateImage response; the image is already in the media library
      required:
      - media_id
      - media_status
      - type
      - credits_used
      - credits_remaining
      properties:
        media_id:
          type: string
          format: uuid
        media_ids:
          type: array
          items:
            type: string
            format: uuid
        media_status:
          type: string
          const: ready
        type:
          type: string
          const: image
        mime_type:
          type: string
          const: image/png
        dimensions:
          type: object
          properties:
            width:
              type: integer
            height:
              type: integer
        width:
          type: integer
        height:
          type: integer
        aspect_ratio:
          type: string
        orientation:
          type: string
          enum:
          - portrait
          - landscape
          - square
        file_size_bytes:
          type: integer
        ai:
          type: object
          properties:
            model:
              type: string
            prompt:
              type: string
            aspect_ratio:
              type: string
            generation_time_ms:
              type: integer
        model:
          type: string
          deprecated: true
          description: Use ai.model
        credits_used:
          type: integer
        credits_remaining:
          type: integer
        message:
          type: string
        next_step:
          type: string
    ErrorBody:
      type: object
      required:
      - message
      properties:
        message:
          type: string
        code:
          type: string
          description: Machine-readable error code (e.g. validation_error, not_found, rate_limit_exceeded)
        retryable:
          type: boolean
          description: true for transient failures (5xx, 429). Absent on auth-layer 401/402 errors.
        details:
          description: Optional structured context specific to the error code
        subscription_status:
          type: string
          description: Present only on 402 subscription_required
      additionalProperties: true
    ErrorEnvelope:
      type: object
      required:
      - data
      - error
      - meta
      properties:
        data:
          type: 'null'
        error:
          $ref: '#/components/schemas/ErrorBody'
        meta:
          $ref: '#/components/schemas/Meta'
  responses:
    BadRequest:
      description: Validation error; see error.code and error.details
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            data: null
            error:
              message: account_ids is required and must be a non-empty array. Use GET /accounts to find your account IDs.
              code: account_ids_required
              retryable: false
            meta:
              request_id: 1a2b3c4d
              timestamp: '2026-07-08T09:00:00.000Z'
    NotFound:
      description: Resource not found in your organization/workspace (not_found)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            data: null
            error:
              message: Post not found. Verify the post ID belongs to your organization.
              code: not_found
              retryable: false
            meta:
              request_id: 1a2b3c4d
              timestamp: '2026-07-08T09:00:00.000Z'
    RateLimited:
      description: 'Rate limit exceeded (rate_limit_exceeded, or plan budgets

        post_limit_reached / daily_limit_reached on schedulePost). All 429s

        carry Retry-After. The API-key limiter additionally sets the

        X-RateLimit-* headers and error.details (limit, remaining, reset_at).

        '
      headers:
        Retry-After:
          description: Seconds to wait before retrying
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests allowed in the window (API-key limiter only)
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests remaining (API-key limiter only)
          schema:
            type: integer
        X-RateLimit-Reset:
          description: Unix seconds when the window resets (API-key limiter only)
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            data: null
            error:
              message: API rate limit exceeded (60 requests/min). Please slow down.
              code: rate_limit_exceeded
              retryable: true
              details:
                limit: 60
                remaining: 0
                reset_at: '2026-07-08T09:01:00.000Z'
            meta:
              request_id: 1a2b3c4d
              timestamp: '2026-07-08T09:00:00.000Z'
    PaymentRequired:
      description: 'No active subscription (code subscription_required; the error object

        also carries subscription_status), or insufficient AI credits

        (insufficient_credits) / paid plan required (upgrade_required).

        '
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            data: null
            error:
              message: Your free trial has ended. Please upgrade to a paid plan to continue using the API.
              code: subscription_required
              subscription_status: expired
            meta:
              timestamp: '2026-07-08T09:00:00.000Z'
    Forbidden:
      description: API key missing the required scope (insufficient_scope), storage quota exceeded (storage_quota_exceeded), or account limit reached (account_limit_reached)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            data: null
            error:
              message: 'API key missing required scope: ''write''. Your key has scopes: [read]'
              code: insufficient_scope
              retryable: false
              details:
                required_scope: write
                current_scopes:
                - read
            meta:
              request_id: 1a2b3c4d
              timestamp: '2026-07-08T09:00:00.000Z'
    ServerError:
      description: Internal error (internal_error and endpoint-specific 5xx codes). Retryable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            data: null
            error:
              message: Failed to create post. Verify content, account_ids, and optional media_ids/scheduled_for are valid, then retry.
              code: internal_error
              retryable: true
            meta:
              request_id: 1a2b3c4d
              timestamp: '2026-07-08T09:00:00.000Z'
    Unauthorized:
      description: 'Missing/invalid/revoked/expired API key (codes invalid_api_key,

        api_key_revoked, api_key_expired, api_key_required, auth_failed).

        Auth-layer 401s omit error.retryable and meta.request_id.

        '
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            data: null
            error:
              message: 'Invalid API key format. Expected: Bearer pe_live_...'
              code: invalid_api_key
            meta:
              timestamp: '2026-07-08T09:00:00.000Z'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: pe_live_...
      description: 'API key created in the dashboard (Developers) or via the device-login

        flow. Keys start with `pe_live_` and carry scopes (read, write, ai);

        only a SHA-256 hash is stored server-side. See each operation''s

        `x-scope` for the scope it requires.

        '