> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superx.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate an AI cover image

> Generates a 2.5:1 cover image from the article's TITLE (a title is required) and, by default, attaches it as the article's cover. `attach: false` generates without touching the current cover; attach later via PATCH `cover_url`. `style_text` (max 8000 chars) steers the artwork.

Slow (60-100 seconds) and paid: spends AI credits against daily and monthly caps, all enforced server-side. 429 responses carry `remaining_day` / `remaining_month` / `limit_day` / `limit_month` counters. Supports `Idempotency-Key`, recommended. Main account only in v1.




## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/articles/{id}/cover
openapi: 3.1.0
info:
  title: SuperX API
  version: 1.0.0
  description: >
    The SuperX public API: your Twitter/X content, analytics, audience and

    scheduling data over REST.


    All endpoints require an API key (`Authorization: Bearer sxk_...`) except

    `GET /v1/docs`. Keys are created in the SuperX app under Account > API / MCP
    / CLI

    and are server-side secrets.


    Timestamps are UTC ISO-8601 in both directions; inputs must carry an
    explicit

    `Z` or numeric offset. Every authenticated response carries

    `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`
    headers.
  contact:
    name: SuperX
    url: https://superx.so
servers:
  - url: https://api.superx.so
security:
  - apiKey: []
tags:
  - name: Identity
  - name: Content
  - name: Analytics
  - name: Inspiration
  - name: Audience
  - name: Contact Lists
  - name: Signals
  - name: Media
  - name: Scheduling
  - name: Tags
  - name: Context
  - name: Queue
  - name: Articles
  - name: Meta
paths:
  /v1/articles/{id}/cover:
    post:
      tags:
        - Articles
      summary: Generate an AI cover image
      description: >
        Generates a 2.5:1 cover image from the article's TITLE (a title is
        required) and, by default, attaches it as the article's cover. `attach:
        false` generates without touching the current cover; attach later via
        PATCH `cover_url`. `style_text` (max 8000 chars) steers the artwork.


        Slow (60-100 seconds) and paid: spends AI credits against daily and
        monthly caps, all enforced server-side. 429 responses carry
        `remaining_day` / `remaining_month` / `limit_day` / `limit_month`
        counters. Supports `Idempotency-Key`, recommended. Main account only in
        v1.
      operationId: generateArticleCover
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                style_text:
                  type: string
                  maxLength: 8000
                  description: Optional style description steering the artwork.
                attach:
                  type: boolean
                  default: true
                account_id:
                  type: string
            example:
              style_text: dark, minimal, geometric
      responses:
        '200':
          description: The generated cover.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      cover:
                        type: object
                        properties:
                          url:
                            type: string
                      attached:
                        type: boolean
                        description: Whether the cover was attached to the article.
                      remaining_day:
                        type: integer
                        nullable: true
                      remaining_month:
                        type: integer
                        nullable: true
              example:
                data:
                  cover:
                    url: https://media.superx.so/covers/example.jpg
                  attached: true
                  remaining_day: 3
                  remaining_month: 11
        '400':
          $ref: '#/components/responses/InvalidParameter'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            Read-only key (`insufficient_scope`), linked account
            (`writes_main_account_only`), cover generation disabled
            (`feature_disabled`), or a lapsed subscription.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - $ref: '#/components/schemas/LegacyErrorEnvelope'
              example:
                error:
                  code: insufficient_scope
                  message: >-
                    This API key is read-only. Create a key with the write scope
                    to use this endpoint.
        '404':
          $ref: '#/components/responses/ArticleNotFound'
        '409':
          description: >-
            A cover is already being generated for this article
            (`cover_gen_in_progress`), or the Idempotency-Key was reused with a
            different body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                error:
                  code: cover_gen_in_progress
                  message: >-
                    A cover is already being generated for this article. Try
                    again once it finishes.
        '429':
          description: >-
            Rate limited, generation caps reached (`cover_gen_cap_daily` /
            `cover_gen_cap_monthly` with counters), or AI credits exhausted
            (`ai_credits_exhausted`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                error:
                  code: cover_gen_cap_daily
                  message: The daily cover generation cap has been reached.
                  remaining_day: 0
                  remaining_month: 7
                  limit_day: 6
                  limit_month: 13
        '502':
          $ref: '#/components/responses/UpstreamError'
        '504':
          description: >-
            AMBIGUOUS timeout. The render may still have completed. GET the
            article to check its cover before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                error:
                  code: upstream_timeout
                  message: >-
                    Cover generation did not respond in time and may still have
                    completed. GET the article to check its cover before
                    retrying.
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Unique key (max 64 characters) for safe retries. Replays carry the
        "Idempotency-Replayed" response header set to "true". Keys are retained
        for 24 hours.
      schema:
        type: string
        maxLength: 64
  headers:
    X-RateLimit-Limit:
      description: The limit of the rate window closest to exhaustion.
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests remaining in that window.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix timestamp (seconds) when that window resets.
      schema:
        type: integer
  responses:
    InvalidParameter:
      description: A parameter is missing, malformed, or out of range.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: invalid_parameter
              message: since must be a UTC ISO-8601 timestamp
    Unauthorized:
      description: >-
        Missing/malformed Authorization header (`unauthorized`) or an
        unknown/revoked key (`invalid_api_key`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: invalid_api_key
              message: Unknown or revoked API key
    ArticleNotFound:
      description: No article with that id belongs to this account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: not_found
              message: No article with that id belongs to this account.
    UpstreamError:
      description: A dependent SuperX service returned an unexpected response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: upstream_error
              message: Failed to fetch scheduled posts. Try again shortly.
  schemas:
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable error code.
            message:
              type: string
            retry_after:
              type: integer
              description: Seconds to wait before retrying (rate-limit errors only).
    LegacyErrorEnvelope:
      type: object
      required:
        - error
      description: |
        Legacy shape used ONLY by the shared subscription middleware: a plain
        string `error` field. Seen on `403` when the subscription has lapsed
        (string starts with "subscription_required:") and on `500` when
        subscription verification fails (string starts with "internal_error:").
      properties:
        error:
          type: string
          example: >-
            subscription_required: The SuperX API requires an active
            subscription
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A SuperX API key ("sxk_..."), created in the SuperX app under Account >
        API / MCP / CLI. Keys are server-side secrets.

````