RecoupGet a Free AuditFree Audit

API REFERENCE

Generate Caption

On this page
POST/api/content/caption

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

Authentication

x-api-key in header

bearerAuth bearer

Request

cURL
curl --request POST \
  --url 'https://api.recoupable.dev/api/content/caption' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "topic": "string"
}'

Request body required

Text generation parameters

application/json

templatestring

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 for available options.

topicstringrequired

The subject or theme for caption generation

lengthstring · enum

Desired text length

Values: "short", "medium", "long"

Default: "short"

Responses

200Text generated successfully

application/json

contentstringrequired

Generated on-screen text content

fontstring | null

Font name for the text, or null for default

colorstringrequired

Text color as a CSS color value

borderColorstringrequired

Text border/stroke color as a CSS color value

maxFontSizenumberrequired

Maximum font size in pixels

400Validation failed — invalid or missing request body fields

application/json

errorstringrequired

Error message describing what went wrong

401Unauthorized — invalid or missing API key

application/json

errorstringrequired

Error message describing what went wrong

500Internal server error

application/json

errorstringrequired

Error message describing what went wrong

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download content.json
View operation source
json
{
  "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"
          }
        }
      }
    }
  }
}