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

# MiniMax-M3.1-Flash - Anthropic 호환 API

> - Anthropic Messages 프로토콜로 MiniMax-M3.1-Flash 모델을 호출합니다
- 요청 및 응답 구조가 Anthropic API와 호환됩니다
- **멀티모달 대화**: `content`에 텍스트, 이미지, 비디오 콘텐츠 블록을 전달할 수 있습니다
- **시스템 프롬프트**: 최상위 `system` 필드로 전달합니다
- **추론 모드**: 항상 활성화되며 `output_config.effort`로 추론 깊이를 조절합니다. 추론 내용은 `content[type=thinking]` 블록으로 반환됩니다
- **스트리밍**: SSE 이벤트 스트림을 지원합니다
- **도구 호출**: Anthropic `tool_use` / `tool_result` 흐름과 호환됩니다

**스트리밍 이벤트**: `message_start` → `content_block_start` → `content_block_delta` (`thinking_delta` / `signature_delta` / `text_delta` / `input_json_delta`) → `content_block_stop` → `message_delta` → `message_stop` 순서이며 중간에 `ping`이 포함될 수 있습니다. 최종 사용량은 `message_delta` 이벤트의 `usage`를 기준으로 합니다.

<Note>
  **BaseURL**: 기본 BaseURL은 `https://direct.evolink.ai`이며, 텍스트 모델과 장시간 연결을 더 잘 지원합니다. `https://api.evolink.ai`는 멀티모달 서비스의 기본 엔드포인트이자 텍스트 모델의 대체 주소 역할을 합니다.
</Note>


## OpenAPI

````yaml ko/api-manual/language-series/minimax-m3.1-flash/minimax-m3.1-flash-messages.json POST /v1/messages
openapi: 3.1.0
info:
  title: MiniMax-M3.1-Flash Anthropic 호환 API
  description: >-
    Anthropic Messages 프로토콜로 호출하는 MiniMax-M3.1-Flash API의 전체 참조 문서입니다.


    **호환성**:

    - 경로: `/v1/messages` (Anthropic 표준 경로)

    - 요청 및 응답 구조가 Anthropic Messages API와 동일합니다

    - 지원 필드: `model`, `messages` (필수), `system`, `max_tokens`, `temperature`,
    `top_p`, `stream`, `thinking`, `output_config`, `tools`, `tool_choice`,
    `metadata`


    **모델 기능**:

    - 컨텍스트 길이: **1,000,000 tokens** (1M)

    - 최대 출력: **524,288 tokens** (512K), 권장 출력: **131,072 tokens** (128K). 추론 토큰이
    포함됩니다

    - 추론 모드: 항상 활성화되며 `output_config.effort`로 추론 깊이를 조절합니다. 기본값은 `max`이며, 추론 내용은
    `content[type=thinking]` 블록으로 반환됩니다

    - 멀티모달 입력: 텍스트, 이미지, 비디오 콘텐츠 블록 지원

    - 컨텍스트 캐시: 동일한 접두사를 자동으로 재사용하며, 캐시 적중 토큰 수는 `usage.cache_read_input_tokens`에
    표시됩니다


    멀티턴 대화에서는 `thinking` (`signature` 포함) 및 `tool_use`를 포함한 전체 assistant 콘텐츠 블록을
    수정하지 않고 다시 전달하세요.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: 프로덕션 (권장)
  - url: https://api.evolink.ai
    description: 대체 URL
security:
  - bearerAuth: []
tags:
  - name: Messages
    description: Anthropic Messages 프로토콜 인터페이스
