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

# Generate Content Final

> Polish an existing draft into final, publish-ready content.

Rewrites the referenced draft into a finalized article, updates its status
to `final`, and returns the updated content. Costs credits.



## OpenAPI

````yaml /openapi.json post /v1/content/final
openapi: 3.1.0
info:
  title: Lightsage Public API
  description: Public API for Lightsage CLI and external integrations.
  version: 1.0.0
servers:
  - url: https://api.lightsage.com
    description: Production
security: []
paths:
  /v1/content/final:
    post:
      tags:
        - Content
      summary: Generate Content Final
      description: >-
        Polish an existing draft into final, publish-ready content.


        Rewrites the referenced draft into a finalized article, updates its
        status

        to `final`, and returns the updated content. Costs credits.
      operationId: content_generate_final
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateContentFinalRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicContent'
        '402':
          description: The organization does not have enough credits to generate content.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                required:
                  - detail
              examples:
                insufficient_credits:
                  summary: Not enough credits
                  value:
                    detail: 'Insufficient credits: need 10, balance 3.'
        '404':
          description: Content (or the organization) was not found for this API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                required:
                  - detail
              examples:
                not_found:
                  summary: Content not found
                  value:
                    detail: Content not found.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - LightsageApiKeyAuth: []
components:
  schemas:
    GenerateContentFinalRequest:
      properties:
        content_id:
          type: string
          title: Content Id
          description: Id of the draft content to finalize.
      type: object
      required:
        - content_id
      title: GenerateContentFinalRequest
      description: Polish an existing draft into final, publish-ready content.
    PublicContent:
      properties:
        id:
          type: string
          title: Id
        title:
          type: string
          title: Title
        text:
          type: string
          title: Text
        slug:
          type: string
          title: Slug
        status:
          type: string
          title: Status
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      required:
        - id
        - title
        - text
        - slug
        - status
      title: PublicContent
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    LightsageApiKeyAuth:
      type: apiKey
      in: header
      name: X-Lightsage-Api-Key

````