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

# Chat Completionを作成

> 新しいChat Completionを作成します。



## OpenAPI

````yaml /ja/serverless-rl/api-reference/openapi.json post /v1/chat/completions
openapi: 3.1.0
info:
  title: Serverless RL
  version: 1.0.0
servers: []
security: []
paths:
  /v1/chat/completions:
    post:
      tags:
        - chat-completions
      summary: Chat Completionを作成
      description: 新しいChat Completionを作成します。
      operationId: create_chat_completion_v1_chat_completions_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
          description: 正常なレスポンス
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 検証エラー
      security:
        - HTTPBearer: []
components:
  schemas:
    ChatCompletionRequest:
      additionalProperties: true
      properties:
        add_generation_prompt:
          default: true
          description: >-
            true の場合、生成プロンプトが chat template に追加されます。これは、モデルの tokenizer 設定内の chat
            template で使用されるパラメーターです。
          title: Add Generation Prompt
          type: boolean
        add_special_tokens:
          default: false
          description: >-
            true の場合、chat template によって追加されるものに加えて、特殊トークン（例:
            BOS）もプロンプトに追加されます。ほとんどのモデルでは、特殊トークンの追加は chat template が処理するため、これは
            false に設定する必要があります（デフォルト値も false です）。
          title: Add Special Tokens
          type: boolean
        allowed_token_ids:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Allowed Token Ids
        bad_words:
          items:
            type: string
          title: Bad Words
          type: array
        cache_salt:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            指定した場合、複数ユーザー環境で攻撃者がプロンプトを推測することを防ぐため、prefix cache
            に指定した文字列でソルトを追加します。ソルトはランダムで、第三者が access
            できないよう保護され、かつ予測不能であるのに十分な長さである必要があります（例: 256 bit に相当する、base64 エンコードで
            43 文字）。
          title: Cache Salt
        chat_template:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            この変換に使用する Jinja テンプレートです。transformers v4.44 以降ではデフォルトの chat template
            は使用できないため、tokenizer で chat template が定義されていない場合は、chat template
            を指定する必要があります。
          title: Chat Template
        chat_template_kwargs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: テンプレート renderer に渡す追加のキーワード引数です。chat template からアクセスできます。
          title: Chat Template Kwargs
        continue_final_message:
          default: false
          description: >-
            これが設定されている場合、チャットは末尾のメッセージが EOS
            トークンなしの未完了の状態になるように整形されます。モデルは新しいメッセージを開始するのではなく、そのメッセージの続きを生成します。これにより、モデルの応答の一部を事前に埋めておくことができます。`add_generation_prompt`
            とは同時に使用できません。
          title: Continue Final Message
          type: boolean
        documents:
          anyOf:
            - items:
                additionalProperties:
                  type: string
                type: object
              type: array
            - type: 'null'
          description: >-
            モデルが RAG（検索拡張生成）を実行する場合にアクセスできるドキュメントを表す dict のリストです。テンプレートが RAG
            をサポートしていない場合、この引数は効果を持ちません。各ドキュメントは、"title" キーと "text" キーを含む dict
            にすることを推奨します。
          title: Documents
        echo:
          default: false
          description: true の場合、同じロールに属していれば、新しいメッセージは直前のメッセージの前に追加されます。
          title: Echo
          type: boolean
        frequency_penalty:
          anyOf:
            - type: number
            - type: 'null'
          default: 0
          title: Frequency Penalty
        ignore_eos:
          default: false
          title: Ignore Eos
          type: boolean
        include_reasoning:
          default: true
          title: Include Reasoning
          type: boolean
        include_stop_str_in_output:
          default: false
          title: Include Stop Str In Output
          type: boolean
        kv_transfer_params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: 分離サービングに使用される KVTransfer パラメーター。
          title: Kv Transfer Params
        length_penalty:
          default: 1
          title: Length Penalty
          type: number
        logit_bias:
          anyOf:
            - additionalProperties:
                type: number
              type: object
            - type: 'null'
          title: Logit Bias
        logprobs:
          anyOf:
            - type: boolean
            - type: 'null'
          default: false
          title: Logprobs
        max_completion_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Completion Tokens
        max_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          deprecated: true
          title: Max Tokens
        messages:
          items:
            anyOf:
              - $ref: '#/components/schemas/ChatCompletionDeveloperMessageParam'
              - $ref: '#/components/schemas/ChatCompletionSystemMessageParam'
              - $ref: '#/components/schemas/ChatCompletionUserMessageParam'
              - $ref: '#/components/schemas/ChatCompletionAssistantMessageParam'
              - $ref: '#/components/schemas/ChatCompletionToolMessageParam'
              - $ref: '#/components/schemas/ChatCompletionFunctionMessageParam'
              - $ref: '#/components/schemas/CustomChatCompletionMessageParam'
              - $ref: '#/components/schemas/Message'
          title: Messages
          type: array
        min_p:
          anyOf:
            - type: number
            - type: 'null'
          title: Min P
        min_tokens:
          default: 0
          title: Min Tokens
          type: integer
        mm_processor_kwargs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: HF processor に渡す追加の kwargs です。
          title: Mm Processor Kwargs
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        'n':
          anyOf:
            - type: integer
            - type: 'null'
          default: 1
          title: 'N'
        parallel_tool_calls:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
          title: Parallel Tool Calls
        presence_penalty:
          anyOf:
            - type: number
            - type: 'null'
          default: 0
          title: Presence Penalty
        priority:
          default: 0
          description: >-
            リクエストの優先度です（値が小さいほど先に処理されます。デフォルト: 0）。Serve
            されたモデルが優先度スケジューリングを使用していない場合、0 以外の優先度を指定するとエラーになります。
          title: Priority
          type: integer
        prompt_logprobs:
          anyOf:
            - type: integer
            - type: 'null'
          title: Prompt Logprobs
        reasoning_effort:
          anyOf:
            - enum:
                - low
                - medium
                - high
              type: string
            - type: 'null'
          title: Reasoning Effort
        repetition_detection:
          anyOf:
            - $ref: '#/components/schemas/RepetitionDetectionParams'
            - type: 'null'
          description: >-
            出力トークン内の繰り返しのある N-gram
            パターンを検出するためのパラメーターです。このような繰り返しが検出された場合、生成は早期に終了します。LLM
            は、ときに反復的で有用でないトークン パターンを生成し、最大出力長に達するまで停止しないことがあります（例:
            'abcdabcdabcd...' または '\emoji \emoji \emoji
            ...'）。この機能は、そのような動作を検出して早期に終了し、時間とトークンを節約します。
        repetition_penalty:
          anyOf:
            - type: number
            - type: 'null'
          title: Repetition Penalty
        request_id:
          description: >-
            このリクエストに関連する request_id です。呼び出し元が設定しない場合は、random_uuid が生成されます。この ID
            は Inference プロセス全体を通じて使用され、Response で返されます。
          title: Request Id
          type: string
        response_format:
          anyOf:
            - $ref: '#/components/schemas/ResponseFormat'
            - $ref: '#/components/schemas/StructuralTagResponseFormat'
            - $ref: '#/components/schemas/LegacyStructuralTagResponseFormat'
            - type: 'null'
          title: Response Format
        return_token_ids:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            指定した場合、結果には生成されたテキストに加えて token ID
            も含まれます。ストリーミングモードでは、prompt_token_ids は最初の chunk にのみ含まれ、token_ids には各
            chunk の差分 token が含まれます。これはデバッグ時や、生成テキストを入力 token
            に対応付ける必要がある場合に役立ちます。
          title: Return Token Ids
        return_tokens_as_token_ids:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            'logprobs' を指定した場合、JSON にエンコードできない token を識別できるよう、token は
            'token_id:{token_id}' 形式の文字列として表されます。
          title: Return Tokens As Token Ids
        seed:
          anyOf:
            - maximum: 9223372036854776000
              minimum: -9223372036854776000
              type: integer
            - type: 'null'
          title: Seed
        skip_special_tokens:
          default: true
          title: Skip Special Tokens
          type: boolean
        spaces_between_special_tokens:
          default: true
          title: Spaces Between Special Tokens
          type: boolean
        stop:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - type: 'null'
          default: []
          title: Stop
        stop_token_ids:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          default: []
          title: Stop Token Ids
        stream:
          anyOf:
            - type: boolean
            - type: 'null'
          default: false
          title: Stream
        stream_options:
          anyOf:
            - $ref: '#/components/schemas/StreamOptions'
            - type: 'null'
        structured_outputs:
          anyOf:
            - $ref: '#/components/schemas/StructuredOutputsParams'
            - type: 'null'
          description: structured outputs 用の追加の kwargs です。
        temperature:
          anyOf:
            - type: number
            - type: 'null'
          title: Temperature
        tool_choice:
          anyOf:
            - const: none
              type: string
            - const: auto
              type: string
            - const: required
              type: string
            - $ref: '#/components/schemas/ChatCompletionNamedToolChoiceParam'
            - type: 'null'
          default: none
          title: Tool Choice
        tools:
          anyOf:
            - items:
                $ref: '#/components/schemas/ChatCompletionToolsParam'
              type: array
            - type: 'null'
          title: Tools
        top_k:
          anyOf:
            - type: integer
            - type: 'null'
          title: Top K
        top_logprobs:
          anyOf:
            - type: integer
            - type: 'null'
          default: 0
          title: Top Logprobs
        top_p:
          anyOf:
            - type: number
            - type: 'null'
          title: Top P
        truncate_prompt_tokens:
          anyOf:
            - maximum: 9223372036854776000
              minimum: -1
              type: integer
            - type: 'null'
          title: Truncate Prompt Tokens
        use_beam_search:
          default: false
          title: Use Beam Search
          type: boolean
        user:
          anyOf:
            - type: string
            - type: 'null'
          title: User
        vllm_xargs:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: integer
                  - type: number
                  - items:
                      anyOf:
                        - type: string
                        - type: integer
                        - type: number
                    type: array
              type: object
            - type: 'null'
          description: custom 拡張機能で使用される、文字列または数値の値（またはその list）からなる追加の request パラメーター。
          title: Vllm Xargs
      required:
        - messages
      title: ChatCompletionRequest
      type: object
    ChatCompletionResponse:
      additionalProperties: true
      properties:
        choices:
          items:
            $ref: '#/components/schemas/ChatCompletionResponseChoice'
          title: Choices
          type: array
        created:
          title: Created
          type: integer
        id:
          title: Id
          type: string
        kv_transfer_params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: KVTransfer パラメーター。
          title: Kv Transfer Params
        model:
          title: Model
          type: string
        object:
          const: chat.completion
          default: chat.completion
          title: Object
          type: string
        prompt_logprobs:
          anyOf:
            - items:
                anyOf:
                  - additionalProperties:
                      $ref: '#/components/schemas/Logprob'
                    type: object
                  - type: 'null'
              type: array
            - type: 'null'
          title: Prompt Logprobs
        prompt_token_ids:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Prompt Token Ids
        service_tier:
          anyOf:
            - enum:
                - auto
                - default
                - flex
                - scale
                - priority
              type: string
            - type: 'null'
          title: Service Tier
        system_fingerprint:
          anyOf:
            - type: string
            - type: 'null'
          title: System Fingerprint
        usage:
          $ref: '#/components/schemas/UsageInfo'
      required:
        - model
        - choices
        - usage
      title: ChatCompletionResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ChatCompletionDeveloperMessageParam:
      additionalProperties: true
      description: >-
        ユーザーが送信したメッセージにかかわらず、モデルが従うべき開発者指定の指示です。o1 モデル以降では、`developer` メッセージが従来の
        `system` メッセージに置き換わります。
      properties:
        content:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/ChatCompletionContentPartTextParam'
              type: array
          title: Content
        name:
          title: Name
          type: string
        role:
          const: developer
          title: Role
          type: string
      required:
        - content
        - role
      title: ChatCompletionDeveloperMessageParam
      type: object
    ChatCompletionSystemMessageParam:
      additionalProperties: true
      description: >-
        ユーザーが送信する messages に関係なく、モデルが従うべき開発者指定の指示です。o1 models 以降では、この用途には代わりに
        `developer` messages を使用してください。
      properties:
        content:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/ChatCompletionContentPartTextParam'
              type: array
          title: Content
        name:
          title: Name
          type: string
        role:
          const: system
          title: Role
          type: string
      required:
        - content
        - role
      title: ChatCompletionSystemMessageParam
      type: object
    ChatCompletionUserMessageParam:
      additionalProperties: true
      description: プロンプトまたは追加のコンテキスト情報を含む、エンドユーザーが送信する messages。
      properties:
        content:
          anyOf:
            - type: string
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ChatCompletionContentPartTextParam'
                  - $ref: '#/components/schemas/ChatCompletionContentPartImageParam'
                  - $ref: >-
                      #/components/schemas/ChatCompletionContentPartInputAudioParam
                  - $ref: '#/components/schemas/File'
              type: array
          title: Content
        name:
          title: Name
          type: string
        role:
          const: user
          title: Role
          type: string
      required:
        - content
        - role
      title: ChatCompletionUserMessageParam
      type: object
    ChatCompletionAssistantMessageParam:
      additionalProperties: true
      description: ユーザーメッセージへの応答としてモデルが送信したメッセージ。
      properties:
        audio:
          anyOf:
            - $ref: '#/components/schemas/Audio'
            - type: 'null'
        content:
          anyOf:
            - type: string
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ChatCompletionContentPartTextParam'
                  - $ref: '#/components/schemas/ChatCompletionContentPartRefusalParam'
              type: array
            - type: 'null'
          title: Content
        function_call:
          anyOf:
            - $ref: '#/components/schemas/FunctionCall-Input'
            - type: 'null'
        name:
          title: Name
          type: string
        refusal:
          anyOf:
            - type: string
            - type: 'null'
          title: Refusal
        role:
          const: assistant
          title: Role
          type: string
        tool_calls:
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/ChatCompletionMessageFunctionToolCallParam
              - $ref: '#/components/schemas/ChatCompletionMessageCustomToolCallParam'
          title: Tool Calls
          type: array
      required:
        - role
      title: ChatCompletionAssistantMessageParam
      type: object
    ChatCompletionToolMessageParam:
      additionalProperties: true
      properties:
        content:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/ChatCompletionContentPartTextParam'
              type: array
          title: Content
        role:
          const: tool
          title: Role
          type: string
        tool_call_id:
          title: Tool Call Id
          type: string
      required:
        - content
        - role
        - tool_call_id
      title: ChatCompletionToolMessageParam
      type: object
    ChatCompletionFunctionMessageParam:
      additionalProperties: true
      properties:
        content:
          anyOf:
            - type: string
            - type: 'null'
          title: Content
        name:
          title: Name
          type: string
        role:
          const: function
          title: Role
          type: string
      required:
        - content
        - name
        - role
      title: ChatCompletionFunctionMessageParam
      type: object
    CustomChatCompletionMessageParam:
      additionalProperties: true
      description: Chat Completion API でカスタムロールを有効にします。
      properties:
        content:
          anyOf:
            - type: string
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ChatCompletionContentPartTextParam'
                  - $ref: '#/components/schemas/ChatCompletionContentPartImageParam'
                  - $ref: >-
                      #/components/schemas/ChatCompletionContentPartInputAudioParam
                  - $ref: '#/components/schemas/File'
                  - $ref: '#/components/schemas/ChatCompletionContentPartAudioParam'
                  - $ref: '#/components/schemas/ChatCompletionContentPartVideoParam'
                  - $ref: '#/components/schemas/ChatCompletionContentPartRefusalParam'
                  - $ref: >-
                      #/components/schemas/CustomChatCompletionContentSimpleImageParam
                  - $ref: >-
                      #/components/schemas/ChatCompletionContentPartImageEmbedsParam
                  - $ref: >-
                      #/components/schemas/ChatCompletionContentPartAudioEmbedsParam
                  - $ref: >-
                      #/components/schemas/CustomChatCompletionContentSimpleAudioParam
                  - $ref: >-
                      #/components/schemas/CustomChatCompletionContentSimpleVideoParam
                  - type: string
                  - $ref: '#/components/schemas/CustomThinkCompletionContentParam'
              type: array
          title: Content
        name:
          title: Name
          type: string
        reasoning:
          anyOf:
            - type: string
            - type: 'null'
          title: Reasoning
        role:
          title: Role
          type: string
        tool_call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Call Id
        tool_calls:
          anyOf:
            - items:
                $ref: >-
                  #/components/schemas/ChatCompletionMessageFunctionToolCallParam
              type: array
            - type: 'null'
          title: Tool Calls
        tools:
          anyOf:
            - items:
                $ref: '#/components/schemas/ChatCompletionFunctionToolParam'
              type: array
            - type: 'null'
          title: Tools
      required:
        - role
      title: CustomChatCompletionMessageParam
      type: object
    Message:
      properties:
        author:
          $ref: '#/components/schemas/Author'
        channel:
          anyOf:
            - type: string
            - type: 'null'
          title: Channel
        content:
          items:
            $ref: '#/components/schemas/Content'
          title: Content
          type: array
        content_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Type
        recipient:
          anyOf:
            - type: string
            - type: 'null'
          title: Recipient
      required:
        - author
      title: Message
      type: object
    RepetitionDetectionParams:
      description: 出力トークン内の繰り返しのある N-gram パターンを検出するためのパラメーターです。
      properties:
        max_pattern_size:
          default: 0
          title: Max Pattern Size
          type: integer
        min_count:
          default: 0
          title: Min Count
          type: integer
        min_pattern_size:
          default: 0
          title: Min Pattern Size
          type: integer
      title: RepetitionDetectionParams
      type: object
    ResponseFormat:
      additionalProperties: true
      properties:
        json_schema:
          anyOf:
            - $ref: '#/components/schemas/JsonSchemaResponseFormat'
            - type: 'null'
        type:
          enum:
            - text
            - json_object
            - json_schema
          title: Type
          type: string
      required:
        - type
      title: ResponseFormat
      type: object
    StructuralTagResponseFormat:
      additionalProperties: true
      properties:
        format:
          title: Format
        type:
          const: structural_tag
          title: Type
          type: string
      required:
        - type
        - format
      title: StructuralTagResponseFormat
      type: object
    LegacyStructuralTagResponseFormat:
      additionalProperties: true
      properties:
        structures:
          items:
            $ref: '#/components/schemas/LegacyStructuralTag'
          title: Structures
          type: array
        triggers:
          items:
            type: string
          title: Triggers
          type: array
        type:
          const: structural_tag
          title: Type
          type: string
      required:
        - type
        - structures
        - triggers
      title: LegacyStructuralTagResponseFormat
      type: object
    StreamOptions:
      additionalProperties: true
      properties:
        continuous_usage_stats:
          anyOf:
            - type: boolean
            - type: 'null'
          default: false
          title: Continuous Usage Stats
        include_usage:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
          title: Include Usage
      title: StreamOptions
      type: object
    StructuredOutputsParams:
      properties:
        _backend:
          anyOf:
            - type: string
            - type: 'null'
          title: Backend
        _backend_was_auto:
          default: false
          title: Backend Was Auto
          type: boolean
        choice:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Choice
        disable_additional_properties:
          default: false
          title: Disable Additional Properties
          type: boolean
        disable_any_whitespace:
          default: false
          title: Disable Any Whitespace
          type: boolean
        disable_fallback:
          default: false
          title: Disable Fallback
          type: boolean
        grammar:
          anyOf:
            - type: string
            - type: 'null'
          title: Grammar
        json:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Json
        json_object:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Json Object
        regex:
          anyOf:
            - type: string
            - type: 'null'
          title: Regex
        structural_tag:
          anyOf:
            - type: string
            - type: 'null'
          title: Structural Tag
        whitespace_pattern:
          anyOf:
            - type: string
            - type: 'null'
          title: Whitespace Pattern
      title: StructuredOutputsParams
      type: object
    ChatCompletionNamedToolChoiceParam:
      additionalProperties: true
      properties:
        function:
          $ref: '#/components/schemas/ChatCompletionNamedFunction'
        type:
          const: function
          default: function
          title: Type
          type: string
      required:
        - function
      title: ChatCompletionNamedToolChoiceParam
      type: object
    ChatCompletionToolsParam:
      additionalProperties: true
      properties:
        function:
          $ref: '#/components/schemas/FunctionDefinition'
        type:
          const: function
          default: function
          title: Type
          type: string
      required:
        - function
      title: ChatCompletionToolsParam
      type: object
    ChatCompletionResponseChoice:
      additionalProperties: true
      properties:
        finish_reason:
          anyOf:
            - type: string
            - type: 'null'
          default: stop
          title: Finish Reason
        index:
          title: Index
          type: integer
        logprobs:
          anyOf:
            - $ref: '#/components/schemas/ChatCompletionLogProbs'
            - type: 'null'
        message:
          $ref: '#/components/schemas/ChatMessage'
        stop_reason:
          anyOf:
            - type: integer
            - type: string
            - type: 'null'
          title: Stop Reason
        token_ids:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Token Ids
      required:
        - index
        - message
      title: ChatCompletionResponseChoice
      type: object
    Logprob:
      properties:
        decoded_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Decoded Token
        logprob:
          title: Logprob
          type: number
        rank:
          anyOf:
            - type: integer
            - type: 'null'
          title: Rank
      required:
        - logprob
      title: Logprob
      type: object
    UsageInfo:
      additionalProperties: true
      properties:
        completion_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          default: 0
          title: Completion Tokens
        prompt_tokens:
          default: 0
          title: Prompt Tokens
          type: integer
        prompt_tokens_details:
          anyOf:
            - $ref: '#/components/schemas/PromptTokenUsageInfo'
            - type: 'null'
        total_tokens:
          default: 0
          title: Total Tokens
          type: integer
      title: UsageInfo
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    ChatCompletionContentPartTextParam:
      additionalProperties: true
      description: >-
        [テキスト入力](https://platform.openai.com/docs/guides/text-generation)についてはこちらをご覧ください。
      properties:
        text:
          title: Text
          type: string
        type:
          const: text
          title: Type
          type: string
      required:
        - text
        - type
      title: ChatCompletionContentPartTextParam
      type: object
    ChatCompletionContentPartImageParam:
      additionalProperties: true
      description: '[画像入力](https://platform.openai.com/docs/guides/vision)について詳しくはこちら。'
      properties:
        image_url:
          $ref: '#/components/schemas/ImageURL'
        type:
          const: image_url
          title: Type
          type: string
      required:
        - image_url
        - type
      title: ChatCompletionContentPartImageParam
      type: object
    ChatCompletionContentPartInputAudioParam:
      additionalProperties: true
      description: '[オーディオ入力](https://platform.openai.com/docs/guides/audio)についてはこちらをご覧ください。'
      properties:
        input_audio:
          $ref: '#/components/schemas/InputAudio'
        type:
          const: input_audio
          title: Type
          type: string
      required:
        - input_audio
        - type
      title: ChatCompletionContentPartInputAudioParam
      type: object
    File:
      additionalProperties: true
      description: >-
        テキスト生成の [file inputs](https://platform.openai.com/docs/guides/text)
        について確認してください。
      properties:
        file:
          $ref: '#/components/schemas/FileFile'
        type:
          const: file
          title: Type
          type: string
      required:
        - file
        - type
      title: File
      type: object
    Audio:
      additionalProperties: true
      description: |-
        モデルからの過去のオーディオレスポンスに関するデータ。
        [詳細はこちら](https://platform.openai.com/docs/guides/audio)。
      properties:
        id:
          title: Id
          type: string
      required:
        - id
      title: Audio
      type: object
    ChatCompletionContentPartRefusalParam:
      additionalProperties: true
      properties:
        refusal:
          title: Refusal
          type: string
        type:
          const: refusal
          title: Type
          type: string
      required:
        - refusal
        - type
      title: ChatCompletionContentPartRefusalParam
      type: object
    FunctionCall-Input:
      additionalProperties: true
      description: |-
        非推奨となり、`tool_calls` に置き換えられました。

        モデルによって生成された、呼び出す関数の名と引数。
      properties:
        arguments:
          title: Arguments
          type: string
        name:
          title: Name
          type: string
      required:
        - arguments
        - name
      title: FunctionCall
      type: object
    ChatCompletionMessageFunctionToolCallParam:
      additionalProperties: true
      description: モデルによって作成された function tool への call です。
      properties:
        function:
          $ref: '#/components/schemas/Function'
        id:
          title: Id
          type: string
        type:
          const: function
          title: Type
          type: string
      required:
        - id
        - function
        - type
      title: ChatCompletionMessageFunctionToolCallParam
      type: object
    ChatCompletionMessageCustomToolCallParam:
      additionalProperties: true
      description: モデルによって作成されたカスタム tool への call です。
      properties:
        custom:
          $ref: '#/components/schemas/Custom'
        id:
          title: Id
          type: string
        type:
          const: custom
          title: Type
          type: string
      required:
        - id
        - custom
        - type
      title: ChatCompletionMessageCustomToolCallParam
      type: object
    ChatCompletionContentPartAudioParam:
      additionalProperties: true
      properties:
        audio_url:
          $ref: '#/components/schemas/AudioURL'
        type:
          const: audio_url
          title: Type
          type: string
      required:
        - audio_url
        - type
      title: ChatCompletionContentPartAudioParam
      type: object
    ChatCompletionContentPartVideoParam:
      additionalProperties: true
      properties:
        type:
          const: video_url
          title: Type
          type: string
        video_url:
          $ref: '#/components/schemas/VideoURL'
      required:
        - video_url
        - type
      title: ChatCompletionContentPartVideoParam
      type: object
    CustomChatCompletionContentSimpleImageParam:
      additionalProperties: true
      description: |-
        プレーンな image_url のみを受け付ける、よりシンプルなパラメーターです。
        これは OpenAI API でサポートされていますが、ドキュメントには記載されていません。

        例:
        {
            "image_url": "https://example.com/image.jpg"
        }
      properties:
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
        uuid:
          anyOf:
            - type: string
            - type: 'null'
          title: Uuid
      title: CustomChatCompletionContentSimpleImageParam
      type: object
    ChatCompletionContentPartImageEmbedsParam:
      additionalProperties: true
      properties:
        image_embeds:
          anyOf:
            - type: string
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Image Embeds
        type:
          const: image_embeds
          title: Type
          type: string
        uuid:
          anyOf:
            - type: string
            - type: 'null'
          title: Uuid
      required:
        - type
      title: ChatCompletionContentPartImageEmbedsParam
      type: object
    ChatCompletionContentPartAudioEmbedsParam:
      additionalProperties: true
      properties:
        audio_embeds:
          anyOf:
            - type: string
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Audio Embeds
        type:
          const: audio_embeds
          title: Type
          type: string
        uuid:
          anyOf:
            - type: string
            - type: 'null'
          title: Uuid
      required:
        - type
      title: ChatCompletionContentPartAudioEmbedsParam
      type: object
    CustomChatCompletionContentSimpleAudioParam:
      additionalProperties: true
      description: |-
        プレーンな audio_url のみを accepts する、このパラメーターのよりシンプルなバージョンです。

        例:
        {
            "audio_url": "https://example.com/audio.mp3"
        }
      properties:
        audio_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Audio Url
      title: CustomChatCompletionContentSimpleAudioParam
      type: object
    CustomChatCompletionContentSimpleVideoParam:
      additionalProperties: true
      description: |-
        プレーンな audio_url のみを受け付ける、よりシンプルなパラメーターです。

        例:
        {
            "video_url": "https://example.com/video.mp4"
        }
      properties:
        uuid:
          anyOf:
            - type: string
            - type: 'null'
          title: Uuid
        video_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Video Url
      title: CustomChatCompletionContentSimpleVideoParam
      type: object
    CustomThinkCompletionContentParam:
      additionalProperties: true
      description: |-
        プレーンテキストとブール値を受け付ける Think Completion Content パラメーターです。

        例:
        {
            "thinking": "I am thinking about the answer",
            "closed": True,
            "type": "thinking"
        }
      properties:
        closed:
          title: Closed
          type: boolean
        thinking:
          title: Thinking
          type: string
        type:
          const: thinking
          title: Type
          type: string
      required:
        - thinking
        - type
      title: CustomThinkCompletionContentParam
      type: object
    ChatCompletionFunctionToolParam:
      additionalProperties: true
      description: 応答の生成に使用できる function tool です。
      properties:
        function:
          $ref: >-
            #/components/schemas/openai__types__shared_params__function_definition__FunctionDefinition
        type:
          const: function
          title: Type
          type: string
      required:
        - function
        - type
      title: ChatCompletionFunctionToolParam
      type: object
    Author:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        role:
          $ref: '#/components/schemas/Role'
      required:
        - role
      title: Author
      type: object
    Content:
      properties: {}
      title: Content
      type: object
    JsonSchemaResponseFormat:
      additionalProperties: true
      properties:
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        name:
          title: Name
          type: string
        schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Schema
        strict:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Strict
      required:
        - name
      title: JsonSchemaResponseFormat
      type: object
    LegacyStructuralTag:
      additionalProperties: true
      properties:
        begin:
          title: Begin
          type: string
        end:
          title: End
          type: string
        schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Schema
      required:
        - begin
        - end
      title: LegacyStructuralTag
      type: object
    ChatCompletionNamedFunction:
      additionalProperties: true
      properties:
        name:
          title: Name
          type: string
      required:
        - name
      title: ChatCompletionNamedFunction
      type: object
    FunctionDefinition:
      additionalProperties: true
      properties:
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        name:
          title: Name
          type: string
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parameters
      required:
        - name
      title: FunctionDefinition
      type: object
    ChatCompletionLogProbs:
      additionalProperties: true
      properties:
        content:
          anyOf:
            - items:
                $ref: '#/components/schemas/ChatCompletionLogProbsContent'
              type: array
            - type: 'null'
          title: Content
      title: ChatCompletionLogProbs
      type: object
    ChatMessage:
      additionalProperties: true
      properties:
        annotations:
          anyOf:
            - $ref: '#/components/schemas/Annotation'
            - type: 'null'
        audio:
          anyOf:
            - $ref: '#/components/schemas/ChatCompletionAudio'
            - type: 'null'
        content:
          anyOf:
            - type: string
            - type: 'null'
          title: Content
        function_call:
          anyOf:
            - $ref: '#/components/schemas/FunctionCall-Output'
            - type: 'null'
        reasoning:
          anyOf:
            - type: string
            - type: 'null'
          title: Reasoning
        refusal:
          anyOf:
            - type: string
            - type: 'null'
          title: Refusal
        role:
          title: Role
          type: string
        tool_calls:
          items:
            $ref: '#/components/schemas/ToolCall'
          title: Tool Calls
          type: array
      required:
        - role
      title: ChatMessage
      type: object
    PromptTokenUsageInfo:
      additionalProperties: true
      properties:
        cached_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cached Tokens
      title: PromptTokenUsageInfo
      type: object
    ImageURL:
      additionalProperties: true
      properties:
        detail:
          enum:
            - auto
            - low
            - high
          title: Detail
          type: string
        url:
          title: Url
          type: string
      required:
        - url
      title: ImageURL
      type: object
    InputAudio:
      additionalProperties: true
      properties:
        data:
          title: Data
          type: string
        format:
          enum:
            - wav
            - mp3
          title: Format
          type: string
      required:
        - data
        - format
      title: InputAudio
      type: object
    FileFile:
      additionalProperties: true
      properties:
        file_data:
          title: File Data
          type: string
        file_id:
          title: File Id
          type: string
        filename:
          title: Filename
          type: string
      title: FileFile
      type: object
    Function:
      additionalProperties: true
      description: モデルが呼び出した関数。
      properties:
        arguments:
          title: Arguments
          type: string
        name:
          title: Name
          type: string
      required:
        - arguments
        - name
      title: Function
      type: object
    Custom:
      additionalProperties: true
      description: モデルが call した custom tool。
      properties:
        input:
          title: Input
          type: string
        name:
          title: Name
          type: string
      required:
        - input
        - name
      title: Custom
      type: object
    AudioURL:
      additionalProperties: true
      properties:
        url:
          title: Url
          type: string
      required:
        - url
      title: AudioURL
      type: object
    VideoURL:
      additionalProperties: true
      properties:
        url:
          title: Url
          type: string
      required:
        - url
      title: VideoURL
      type: object
    openai__types__shared_params__function_definition__FunctionDefinition:
      additionalProperties: true
      properties:
        description:
          title: Description
          type: string
        name:
          title: Name
          type: string
        parameters:
          additionalProperties: true
          title: Parameters
          type: object
        strict:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Strict
      required:
        - name
      title: FunctionDefinition
      type: object
    Role:
      description: メッセージ作成者のロール（``chat::Role`` を反映）。
      enum:
        - user
        - assistant
        - system
        - developer
        - tool
      title: Role
      type: string
    ChatCompletionLogProbsContent:
      additionalProperties: true
      properties:
        bytes:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Bytes
        logprob:
          default: -9999
          title: Logprob
          type: number
        token:
          title: Token
          type: string
        top_logprobs:
          items:
            $ref: '#/components/schemas/ChatCompletionLogProb'
          title: Top Logprobs
          type: array
      required:
        - token
      title: ChatCompletionLogProbsContent
      type: object
    Annotation:
      additionalProperties: true
      description: web search を使用する際の URL 引用。
      properties:
        type:
          const: url_citation
          title: Type
          type: string
        url_citation:
          $ref: '#/components/schemas/AnnotationURLCitation'
      required:
        - type
        - url_citation
      title: Annotation
      type: object
    ChatCompletionAudio:
      additionalProperties: true
      description: >-
        オーディオ出力モダリティが要求された場合、このオブジェクトには

        モデルからのオーディオレスポンスに関するデータが含まれます。[詳細はこちら](https://platform.openai.com/docs/guides/audio)。
      properties:
        data:
          title: Data
          type: string
        expires_at:
          title: Expires At
          type: integer
        id:
          title: Id
          type: string
        transcript:
          title: Transcript
          type: string
      required:
        - id
        - data
        - expires_at
        - transcript
      title: ChatCompletionAudio
      type: object
    FunctionCall-Output:
      additionalProperties: true
      properties:
        arguments:
          title: Arguments
          type: string
        name:
          title: Name
          type: string
      required:
        - name
        - arguments
      title: FunctionCall
      type: object
    ToolCall:
      additionalProperties: true
      properties:
        function:
          $ref: '#/components/schemas/FunctionCall-Output'
        id:
          title: Id
          type: string
        type:
          const: function
          default: function
          title: Type
          type: string
      required:
        - function
      title: ToolCall
      type: object
    ChatCompletionLogProb:
      additionalProperties: true
      properties:
        bytes:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Bytes
        logprob:
          default: -9999
          title: Logprob
          type: number
        token:
          title: Token
          type: string
      required:
        - token
      title: ChatCompletionLogProb
      type: object
    AnnotationURLCitation:
      additionalProperties: true
      description: web search を使用する際の URL 引用。
      properties:
        end_index:
          title: End Index
          type: integer
        start_index:
          title: Start Index
          type: integer
        title:
          title: Title
          type: string
        url:
          title: Url
          type: string
      required:
        - end_index
        - start_index
        - title
        - url
      title: AnnotationURLCitation
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````