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

# Chat

> 모델에서 텍스트 응답을 만듭니다.

이 엔드포인트로 모델에 일반 텍스트 입력을 보내고 일반 텍스트 응답을 받습니다. 이 Capriole 네이티브 경로는 비스트리밍입니다. 클라이언트에 SSE 스트림이 필요하면 Chat Completions, Responses 또는 Messages를 사용하세요.

`POST /v1/chat`는 `openai-latest`, `claude-latest`, `google-latest`와 `GET /v1/models`가 반환하는 공개 구체 모델 ID를 받습니다. 해당 제공자의 권장 플래그십 모델을 Capriole AI가 선택하게 하려면 latest 별칭을 사용하세요. 버전 고정이 중요하면 구체적인 모델 ID를 사용하세요.

Capriole AI 웹 채팅과 공개 API는 서로 다른 제품 표면입니다. 웹 채팅에서 Fable 5와 Fable 5 Thinking이 기본 Anthropic 모드이고, Opus 5와 Opus 5 Thinking은 **Other Models**에 표시됩니다. 공개 API는 웹 채팅 Thinking 프리셋을 별도의 모델 ID로 노출하지 않습니다. Claude Chat API 요청에는 `claude-latest` 또는 `anthropic/claude-fable-5`, `anthropic/claude-opus-5`, `anthropic/claude-sonnet-4-6` 같은 공개 구체 Claude 모델 ID를 사용하세요. 기존 Opus 4.8, Opus 4.7, Opus 4.6 통합은 계속 지원됩니다.


## OpenAPI

````yaml api-reference/openapi.json POST /v1/chat
openapi: 3.1.0
info:
  title: Capriole AI API
  description: >-
    Public API for model discovery, text chat, and protocol-compatible model
    endpoints.
  version: 1.0.0
servers:
  - url: https://api.caprioletech.com
security: []
paths:
  /v1/chat:
    post:
      summary: Create chat response
      description: Creates a text response from a model.
      operationId: createChat
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatRequest'
            examples:
              text:
                value:
                  model: openai-latest
                  input: Hello World!
      responses:
        '200':
          description: Chat completion response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatResponse'
              examples:
                default:
                  value:
                    id: 49da8eb7-916b-43a3-ab02-442bc2841839
                    model: openai/gpt-5.6-terra
                    result:
                      text: Here is a short joke.
                    usage:
                      input_tokens: 8
                      output_tokens: 6
                      total_tokens: 14
                      cached_tokens: 0
                      charged_tokens: 14
        '400':
          $ref: '#/components/responses/ValidationOrDetailErrorResponse'
        '401':
          $ref: '#/components/responses/DetailErrorResponse'
        '403':
          $ref: '#/components/responses/DetailErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimitErrorResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
        '502':
          $ref: '#/components/responses/DetailErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ChatRequest:
      type: object
      additionalProperties: false
      required:
        - model
        - input
      properties:
        model:
          type: string
          description: Public model identifier or latest alias returned by GET /v1/models
          enum:
            - openai-latest
            - openai/gpt-5.6-terra
            - openai/gpt-5.6-luna
            - openai/gpt-5.5
            - openai/gpt-5.4-mini
            - claude-latest
            - anthropic/claude-fable-5
            - anthropic/claude-opus-5
            - anthropic/claude-opus-4-8
            - anthropic/claude-opus-4-7
            - anthropic/claude-opus-4-6
            - anthropic/claude-sonnet-4-6
            - google-latest
            - google/gemini-3.1-pro-preview
            - google/gemini-3.5-flash
            - xai/grok-4.5
            - zai/glm-5.2
            - moonshot/kimi-k3
        input:
          type: string
          description: Plain text user input
        web_search:
          type: boolean
          default: true
          description: >-
            Enable provider-native web search when the selected model supports
            it.
        temperature:
          type: number
          minimum: 0
          description: Optional sampling temperature.
        max_output_tokens:
          type: integer
          exclusiveMinimum: 0
          description: Optional maximum number of output tokens.
        max_retries:
          type: integer
          minimum: 0
          description: Optional maximum number of provider retries.
        timeout:
          type: number
          exclusiveMinimum: 0
          description: Optional provider request timeout in seconds.
    ChatResponse:
      type: object
      required:
        - id
        - model
        - result
        - usage
      properties:
        id:
          type: string
        model:
          type: string
        result:
          $ref: '#/components/schemas/ChatResult'
        usage:
          $ref: '#/components/schemas/ChatUsage'
    ChatResult:
      type: object
      required:
        - text
      properties:
        text:
          type: string
          description: Plain text assistant result
    ChatUsage:
      type: object
      required:
        - input_tokens
        - output_tokens
        - total_tokens
        - cached_tokens
        - charged_tokens
      properties:
        input_tokens:
          type: integer
        output_tokens:
          type: integer
        total_tokens:
          type: integer
        cached_tokens:
          type: integer
          description: Provider-reported cached input tokens.
        charged_tokens:
          type: integer
          description: Quota tokens charged after cached input discount.
    ValidationError:
      type: object
      required:
        - detail
        - errors
      properties:
        detail:
          type: string
          description: Validation summary
        errors:
          type: array
          items:
            type: string
          description: Per-field validation errors
    DetailError:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: Error detail from the API
  responses:
    ValidationOrDetailErrorResponse:
      description: Validation error or request-level error response
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ValidationError'
              - $ref: '#/components/schemas/DetailError'
          examples:
            invalidPayload:
              value:
                detail: Invalid input parameters received.
                errors:
                  - >-
                    Field 'body -> input': String should have at least 1
                    character
    DetailErrorResponse:
      description: Error response with a detail message
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DetailError'
          examples:
            missingBearerToken:
              value:
                detail: Missing Bearer token
            invalidApiKey:
              value:
                detail: Invalid API key
            usageMetadataUnavailable:
              value:
                detail: Missing usage metadata
    RateLimitErrorResponse:
      description: Rate limit error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DetailError'
          examples:
            rateLimitExceeded:
              value:
                detail: 'Rate limit exceeded: 100 per 1 minute'
    InternalServerErrorResponse:
      description: Internal server error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DetailError'
          examples:
            internalServerError:
              value:
                detail: An internal server error occurred. Please try again later.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Use an API key created in the Capriole AI page. Send it as
        `Authorization: Bearer sk-...`.

````