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

# Generate a social caption with AI



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/generate
openapi: 3.1.0
info:
  title: Sydium Public API
  version: 1.0.0
servers:
  - url: https://api.sydium.com
security:
  - ApiKey: []
paths:
  /v1/generate:
    post:
      summary: Generate a social caption with AI
      operationId: generateCaption
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateRequest'
      responses:
        '200':
          description: Generated caption
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateResponse'
        '401':
          description: Unauthenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden (scope/permission)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limited / insufficient tokens
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Generation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    GenerateRequest:
      type: object
      required:
        - topic
      properties:
        topic:
          type: string
        platform:
          type: string
        tone:
          type: string
        language:
          type: string
    GenerateResponse:
      type: object
      required:
        - success
        - data
        - meta
      properties:
        success:
          const: true
        data:
          type: object
          required:
            - text
          properties:
            text:
              type: string
            tokensUsed:
              type: integer
        meta:
          type: object
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          const: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - forbidden
                - insufficient_permissions
                - not_found
                - unprocessable
                - rate_limited
                - invalid_state
                - external_service_error
                - internal_error
            message:
              type: string
        meta:
          type: object
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: Opaque API key (sk_live_... / sk_test_...)

````