# Generate Caption

Source: https://recoupable.dev/docs/api-reference/content/generate-caption

Generate a short caption from a topic. Returns the text content and default styling (font, color, size).

## POST /api/content/caption

Full OpenAPI specification: https://recoupable.dev/docs/spec/content.json

## Authentication

This operation requires one of the security alternatives in the specification below. Security scheme definitions are included where present in the published specification.

[Authentication guide](https://recoupable.dev/docs/authentication)

## Operation and referenced schemas

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Recoup API - Content",
    "description": "API documentation for the Recoup platform - an AI agent platform for the music industry",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.recoupable.dev"
    }
  ],
  "paths": {
    "/api/content/caption": {
      "post": {
        "description": "Generate a short caption from a topic. Returns the text content and default styling (font, color, size).",
        "security": [
          {
            "apiKeyAuth": []
          },
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "description": "Text generation parameters",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContentCreateTextRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Text generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentCreateTextResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed — invalid or missing request body fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContentCreateTextRequest": {
        "type": "object",
        "required": [
          "topic"
        ],
        "properties": {
          "template": {
            "type": "string",
            "description": "Optional template ID. When provided, injects the template's caption guide (tone, rules, formats) and examples into the LLM prompt. Caller's topic is still required. See [GET /api/content/templates](/api-reference/content/templates) for available options."
          },
          "topic": {
            "type": "string",
            "description": "The subject or theme for caption generation"
          },
          "length": {
            "type": "string",
            "enum": [
              "short",
              "medium",
              "long"
            ],
            "default": "short",
            "description": "Desired text length"
          }
        }
      },
      "ContentCreateTextResponse": {
        "type": "object",
        "required": [
          "content",
          "color",
          "borderColor",
          "maxFontSize"
        ],
        "properties": {
          "content": {
            "type": "string",
            "description": "Generated on-screen text content"
          },
          "font": {
            "type": [
              "string",
              "null"
            ],
            "description": "Font name for the text, or null for default"
          },
          "color": {
            "type": "string",
            "description": "Text color as a CSS color value",
            "example": "white"
          },
          "borderColor": {
            "type": "string",
            "description": "Text border/stroke color as a CSS color value",
            "example": "black"
          },
          "maxFontSize": {
            "type": "number",
            "description": "Maximum font size in pixels",
            "example": 42
          }
        }
      },
      "ContentErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Error message describing what went wrong",
            "example": "Unauthorized"
          }
        }
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Your Recoup API key. [Learn more](/quickstart#api-keys)."
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
```
