> ## Documentation Index
> Fetch the complete documentation index at: https://nusabase-a8dcf793.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Compact Conversation

> OpenAI Responses API, used to compact long conversations.



## OpenAPI

````yaml /en/openapi/relay-api.mintlify.json post /v1/responses/compact
openapi: 3.0.1
info:
  title: AI Relay API
  description: >-
    Unified AI Model API supporting OpenAI, Claude, Gemini, Kling, Jimeng and
    other formats
  version: 1.0.0
  license:
    name: Proprietary
    url: https://example.com/license
servers:
  - url: https://api.nusabasedigital.com
    description: API Base URL
security:
  - BearerAuth: []
tags:
  - name: Models
    description: Models endpoints
  - name: Chat
    description: Chat endpoints
  - name: Responses
    description: Responses endpoints
  - name: Realtime
    description: Realtime endpoints
  - name: Claude
    description: Claude endpoints
  - name: Gemini
    description: Gemini endpoints
  - name: Images
    description: Images endpoints
  - name: Video
    description: Video endpoints
  - name: Video / Kling
    description: Video / Kling endpoints
  - name: Video / Jimeng
    description: Video / Jimeng endpoints
  - name: Audio
    description: Audio endpoints
  - name: Embeddings
    description: Embeddings endpoints
  - name: Rerank
    description: Rerank endpoints
  - name: Moderations
    description: Moderations endpoints
  - name: Not Implemented
    description: Not Implemented endpoints
paths:
  /v1/responses/compact:
    post:
      tags:
        - Responses
      summary: Compact Conversation
      description: OpenAI Responses API, used to compact long conversations.
      operationId: post_v1_responses_compact
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesCompactionRequest'
        required: true
      responses:
        '200':
          description: Conversation compacted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesCompactionResponse'
          headers: {}
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    ResponsesCompactionRequest:
      type: object
      required:
        - model
      properties:
        model:
          type: string
        input:
          description: Input content, which can be a string or an array of messages
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                properties: {}
        instructions:
          type: string
        previous_response_id:
          type: string
    ResponsesCompactionResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: response.compaction
        created_at:
          type: integer
        output:
          type: array
          items:
            type: object
            properties: {}
        usage:
          $ref: '#/components/schemas/Usage'
        error:
          type: object
          properties: {}
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Error profile
            type:
              type: string
              description: Error type
            param:
              type: string
              description: Related parameter
              nullable: true
            code:
              type: string
              description: Error code
              nullable: true
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
          description: Number of prompt tokens
        completion_tokens:
          type: integer
          description: Number of completion tokens
        total_tokens:
          type: integer
          description: Total number of tokens
        prompt_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
            text_tokens:
              type: integer
            audio_tokens:
              type: integer
            image_tokens:
              type: integer
        completion_tokens_details:
          type: object
          properties:
            text_tokens:
              type: integer
            audio_tokens:
              type: integer
            reasoning_tokens:
              type: integer
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.