> ## 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.

# Responses

> Capriole AI の Responses モデルで OpenAI Responses 互換の出力を作成します。

アプリケーション、SDK、またはエージェントが OpenAI Responses のリクエストとレスポンス形式を期待する場合は、このエンドポイントを使ってください。

`model` と `input` を含む標準の Responses ペイロードを送信します。Capriole AI は上流へ送る前に latest エイリアスを選択した上流モデル ID に解決し、`instructions`、`tools`、`reasoning`、`previous_response_id`、`stream` などの互換フィールドを転送し、上流の JSON または SSE ストリームをそのまま返します。

`POST /v1/responses` は `openai-latest`、`openai/gpt-5.6-terra`、`openai/gpt-5.6-luna`、`openai/gpt-5.5`、`openai/gpt-5.4-mini` を受け付けます。推奨する旗艦 OpenAI Responses モデルを Capriole AI に選ばせるには、`openai-latest` を使ってください。

このエンドポイントでは Claude と Google の latest エイリアスはサポートされません。Grok 4.5、GLM 5.2、Kimi K3 は Chat Completions を使うため、ここでもサポートされません。公開モデルをすべて呼べる 1 つの OpenAI 互換エンドポイントが必要な場合は、`POST /v1/chat/completions` を使ってください。

シンプルな Capriole ネイティブのテキスト生成には `POST /v1/chat` を使ってください。OpenAI Responses のワイヤ動作が必要な場合は `POST /v1/responses` を使ってください。


## OpenAPI

````yaml api-reference/openapi.json POST /v1/responses
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/responses:
    post:
      summary: Create response
      description: >-
        Creates an OpenAI Responses-compatible response for models that use the
        Responses request and response format.
      operationId: createResponse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesRequest'
            examples:
              text:
                value:
                  model: openai-latest
                  input: Hello World!
              streaming:
                value:
                  model: openai/gpt-5.6-luna
                  input: Write a short Python function.
                  stream: true
      responses:
        '200':
          description: OpenAI Responses-compatible JSON response or SSE stream
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesResponse'
            text/event-stream:
              schema:
                type: string
                description: OpenAI Responses-compatible SSE chunks.
        '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:
    ResponsesRequest:
      type: object
      additionalProperties: true
      required:
        - model
        - input
      properties:
        model:
          type: string
          description: Public Responses-compatible model identifier or OpenAI latest alias
          enum:
            - openai-latest
            - openai/gpt-5.6-terra
            - openai/gpt-5.6-luna
            - openai/gpt-5.5
            - openai/gpt-5.4-mini
        input:
          description: OpenAI Responses input string or item list.
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                additionalProperties: true
        instructions:
          type: string
          description: Optional system-level instructions.
        tools:
          type: array
          description: OpenAI Responses-compatible tool definitions.
          items:
            type: object
            additionalProperties: true
        reasoning:
          type: object
          description: OpenAI Responses-compatible reasoning options.
          additionalProperties: true
        stream:
          type: boolean
          default: false
          description: >-
            Stream the response as OpenAI Responses-compatible server-sent
            events.
    ResponsesResponse:
      type: object
      description: OpenAI Responses-compatible response body.
      additionalProperties: true
    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-...`.

````