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

# Create a response

> Refine an AI response to align with the selected persona's tone and style.



## OpenAPI

````yaml POST /refine
openapi: 3.0.1
info:
  title: OpenGiant API
  description: API for refining AI responses and managing personas.
  version: 1.0.0
servers:
  - url: https://api.opengiant.com/v1
security:
  - bearerAuth: []
paths:
  /refine:
    post:
      description: >-
        Refine an AI response to align with the selected persona's tone and
        style.
      requestBody:
        description: Content to refine using OpenGiant persona settings.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefineRequest'
      responses:
        '200':
          description: Refined response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefineResponse'
        '400':
          description: Unexpected error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    RefineRequest:
      type: object
      required:
        - provider
        - providerApiKey
        - personaId
        - content
      properties:
        provider:
          type: string
          description: The AI provider (e.g., openai, anthropic, cohere).
        providerApiKey:
          type: string
          description: API key for the selected AI provider.
        personaId:
          type: string
          description: ID of the persona to use for refining.
        content:
          type: string
          description: The raw AI-generated content to refine.
    RefineResponse:
      type: object
      properties:
        response:
          type: string
          description: The refined AI response.
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: integer
          format: int32
          description: Error code.
        message:
          type: string
          description: Error message.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````