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

# Messages 응답 생성

> Anthropic 호환 Messages 엔드포인트입니다.



## OpenAPI

````yaml /ko/openapi.json post /v1/messages
openapi: 3.1.0
info:
  title: APIAny.AI 공개 API
  version: 1.0.0
  description: APIAny.AI의 모델 통합, 비동기 미디어 작업, 채팅 생성, 크레딧 조회 및 작업 조회를 위한 공개 API입니다.
servers:
  - url: https://apiany.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Models
    description: 공개 모델 카탈로그입니다.
  - name: Chat
    description: 텍스트 생성 및 채팅 호환 엔드포인트입니다.
  - name: Images
    description: 이미지 생성 및 이미지 편집 엔드포인트입니다.
  - name: Videos
    description: 동영상 생성 엔드포인트입니다.
  - name: Moderation
    description: Image safety and moderation endpoints.
  - name: Tasks
    description: 비동기 작업 조회입니다.
  - name: Account
    description: 계정 및 크레딧 조회입니다.
  - name: Free APIs
    description: Free utility APIs protected by API key rate limits.
paths:
  /v1/messages:
    post:
      tags:
        - Chat
      summary: Messages 응답 생성
      description: Anthropic 호환 Messages 엔드포인트입니다.
      operationId: createMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnthropicMessagesRequest'
            examples:
              basic:
                value:
                  model: minimax-m3
                  max_tokens: 512
                  messages:
                    - role: user
                      content: Draft three API documentation section titles.
      responses:
        '200':
          description: Anthropic 호환 Messages 응답입니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessagesResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    AnthropicMessagesRequest:
      type: object
      properties:
        model:
          type: string
          example: minimax-m3
        messages:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                  - user
                  - assistant
              content:
                oneOf:
                  - type: string
                  - type: array
                    items:
                      type: object
                      additionalProperties: true
            required:
              - role
              - content
        max_tokens:
          type: integer
          minimum: 1
          description: 생성할 최대 토큰 수입니다(필수).
        system:
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                additionalProperties: true
          description: 시스템 프롬프트입니다.
        temperature:
          type: number
          minimum: 0
          maximum: 1
          description: 응답에 주입되는 무작위성입니다(0–1).
        top_p:
          type: number
          minimum: 0
          maximum: 1
        top_k:
          type: integer
          description: 각 토큰에 대해 확률이 가장 높은 K개 후보에서만 샘플링합니다.
        stop_sequences:
          type: array
          items:
            type: string
          description: 생성을 중단시키는 사용자 지정 시퀀스입니다.
        tools:
          type: array
          description: >-
            모델이 호출할 수 있는 도구이며, 각 도구는 name, description, input_schema(JSON
            Schema)를 가집니다.
          items:
            type: object
            additionalProperties: true
        tool_choice:
          type: object
          additionalProperties: true
          description: '도구 선택: { type: ''auto'' } | { type: ''any'' } | { type: ''tool'', name }.'
        stream:
          type: boolean
          description: >-
            true이면 Anthropic SSE 이벤트 스트림으로 반환합니다(message_start /
            content_block_delta / message_delta / message_stop).
      required:
        - model
        - messages
        - max_tokens
    AnthropicMessagesResponse:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          example: message
        role:
          type: string
          example: assistant
        content:
          type: array
          items:
            type: object
            additionalProperties: true
        model:
          type: string
        usage:
          $ref: '#/components/schemas/TokenUsage'
      required:
        - id
        - type
        - role
        - content
        - model
    TokenUsage:
      type: object
      properties:
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        total_tokens:
          type: integer
        input_tokens:
          type: integer
        output_tokens:
          type: integer
        cached_input_tokens:
          type: integer
      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request
                - auth_error
                - rate_limit
                - insufficient_quota
                - content_policy
                - timeout
                - network_error
                - service_error
                - billable_error
                - unknown
            message:
              type: string
            param:
              type:
                - string
                - 'null'
            code:
              type:
                - string
                - 'null'
          required:
            - type
            - message
      required:
        - error
  responses:
    BadRequest:
      description: 요청 파라미터가 유효하지 않습니다.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: API 키가 없거나 API 키가 유효하지 않습니다.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key

````