paths:
  /v1/messages:
    post:
      tags:
        - Messages
      summary: MiniMax-M3.1-Flash Messages API (Anthropic 호환)
      description: >-
        - Anthropic Messages 프로토콜로 MiniMax-M3.1-Flash 모델을 호출합니다

        - 요청 및 응답 구조가 Anthropic API와 호환됩니다

        - **멀티모달 대화**: `content`에 텍스트, 이미지, 비디오 콘텐츠 블록을 전달할 수 있습니다

        - **시스템 프롬프트**: 최상위 `system` 필드로 전달합니다

        - **추론 모드**: 항상 활성화되며 `output_config.effort`로 추론 깊이를 조절합니다. 추론 내용은
        `content[type=thinking]` 블록으로 반환됩니다

        - **스트리밍**: SSE 이벤트 스트림을 지원합니다

        - **도구 호출**: Anthropic `tool_use` / `tool_result` 흐름과 호환됩니다


        **스트리밍 이벤트**: `message_start` → `content_block_start` →
        `content_block_delta` (`thinking_delta` / `signature_delta` /
        `text_delta` / `input_json_delta`) → `content_block_stop` →
        `message_delta` → `message_stop` 순서이며 중간에 `ping`이 포함될 수 있습니다. 최종 사용량은
        `message_delta` 이벤트의 `usage`를 기준으로 합니다.
      operationId: createMessageMiniMaxM31Flash
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMessageRequest'
            examples:
              simple:
                summary: 최소 실행 가능 요청
                value:
                  model: MiniMax-M3.1-Flash
                  max_tokens: 131072
                  messages:
                    - role: user
                      content: Hello! How can you help me?
              system_prompt:
                summary: 시스템 프롬프트 사용
                value:
                  model: MiniMax-M3.1-Flash
                  max_tokens: 131072
                  system: >-
                    You are a technical editor. Keep your answers clear and
                    concise.
                  messages:
                    - role: user
                      content: >-
                        Describe the benefits of clear technical documentation
                        in three sentences.
              effort:
                summary: 추론 깊이 조절 (output_config.effort)
                value:
                  model: MiniMax-M3.1-Flash
                  max_tokens: 131072
                  output_config:
                    effort: high
                  messages:
                    - role: user
                      content: >-
                        A bat and a ball cost 1.10 in total. The bat costs 1.00
                        more than the ball. How much does the ball cost?
              image_understanding:
                summary: 이미지 이해(멀티모달 콘텐츠 블록)
                value:
                  model: MiniMax-M3.1-Flash
                  max_tokens: 131072
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: What is shown in this image?
                        - type: image
                          source:
                            type: url
                            url: https://example.com/image.jpeg
              video_understanding:
                summary: 비디오 이해 (멀티모달 콘텐츠 블록)
                value:
                  model: MiniMax-M3.1-Flash
                  max_tokens: 131072
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: Summarize this video.
                        - type: video
                          source:
                            type: url
                            url: https://example.com/video.mp4
                            fps: 1
              tool_use:
                summary: 도구 호출(Anthropic tool_use 스타일)
                value:
                  model: MiniMax-M3.1-Flash
                  max_tokens: 131072
                  messages:
                    - role: user
                      content: Check the stock for product demo-item-001.
                  tools:
                    - name: get_product_stock
                      description: Get the current stock level for a product.
                      input_schema:
                        type: object
                        properties:
                          product_id:
                            type: string
                            description: Product identifier.
                        required:
                          - product_id
                  tool_choice:
                    type: auto
              streaming:
                summary: 스트리밍 출력(SSE)
                value:
                  model: MiniMax-M3.1-Flash
                  max_tokens: 131072
                  stream: true
                  messages:
                    - role: user
                      content: Write a short poem about spring.
      responses:
        '200':
          description: 메시지 객체
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
              examples:
                with_thinking:
                  summary: 추론 내용이 포함된 응답 (thinking 블록)
                  value:
                    id: 072514f09a86ce2abb0c5c3930f924fb
                    type: message
                    role: assistant
                    model: MiniMax-M3.1-Flash
                    content:
                      - thinking: Let the ball cost x. Then 2x + 1 = 1.10, so x = 0.05.
                        signature: >-
                          84eddf556420e0cc237f8f50212216543e8add2ddd931c9a271d2a5a95689333
                        type: thinking
                      - text: '0.05'
                        type: text
                    usage:
                      input_tokens: 55
                      output_tokens: 66
                      cache_creation_input_tokens: 0
                      cache_read_input_tokens: 174
                      output_tokens_details:
                        thinking_tokens: 63
                    stop_reason: end_turn
                    base_resp:
                      status_code: 0
                      status_msg: ''
                direct_answer:
                  summary: 직접 답변 (추론 내용 없음)
                  value:
                    id: 072514d15927960e42b730074205a1c6
                    type: message
                    role: assistant
                    model: MiniMax-M3.1-Flash
                    content:
                      - text: >-
                          Recursion is a technique in which a function calls
                          itself to solve smaller instances of a problem.
                        type: text
                    usage:
                      input_tokens: 23
                      output_tokens: 6
                      cache_creation_input_tokens: 0
                      cache_read_input_tokens: 184
                    stop_reason: end_turn
                    base_resp:
                      status_code: 0
                      status_msg: ''
                tool_use:
                  summary: 도구 호출 트리거(stop_reason=tool_use)
                  value:
                    id: 072514d3fb0f7ce9f7c9fdd22755fffc
                    type: message
                    role: assistant
                    model: MiniMax-M3.1-Flash
                    content:
                      - type: tool_use
                        id: call_function_ih2iv0ggec0p_1
                        name: get_product_stock
                        input:
                          product_id: demo-item-001
                    usage:
                      input_tokens: 283
                      output_tokens: 31
                      cache_creation_input_tokens: 0
                      cache_read_input_tokens: 174
                    stop_reason: tool_use
                    base_resp:
                      status_code: 0
                      status_msg: ''
        '400':
          description: 요청 매개변수 오류
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                request_id: req_xxx
                error:
                  type: invalid_request_error
                  message: Invalid request
        '401':
          description: 인증 오류
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: authentication_error
                  message: Authentication error
        '402':
          description: 할당량 부족
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: billing_error
                  message: Insufficient quota
        '403':
          description: 권한 오류
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: permission_error
                  message: Permission denied
        '404':
          description: 모델 또는 리소스를 찾을 수 없음
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: not_found_error
                  message: Model not found
        '429':
          description: 속도 제한 초과
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: rate_limit_error
                  message: Rate limited
        '500':
          description: 서버 내부 오류
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: 게이트웨이 오류
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: 서비스를 일시적으로 사용할 수 없음
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateMessageRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: 호출할 모델
          enum:
            - MiniMax-M3.1-Flash
          example: MiniMax-M3.1-Flash
        max_tokens:
          type: integer
          description: >-
            생성할 토큰의 최대 수로, **추론과 답변을 모두 포함합니다**


            **설명**:

            - 권장: **131,072** (128K), 최대: **524,288** (512K)

            - 값이 너무 작으면 추론 단계에서 한도에 도달하여 text 내용 없이 `stop_reason=max_tokens`가
            반환될 수 있습니다
          minimum: 1
          maximum: 524288
          example: 131072
        messages:
          type: array
          description: |-
            대화 메시지 목록, 턴마다 user / assistant 교대

            **설명**:
            - 최소 1개의 메시지를 포함해야 함
            - 마지막 메시지는 일반적으로 `role=user`
          items:
            $ref: '#/components/schemas/InputMessage'
          minItems: 1
        system:
          description: >-
            AI의 역할과 동작을 설정하는 시스템 프롬프트입니다. 문자열 또는 텍스트 콘텐츠 블록 배열을 지원하며 최상위
            `system` 필드로 전달합니다.
          oneOf:
            - type: string
              example: You are a helpful assistant.
            - type: array
              description: 콘텐츠 블록 배열 형식의 시스템 프롬프트입니다.
              items:
                type: object
                required:
                  - type
                  - text
                properties:
                  type:
                    type: string
                    enum:
                      - text
                  text:
                    type: string
        temperature:
          type: number
          description: |-
            샘플링 온도입니다

            **설명**:
            - 범위: `[0, 2]`, 기본값: 1
            - 값이 높을수록 출력이 다양해지고, 낮을수록 더 결정적입니다
            - temperature와 top_p를 동시에 조정하지 않는 것을 권장합니다
          minimum: 0
          maximum: 2
          default: 1
          example: 1
        top_p:
          type: number
          description: |-
            누적 확률 샘플링 임계값입니다

            **설명**:
            - 범위: `[0, 1]`, 기본값: 0.95
            - temperature와 top_p를 동시에 조정하지 않는 것을 권장합니다
          minimum: 0
          maximum: 1
          default: 0.95
          example: 0.95
        stream:
          type: boolean
          description: |-
            SSE 스트리밍으로 반환할지 여부

            - `true`: Server-Sent Events 스트리밍 반환
            - `false`: 완전한 응답 후 한 번에 반환(기본값)
          default: false
          example: false
        thinking:
          type: object
          description: >-
            추론 모드입니다. MiniMax-M3.1-Flash는 항상 추론을 수행합니다. `adaptive`만 지원하며 생략할 수
            있습니다. 추론 내용은 `type="thinking"` 블록으로 반환되며 출력 토큰 요금이 적용됩니다.
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - adaptive
              default: adaptive
        output_config:
          type: object
          description: 출력 설정
          properties:
            effort:
              type: string
              description: 추론 깊이입니다. 기본값은 `max`이며, 높은 단계일수록 일반적으로 추론 토큰 사용량과 응답 시간이 증가합니다.
              enum:
                - low
                - medium
                - high
                - xhigh
                - max
              default: max
              example: high
        tools:
          type: array
          description: |-
            도구 정의 목록

            **설명**:
            - Anthropic tool 정의 규범을 따름
            - `input_schema`는 JSON Schema 객체를 사용
          items:
            $ref: '#/components/schemas/Tool'
        tool_choice:
          type: object
          description: 도구 선택 전략입니다. 모델이 도구 호출 여부를 결정하는 `auto`만 지원합니다.
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - auto
        metadata:
          type: object
          description: 요청 메타데이터
          properties:
            user_id:
              type: string
              description: >-
                종단 사용자를 나타내는 고유 식별자로, 사용자 단위 모니터링 및 남용 탐지에 사용할 수 있습니다(해시 처리된 ID
                사용 권장)
    MessageResponse:
      type: object
      description: Anthropic 스타일의 메시지 응답
      properties:
        id:
          type: string
          description: 메시지 고유 ID
        type:
          type: string
          enum:
            - message
          description: 응답 객체 유형
        role:
          type: string
          enum:
            - assistant
        model:
          type: string
          description: 실제 사용된 모델
          example: MiniMax-M3.1-Flash
        content:
          type: array
          description: |-
            응답 콘텐츠 블록 목록입니다

            **포함될 수 있는 블록 유형**:
            - `thinking`: 추론 과정 (간단한 질문에서는 생성되지 않을 수 있습니다)
            - `text`: 최종 답변 텍스트
            - `tool_use`: 모델이 시작한 도구 호출
          items:
            $ref: '#/components/schemas/OutputContentBlock'
        stop_reason:
          type: string
          description: |-
            정지 사유

            - `end_turn`: 자연스러운 종료
            - `max_tokens`: max_tokens 상한 도달
            - `tool_use`: 모델이 도구 호출을 트리거
          enum:
            - end_turn
            - max_tokens
            - tool_use
        usage:
          $ref: '#/components/schemas/AnthropicUsage'
        base_resp:
          type: object
          description: 상태 코드 및 오류 상세
          properties:
            status_code:
              type: integer
              description: 상태 코드입니다. `0`은 성공을 의미합니다.
            status_msg:
              type: string
              description: 오류 상세
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - error
        error:
          type: object
          properties:
            type:
              type: string
              description: >-
                오류 유형(예: invalid_request_error / authentication_error /
                billing_error 등)
            message:
              type: string
              description: 오류 설명
        request_id:
          type: string
          description: 요청 추적 ID
    InputMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
          description: >-
            메시지 발신자의 역할로 user와 assistant가 번갈아 사용됩니다


            - `user`: 사용자 메시지이며 `tool_result` 블록을 반환할 때도 사용합니다

            - `assistant`: 이전 어시스턴트 응답이며 `text` / `thinking` / `tool_use` 블록을
            포함할 수 있습니다


            시스템 프롬프트는 최상위 `system` 필드로 전달합니다.
        content:
          description: >-
            메시지 내용


            **설명**:

            - 순수 텍스트일 경우 문자열을 직접 전달

            - 구조화된 경우 content block 배열을 전달(`text` / `image` / `video` /
            `tool_use` / `tool_result` / `thinking`)
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ContentBlock'
    Tool:
      type: object
      required:
        - name
        - input_schema
      properties:
        name:
          type: string
          description: |-
            도구 이름

            **설명**:
            - `a-zA-Z0-9_-`만 허용
            - 최대 64자
        description:
          type: string
          description: 도구 기능 설명, 모델이 언제 호출할지 판단하도록 도움
        input_schema:
          type: object
          description: |-
            도구 입력 파라미터의 JSON Schema 객체

            **설명**:
            - `type`은 반드시 `object`여야 함
            - `properties`와 `required`를 선언해야 함
    OutputContentBlock:
      type: object
      description: 응답 내의 콘텐츠 블록
      properties:
        type:
          type: string
          enum:
            - text
            - thinking
            - tool_use
        text:
          type: string
          description: type=`text`일 때의 텍스트
        thinking:
          type: string
          description: type=`thinking`일 때의 추론 과정 텍스트
        signature:
          type: string
          description: type=`thinking`일 때의 무결성 서명, 멀티턴 컨텍스트 검증에 사용
        id:
          type: string
          description: type=`tool_use`일 때의 도구 호출 ID
        name:
          type: string
          description: type=`tool_use`일 때의 도구 이름
        input:
          type: object
          description: type=`tool_use`일 때 모델이 생성한 JSON 입력 파라미터
    AnthropicUsage:
      type: object
      description: Token 사용 통계(Anthropic 규범)
      properties:
        input_tokens:
          type: integer
          description: 캐시에 적중하지 않은 입력 토큰 수로, `cache_read_input_tokens`는 포함하지 않습니다.
          example: 55
        output_tokens:
          type: integer
          description: 출력 token 수(thinking 포함)
          example: 66
        cache_creation_input_tokens:
          type: integer
          description: 캐시 생성에 사용된 입력 토큰 수로, 자동 캐시에서는 0입니다.
          example: 0
        cache_read_input_tokens:
          type: integer
          description: >-
            캐시에 적중한 입력 토큰 수로, 캐시 적중 요금이 적용됩니다. 전체 입력 = `input_tokens +
            cache_read_input_tokens`입니다.
          example: 174
        output_tokens_details:
          type: object
          description: 출력 token 상세 내역
          properties:
            thinking_tokens:
              type: integer
              description: 추론 과정에서 생성된 토큰 수로, `output_tokens`에 이미 포함되어 있습니다.
              example: 63
    ContentBlock:
      type: object
      description: >-
        메시지 콘텐츠 블록입니다


        **지원하는 type**:

        - `text`: 텍스트 내용

        - `image`: 이미지 입력 (URL 또는 base64, JPEG / PNG / GIF / WEBP)

        - `video`: 비디오 입력 (URL, base64 또는 `mm_file://{file_id}`, MP4 / AVI / MOV
        / MKV)

        - `tool_use`: 이전 턴의 assistant 도구 호출을 다시 전달합니다

        - `tool_result`: 도구 실행 결과

        - `thinking`: 이전 턴의 assistant 추론 내용을 `signature`와 함께 다시 전달합니다
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - text
            - image
            - video
            - tool_use
            - tool_result
            - thinking
        text:
          type: string
          description: type=`text`일 때의 텍스트 내용
        source:
          $ref: '#/components/schemas/MediaSource'
          description: 이미지 또는 비디오 소스로, type=`image` 또는 type=`video`에서 사용합니다.
        id:
          type: string
          description: 도구 호출 ID(tool_use 시 필수)
        name:
          type: string
          description: 도구 이름(tool_use 시 필수)
        input:
          type: object
          description: 도구 입력 파라미터(tool_use 시, JSON 객체)
        tool_use_id:
          type: string
          description: 대응하는 도구 호출 ID(tool_result 시 필수, tool_use.id에 매핑)
        content:
          description: 도구 실행 결과(tool_result), 문자열 또는 content block 배열
          oneOf:
            - type: string
            - type: array
              items:
                type: object
        thinking:
          type: string
          description: 이전 어시스턴트 메시지의 추론 내용으로, `type=thinking`에서 사용합니다.
        signature:
          type: string
          description: 추론 내용의 서명입니다. 멀티턴 대화에서는 수정하지 않고 다시 전달해야 합니다.
    MediaSource:
      type: object
      description: >-
        이미지 또는 비디오 콘텐츠 블록의 미디어 소스입니다


        - 이미지: JPEG / PNG / GIF / WEBP를 지원하며 이미지당 최대 10 MB입니다

        - 비디오: MP4 / AVI / MOV / MKV를 지원하며 URL / Base64 입력은 최대 50 MB입니다. 더 큰
        비디오는 `mm_file://{file_id}` 파일 참조로 전달합니다

        - 요청 본문의 최대 크기는 64 MB입니다
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - base64
            - url
          description: 미디어 소스 유형
        media_type:
          type: string
          description: 'base64 입력 시 필수, 예: `image/png` 또는 `video/mp4`'
        data:
          type: string
          description: base64로 인코딩된 미디어 바이트
        url:
          type: string
          description: 공개 URL; 비디오는 `mm_file://{file_id}` 형식의 파일 참조도 사용 가능
        detail:
          type: string
          enum:
            - low
            - default
            - high
          default: default
          description: 이해 정밀도, 기본값 default. 해상도가 높을수록 token 소비가 많아짐
        fps:
          type: number
          minimum: 0.2
          maximum: 5
          default: 1
          description: >-
            비디오 프레임 추출 빈도입니다. 기본값은 1이며 범위는 [0.2, 5]입니다. 빈도가 높을수록 화면 변화를 더 잘 포착할
            수 있지만 일반적으로 토큰 사용량도 증가합니다.
        max_long_side_pixel:
          type: integer
          minimum: 1
          description: 이미지 또는 비디오 프레임 최장변 픽셀 제약
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        모든 인터페이스는 Bearer Token 인증이 필요합니다


        **API Key 발급**:


        [API Key 관리 페이지](https://evolink.ai/dashboard/keys)에 방문하여 API Key를
        발급받으세요


        **요청 헤더에 추가**:

        ```

        Authorization: Bearer YOUR_API_KEY

        ```


        **참고**: EvoLink는 `/v1/messages`에 대해 Bearer Token 인증을 통일적으로 사용합니다.

````

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