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

# Chat Completionを作成

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



## OpenAPI

````yaml /ja/serverless-training/api-reference/openapi.json post /v1/chat/completions
openapi: 3.1.0
info:
  title: Serverless Training
  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:
        messages:
          items:
            additionalProperties: true
            type: object
          title: Messages
          type: array
        model:
          title: Model
          type: string
      required:
        - model
        - messages
      title: ChatCompletionRequest
      type: object
    ChatCompletionResponse:
      additionalProperties: true
      properties:
        choices:
          items:
            $ref: '#/components/schemas/ChatChoice'
          title: Choices
          type: array
      title: ChatCompletionResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ChatChoice:
      additionalProperties: true
      properties:
        message:
          anyOf:
            - $ref: '#/components/schemas/ChatMessage'
            - type: 'null'
      title: ChatChoice
      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
    ChatMessage:
      additionalProperties: true
      properties:
        content:
          title: Content
      title: ChatMessage
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````