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

# Lana 메시지 생성

> Solana AI 에이전트인 Lana에게 질문하고 이벤트 스트림 또는 단일 JSON 응답으로 답변을 받습니다.

각 요청의 비용은 `lana-thinking` 사용 시 **10,000크레딧**, `lana-fast` 사용 시 **2,000크레딧**입니다.

유료 플랜이 필요합니다. 무료 플랜의 요청은 `403 Forbidden`을 반환합니다.

빠른 시작, 스트리밍 이벤트 및 오류 처리는 [Lana API 가이드](https://www.helius.dev/docs/ko/lana.md)를 참조하세요.

## 요청 매개변수

**model** `string` *required*

여러 단계의 분석에는 `lana-thinking`을 사용하며, 턴당 최대 20회의 조회 단계를 수행하고 추론 과정을 스트리밍할 수 있습니다. 빠른 조회와 단일 정보 확인에는 `lana-fast`을 사용하며, 턴당 최대 4회의 조회 단계를 수행합니다.

* `lana-thinking`
* `lana-fast`

**messages** `array` *required*

오래된 메시지부터 정렬된 대화입니다. 메시지가 하나 이상 있어야 하며, 마지막 메시지는 `role`이 `user`이어야 합니다. API는 대화를 저장하지 않으므로 요청할 때마다 전체 대화를 전송하세요.

**messages\[].role** `string` *required*

메시지를 작성한 주체입니다.

* `user`
* `assistant`

**messages\[].content** `any` *required*

비어 있지 않은 문자열 또는 비어 있지 않은 콘텐츠 블록 배열입니다. `text`은 두 역할 모두에서 허용되고, `image`과 `tool_result`은 `user` 메시지에서만 허용되며, `tool_use`은 `assistant` 메시지에서만 허용됩니다.

**max\_tokens** `number` (default: 8192)

Lana가 한 번의 모델 단계에서 작성할 수 있는 최대 출력 토큰 수입니다. 조회가 포함된 턴은 여러 단계를 거치므로 해당 턴의 전체 `output_tokens`은 더 클 수 있습니다. 2,048 미만에서는 `lana-thinking`이 추론하지 않습니다.

**stream** `boolean` (default: false)

`true`은 서버 전송 이벤트를 스트리밍합니다. `false`은 턴이 끝나면 하나의 JSON 객체를 반환합니다.

**system** `string`

"글머리 기호 세 개로 답변하세요."와 같은 추가 지침입니다. 이 지침은 Lana 자체 지침을 대체하지 않고 해당 지침에 추가됩니다.

**extensions** `object`

Lana 전용 옵션입니다. 모두 선택 사항입니다. `include_*` 옵션은 출력을 가능하게 하며, 출력 전송 여부는 Lana가 결정합니다.

**extensions.read\_only** `boolean` (default: true)

전송, 스왑 및 토큰 출시 도구를 제거합니다. `true`으로 유지하세요.

**extensions.output\_format** `string` (default: markdown)

`plain`은 Lana가 Markdown을 사용하지 않도록 하고 `{{cite:N}}` 마커를 제거합니다. `source` 이벤트는 계속 전달됩니다.

* `markdown`
* `plain`

**extensions.include\_ui\_schema** `boolean` (default: false)

`ui_block` 및 `ui_schema` 이벤트로 UI 컴포넌트를 제공할 수 있게 합니다.

**extensions.include\_followups** `boolean` (default: false)

최대 3개의 추천 후속 질문을 제공할 수 있게 합니다.

**extensions.include\_documents** `boolean` (default: false)

다운로드 가능한 CSV, JSON 또는 텍스트 파일을 `document` 이벤트로 제공할 수 있게 합니다.

**extensions.enable\_deep\_scan** `boolean` (default: false)

Lana가 주소 기록에서 최대 10,000개의 트랜잭션을 읽을 수 있게 하며, 개수와 합계를 계산할 때는 최대 50,000개까지 읽을 수 있습니다. 턴당 최대 3회 스캔합니다. Mainnet에서만 사용할 수 있습니다. 이 옵션을 사용하지 않으면 Lana는 조회당 최대 100개의 트랜잭션을 읽습니다. 동일한 정액 요금이 적용됩니다.

**extensions.user\_context** `object`

질문하는 사용자에 관한 정보입니다.

**extensions.user\_context.wallet** `string`

사용자의 주소입니다. 이를 설정하면 "내 지갑"과 "내 잔액"이 올바르게 작동합니다.

**extensions.user\_context.address\_kind** `string`

`wallet` 또는 `token`: `wallet`의 유형입니다. `wallet`이 필요합니다.

**extensions.user\_context.time\_zone** `string`

`America/New_York`과 같은 IANA 시간대입니다. 이를 설정하면 "오늘"이 올바르게 작동합니다.

**extensions.user\_context.network** `string` (default: mainnet)

조회할 네트워크입니다.

* `mainnet`
* `devnet`

**extensions.attachments** `array`

마지막 사용자 메시지에 추가되는 최대 8개의 이미지입니다. `messages`의 `image` 블록은 이 제한에 포함되지 않습니다.

**extensions.attachments\[].url** `string` *required*

이미지 URL입니다.

**extensions.attachments\[].kind** `string` *required*

항상 `image`입니다.

* `image`

**extensions.progress\_context** `object`

Orb 탐색기에서 사용합니다. 직접 사용할 필요는 없습니다.

**extensions.transaction\_filter\_context** `object`

Orb 탐색기에서 사용합니다. 직접 사용할 필요는 없습니다.


## OpenAPI

````yaml ko/openapi/lana/openapi.yaml POST /v1/lana/messages
openapi: 3.0.3
info:
  title: Lana API
  description: |
    Lana는 HTTP를 통해 호출하는 Solana AI 에이전트입니다. 일반 영어로 질문을 보내면 Lana가
    지갑, 토큰, 트랜잭션, 가격을 조회한 후 답변합니다. API 구조는 Anthropic
    Messages API와 유사하지만 Anthropic SDK는 사용할 수 없습니다.

    ## 인증

    다음 방법 중 하나로 Helius API 키를 보내세요.
    - 헤더(권장): `X-Api-Key: YOUR_API_KEY`
    - 쿼리 매개변수: `?api-key=YOUR_API_KEY`

    이 엔드포인트에서는 `Authorization: Bearer`가 작동하지 않으며 `401`을 반환합니다.
  version: 1.0.0
  contact:
    name: API 지원
    url: https://helius.dev
servers:
  - url: https://beta.helius-rpc.com
    description: Gatekeeper (베타)
security:
  - ApiKeyHeader: []
  - ApiKeyQuery: []
tags:
  - name: 메시지
    description: Lana에게 질문하기
paths:
  /v1/lana/messages:
    post:
      tags:
        - 메시지
      summary: Lana 메시지 생성
      description: |
        대화를 Lana로 보내고 답변을 반환합니다. `"stream": true`이면 답변이
        서버 전송 이벤트(`text/event-stream`)로 도착합니다. `"stream": false`(기본값)이면
        턴이 끝날 때 하나의 JSON 객체로 도착합니다.

        `"stream": true`이면 Lana가 처음 응답할 때 또는 최대 10초 후에 `200`과 첫 이벤트가
        도착하며, 그 이후에는 10초마다 `ping` 이벤트가 도착합니다. HTTP 클라이언트의 읽기
        타임아웃을 30초 이상으로 설정하세요. `httpx`와 같은 클라이언트의 기본값인 5초는
        너무 짧습니다. 응답이 시작되기 전에 실패한 요청에는 일치하는 상태의 일반 오류 응답이
        반환되므로 본문을 스트림으로 읽기 전에 HTTP 상태를 확인하세요. 응답이 시작된 후
        실패하면 최종 `error` 이벤트로 도착합니다.

        각 요청에는 `lana-thinking` 사용 시 10,000크레딧, `lana-fast` 사용 시
        2,000크레딧이 정액으로 부과됩니다. 턴이 어떻게 종료되든 HTTP `200`을 받은 모든 요청에는
        요금이 부과됩니다. 응답이 시작되기 전에 실패한 요청은 다른 상태를 받으며 무료입니다.
        유료 플랜에서만 사용할 수 있습니다.
      operationId: createLanaMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessagesRequest'
            examples:
              nonStreaming:
                summary: 비스트리밍
                value:
                  model: lana-thinking
                  messages:
                    - role: user
                      content: 현재 SOL 가격은 얼마인가요?
                  extensions:
                    read_only: true
              streaming:
                summary: 스트리밍
                value:
                  model: lana-thinking
                  stream: true
                  messages:
                    - role: user
                      content: >-
                        EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v의 최대 보유자는
                        누구인가요?
                  extensions:
                    read_only: true
      responses:
        '200':
          description: |
            턴이 실행되었습니다. `"stream": false`이면 하나의 JSON 객체가 반환됩니다. `stop_reason`을
            확인하세요. 콘텐츠를 생성한 후 실패한 턴도 `stop_reason: "error"`와 `error` 객체를
            포함하여 `200`을 반환합니다.

            `"stream": true`이면 서버 전송 이벤트 스트림이 반환됩니다. 각 이벤트는
            `event: <type>` 줄과 `data: <json>` 줄로 구성되며 그 뒤에 빈 줄이 옵니다. 스트림은
            `message_start`로 시작하고 항상 `message_end` 또는 `error`로 끝납니다. 새로운 이벤트
            유형과 필드가 추가될 수 있으므로 인식하지 못하는 항목은 무시하세요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
            text/event-stream:
              schema:
                $ref: '#/components/schemas/StreamEvent'
              example: >
                event: message_start

                data:
                {"type":"message_start","message":{"id":"msg_3f9c...","model":"lana-thinking"}}


                event: tool_use

                data:
                {"type":"tool_use","tool_use_id":"toolu_01...","name":"...","input":{"mint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}


                event: tool_result

                data:
                {"type":"tool_result","tool_use_id":"toolu_01...","content":"{\"holders\":[..."}


                event: content_block_delta

                data:
                {"type":"content_block_delta","delta":{"type":"text_delta","text":"최대
                USDC 보유자는"}}


                event: message_end

                data:
                {"type":"message_end","stop_reason":"end_turn","usage":{"input_tokens":91200,"output_tokens":212,"tool_calls":1,"prompt_tokens":46100,"context_window":200000}}
        '400':
          description: |
            본문이 유효하지 않습니다. 예를 들어 알 수 없는 모델이나 필드가 있거나 `max_tokens`가
            8,192를 초과했습니다. `message`는 잘못된 각 필드의 이름을 표시합니다. 요금은 부과되지 않습니다.

            10MB를 초과하는 본문은 Gatekeeper에서 일반 텍스트 `Bad Request` 본문과 함께 거부됩니다.

            대화가 컨텍스트 창에 맞지 않아 응답 시작 전에 턴이 실패한 경우에도 `error.type`이
            `context_overflow`인 `400`이 반환됩니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                type: error
                error:
                  type: invalid_request_error
                  message: 'max_tokens: max_tokens must be <= 8192'
            text/plain:
              schema:
                type: string
              example: Bad Request
        '401':
          description: >
            API 키가 없거나 유효하지 않거나 `Authorization: Bearer`로 전송되었습니다. 일반 텍스트 본문입니다.
            요금은 부과되지 않습니다.
          content:
            text/plain:
              schema:
                type: string
        '403':
          description: >-
            플랜에 Lana가 포함되지 않았거나(무료 플랜) 키의 액세스 설정에서 차단했습니다. 일반 텍스트 본문입니다. 요금은
            부과되지 않습니다.
          content:
            text/plain:
              schema:
                type: string
        '429':
          description: >
            요금은 부과되지 않습니다. 다음 중 하나입니다.

            - 일반 텍스트 `Too Many Requests`: 플랜의 요청 한도를 초과했습니다. `Retry-After`(1초) 후
            다시 시도하세요.

            - 일반 텍스트 `max usage reached`: 프로젝트의 크레딧이 소진되었습니다. `Retry-After`가 없으며
            크레딧을 추가하거나 업그레이드할 때까지 재시도에 실패합니다.

            - `error.type`이 `rate_limit_error`인 JSON: 프로젝트에서 이미 약 3개의 Lana 요청을
            실행 중입니다. `Retry-After`(5초) 후 다시 시도하세요.
          headers:
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            text/plain:
              schema:
                type: string
              example: Too Many Requests
        '500':
          description: 응답이 시작되기 전에 `api_error`로 턴이 실패했습니다. 요금은 부과되지 않습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: 응답이 시작되기 전에 `tool_error`로 턴이 실패했습니다. 요금은 부과되지 않습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: >-
            Lana의 처리 용량이 가득 찼거나 재시작 중입니다. `Retry-After`(처리 용량 초과 시 5초, 재시작 중에는
            30초) 후 다시 시도하세요. 요금은 부과되지 않습니다.
          headers:
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: 응답이 시작되기 전에 `timeout_error`로 턴이 실패했습니다. 요금은 부과되지 않습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '529':
          description: >-
            응답이 시작되기 전에 `overloaded_error`로 턴이 실패했습니다. 일부 HTTP 클라이언트는 `529`를
            인식하지 못하므로 `503`과 동일하게 처리하세요. 요금은 부과되지 않습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    MessagesRequest:
      type: object
      additionalProperties: false
      required:
        - model
        - messages
      properties:
        model:
          type: string
          enum:
            - lana-thinking
            - lana-fast
          description: >-
            다단계 분석에는 `lana-thinking`을 사용하며 턴당 최대 20단계까지 조회할 수 있고 추론을 스트리밍할 수
            있습니다. 빠른 조회와 단일 사실 확인에는 `lana-fast`를 사용하며 턴당 최대 4단계까지 조회할 수 있습니다.
          example: lana-thinking
        messages:
          type: array
          minItems: 1
          description: >-
            오래된 순서로 정렬된 대화입니다. 메시지가 하나 이상 필요하며 마지막 메시지의 `role`은 `user`여야 합니다.
            API는 대화를 저장하지 않으므로 요청할 때마다 전체 대화를 보내세요.
          items:
            $ref: '#/components/schemas/Message'
        max_tokens:
          type: integer
          minimum: 1
          maximum: 8192
          default: 8192
          description: >-
            Lana가 한 모델 단계에서 작성할 수 있는 최대 출력 토큰 수입니다. 조회가 포함된 턴은 여러 단계를 거치므로 턴의 총
            `output_tokens`는 더 클 수 있습니다. 2,048 미만에서는 `lana-thinking`이 추론하지 않습니다.
        stream:
          type: boolean
          default: false
          description: '`true`이면 서버 전송 이벤트를 스트리밍합니다. `false`이면 턴이 끝날 때 하나의 JSON 객체를 반환합니다.'
        system:
          type: string
          minLength: 1
          maxLength: 10000
          description: '"글머리 기호 세 개로 답변하세요."와 같은 추가 지침입니다. Lana 자체 지침을 대체하지 않고 해당 지침에 추가됩니다.'
        extensions:
          $ref: '#/components/schemas/Extensions'
    MessageResponse:
      type: object
      description: 비스트리밍 응답입니다. 답변은 순서대로 연결한 `text` 블록입니다.
      required:
        - id
        - type
        - role
        - model
        - content
        - stop_reason
        - usage
      properties:
        id:
          type: string
          example: msg_3f9c...
        type:
          type: string
          enum:
            - message
        role:
          type: string
          enum:
            - assistant
        model:
          type: string
          enum:
            - lana-thinking
            - lana-fast
        content:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/TextBlock'
              - $ref: '#/components/schemas/ToolUseBlock'
              - $ref: '#/components/schemas/ToolResultBlock'
        stop_reason:
          $ref: '#/components/schemas/StopReason'
        usage:
          $ref: '#/components/schemas/Usage'
        ui_schema:
          type: object
          description: >-
            모든 UI 구성 요소를 하나의 트리로 나타냅니다. `include_ui_schema`가 활성화되어 있고 표시할 항목이 있을
            때 존재합니다.
        documents:
          type: array
          description: '`include_documents`가 활성화되어 있고 Lana가 파일을 만들었을 때 존재합니다.'
          items:
            $ref: '#/components/schemas/Document'
        follow_up:
          type: array
          description: '`include_followups`가 활성화되어 있고 Lana가 질문을 제안했을 때 존재합니다.'
          items:
            type: string
        sources:
          type: array
          description: Lana가 웹 페이지를 사용했을 때 존재합니다.
          items:
            $ref: '#/components/schemas/Source'
        error:
          $ref: '#/components/schemas/ErrorObject'
      example:
        id: msg_3f9c...
        type: message
        role: assistant
        model: lana-thinking
        content:
          - type: tool_use
            id: toolu_01...
            name: ...
            input:
              mint: So11111111111111111111111111111111111111112
          - type: tool_result
            tool_use_id: toolu_01...
            content: '{"price":...'
          - type: text
            text: SOL은 현재 ...에 거래되고 있습니다.
        stop_reason: end_turn
        usage:
          input_tokens: 90800
          output_tokens: 96
          tool_calls: 1
          prompt_tokens: 45600
          context_window: 200000
    StreamEvent:
      description: >
        서버 전송 이벤트 하나입니다. `data` JSON의 `type`은 `event` 이름과 일치합니다. 순서는 다음과 같습니다.

        1. `message_start`: 항상 첫 번째입니다.

        2. `content_block_delta`, `tool_use`, `tool_result`, `source`,
        `ui_block`, `document`, `progress_update`, `ping`이 임의로 조합됩니다.

        3. `ui_schema`: 최대 한 번입니다.

        4. `follow_up`: 최대 한 번입니다.

        5. 턴이 완료되면 `message_end`, 실패하면 `error`입니다. 항상 마지막입니다.
      oneOf:
        - $ref: '#/components/schemas/MessageStartEvent'
        - $ref: '#/components/schemas/ContentBlockDeltaEvent'
        - $ref: '#/components/schemas/ToolUseEvent'
        - $ref: '#/components/schemas/ToolResultEvent'
        - $ref: '#/components/schemas/SourceEvent'
        - $ref: '#/components/schemas/ProgressUpdateEvent'
        - $ref: '#/components/schemas/UiBlockEvent'
        - $ref: '#/components/schemas/DocumentEvent'
        - $ref: '#/components/schemas/UiSchemaEvent'
        - $ref: '#/components/schemas/FollowUpEvent'
        - $ref: '#/components/schemas/MessageEndEvent'
        - $ref: '#/components/schemas/ErrorEvent'
        - $ref: '#/components/schemas/PingEvent'
    ErrorResponse:
      type: object
      required:
        - type
        - error
      properties:
        type:
          type: string
          enum:
            - error
        error:
          $ref: '#/components/schemas/ErrorObject'
    Message:
      type: object
      additionalProperties: false
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
          description: 메시지를 작성한 주체입니다.
        content:
          description: >-
            비어 있지 않은 문자열 또는 비어 있지 않은 콘텐츠 블록 배열입니다. `text`는 두 역할 모두에서 허용되고,
            `image`와 `tool_result`는 `user` 메시지에서만, `tool_use`는 `assistant`
            메시지에서만 허용됩니다.
          oneOf:
            - type: string
              minLength: 1
            - type: array
              minItems: 1
              items:
                $ref: '#/components/schemas/ContentBlock'
    Extensions:
      type: object
      additionalProperties: false
      description: >-
        Lana 전용 옵션입니다. 모두 선택 사항입니다. `include_*` 옵션은 해당 출력을 가능하게 하며 실제 전송 여부는
        Lana가 결정합니다.
      properties:
        read_only:
          type: boolean
          default: true
          description: 전송, 스왑, 토큰 출시 도구를 제거합니다. `true`로 유지하세요.
        output_format:
          type: string
          enum:
            - markdown
            - plain
          default: markdown
          description: >-
            `plain`은 Lana에 Markdown을 사용하지 말라고 지시하고 `{{cite:N}}` 마커를 제거합니다.
            `source` 이벤트는 계속 도착합니다.
        include_ui_schema:
          type: boolean
          default: false
          description: UI 구성 요소를 `ui_block` 및 `ui_schema` 이벤트로 허용합니다.
        include_followups:
          type: boolean
          default: false
          description: 최대 3개의 추천 후속 질문을 허용합니다.
        include_documents:
          type: boolean
          default: false
          description: 다운로드 가능한 CSV, JSON 또는 텍스트 파일을 `document` 이벤트로 허용합니다.
        enable_deep_scan:
          type: boolean
          default: false
          description: >-
            Lana가 주소 기록에서 최대 10,000개의 트랜잭션(개수 및 합계의 경우 50,000개)을 읽을 수 있게 하며 턴당
            최대 3회 스캔할 수 있습니다. 메인넷에서만 사용할 수 있습니다. 이 옵션이 없으면 Lana는 조회당 최대 100개의
            트랜잭션을 읽습니다. 정액 요금은 동일합니다.
        user_context:
          $ref: '#/components/schemas/UserContext'
        attachments:
          type: array
          maxItems: 8
          description: >-
            마지막 사용자 메시지에 추가되는 최대 8개의 이미지입니다. `messages`의 `image` 블록은 이 한도에 포함되지
            않습니다.
          items:
            $ref: '#/components/schemas/Attachment'
        progress_context:
          type: object
          description: Orb 탐색기에서 사용합니다. 사용할 필요가 없습니다.
        transaction_filter_context:
          type: object
          description: Orb 탐색기에서 사용합니다. 사용할 필요가 없습니다.
    TextBlock:
      type: object
      additionalProperties: false
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - text
        text:
          type: string
          minLength: 1
    ToolUseBlock:
      type: object
      additionalProperties: false
      description: 이전 턴에서 수행한 조회를 Lana가 반환한 그대로 재현한 것입니다. `assistant` 메시지에서만 사용할 수 있습니다.
      required:
        - type
        - id
        - name
        - input
      properties:
        type:
          type: string
          enum:
            - tool_use
        id:
          type: string
        name:
          type: string
        input:
          type: object
          additionalProperties: true
    ToolResultBlock:
      type: object
      additionalProperties: false
      description: 재현된 조회의 결과입니다. `user` 메시지에서만 사용할 수 있습니다.
      required:
        - type
        - tool_use_id
        - content
      properties:
        type:
          type: string
          enum:
            - tool_result
        tool_use_id:
          type: string
        content:
          type: string
        is_error:
          type: boolean
    StopReason:
      type: string
      enum:
        - end_turn
        - max_tokens
        - tool_use
        - error
      description: |
        - `end_turn`: Lana가 답변을 완료했습니다.
        - `max_tokens`: 답변이 `max_tokens`에 도달하여 잘렸을 수 있습니다.
        - `tool_use`: 조회 단계에서 턴이 종료되었습니다. 일반적으로 단계 한도에 도달한 경우입니다.
        - `error`: 턴이 실패했습니다. 답변이 완전하지 않습니다.
    Usage:
      type: object
      required:
        - input_tokens
        - output_tokens
        - tool_calls
        - prompt_tokens
      properties:
        input_tokens:
          type: integer
          description: 전체 턴의 입력 토큰입니다.
        output_tokens:
          type: integer
          description: 전체 턴의 출력 토큰입니다.
        tool_calls:
          type: integer
          description: 턴에서 실행된 조회 수입니다. `tool_use`로 표시되지 않은 일부 조회도 포함됩니다.
        prompt_tokens:
          type: integer
          description: 마지막 모델 단계의 입력 토큰입니다. 컨텍스트가 얼마나 찼는지 확인할 때 사용하세요.
        context_window:
          type: integer
          description: 모델의 컨텍스트 창입니다. 현재 값은 `200000`입니다.
    Document:
      type: object
      required:
        - filename
        - format
        - content
      properties:
        tool_use_id:
          type: string
        filename:
          type: string
        format:
          type: string
          enum:
            - csv
            - json
            - txt
        content:
          type: string
        description:
          type: string
    Source:
      type: object
      required:
        - index
        - url
        - title
      properties:
        index:
          type: integer
          description: 답변의 `{{cite:N}}` 마커와 일치합니다.
        url:
          type: string
        title:
          type: string
        snippet:
          type: string
    ErrorObject:
      type: object
      required:
        - type
        - message
      properties:
        type:
          type: string
          description: >
            `message`가 아닌 이 값을 기준으로 분기하세요. 알려진 값은 `invalid_request_error`,
            `context_overflow`,

            `overloaded_error`, `timeout_error`, `tool_error`,
            `rate_limit_error`, `api_error`입니다.

            그 외의 값은 모두 `api_error`와 동일하게 처리하세요.
          example: invalid_request_error
        message:
          type: string
    MessageStartEvent:
      type: object
      title: message_start
      description: 턴이 시작되었습니다.
      required:
        - type
        - message
      properties:
        type:
          type: string
          enum:
            - message_start
        message:
          type: object
          required:
            - id
            - model
          properties:
            id:
              type: string
            model:
              type: string
              enum:
                - lana-thinking
                - lana-fast
    ContentBlockDeltaEvent:
      type: object
      title: content_block_delta
      description: >-
        답변 조각(`text_delta`) 또는 Lana의 추론 조각(`thinking_delta`, Lana가 추론할 때
        `lana-thinking`에서만 제공)입니다. 추론은 답변과 분리해 표시하거나 생략하세요.
      required:
        - type
        - delta
      properties:
        type:
          type: string
          enum:
            - content_block_delta
        delta:
          oneOf:
            - type: object
              title: text_delta
              required:
                - type
                - text
              properties:
                type:
                  type: string
                  enum:
                    - text_delta
                text:
                  type: string
            - type: object
              title: thinking_delta
              required:
                - type
                - thinking
              properties:
                type:
                  type: string
                  enum:
                    - thinking_delta
                thinking:
                  type: string
    ToolUseEvent:
      type: object
      title: tool_use
      description: Lana가 조회를 시작했습니다. 진행률 표시에만 사용하세요. 도구 이름과 입력은 변경될 수 있습니다.
      required:
        - type
        - tool_use_id
        - name
        - input
      properties:
        type:
          type: string
          enum:
            - tool_use
        tool_use_id:
          type: string
        name:
          type: string
        input:
          type: object
          additionalProperties: true
    ToolResultEvent:
      type: object
      title: tool_result
      description: 조회가 완료되었습니다. 조회 실패가 턴 실패로 이어지지는 않으며 Lana가 우회하여 처리합니다.
      required:
        - type
        - tool_use_id
        - content
      properties:
        type:
          type: string
          enum:
            - tool_result
        tool_use_id:
          type: string
        content:
          type: string
          description: >-
            최대 500자의 미리보기입니다. `is_error`가 `true`이면 `error` 메시지와 `code`가 포함된
            JSON입니다.
        is_error:
          type: boolean
    SourceEvent:
      type: object
      title: source
      description: Lana가 사용한 웹 페이지입니다.
      required:
        - type
        - index
        - url
        - title
      properties:
        type:
          type: string
          enum:
            - source
        index:
          type: integer
          description: 답변의 `{{cite:N}}` 마커와 일치합니다.
        url:
          type: string
        title:
          type: string
        snippet:
          type: string
    ProgressUpdateEvent:
      type: object
      title: progress_update
      description: 긴 턴이 진행되는 동안 표시되는 짧은 상태 문구입니다. 답변과 분리해 표시하세요.
      required:
        - type
        - id
        - message
        - created_at
      properties:
        type:
          type: string
          enum:
            - progress_update
        id:
          type: string
        message:
          type: string
        created_at:
          type: integer
          description: Unix 밀리초입니다.
    UiBlockEvent:
      type: object
      title: ui_block
      description: UI 구성 요소 하나입니다. `include_ui_schema`가 필요합니다.
      required:
        - type
        - component
        - schema
      properties:
        type:
          type: string
          enum:
            - ui_block
        tool_use_id:
          type: string
        component:
          type: string
        schema:
          type: object
    DocumentEvent:
      type: object
      title: document
      description: 다운로드 가능한 파일입니다. `include_documents`가 필요합니다.
      required:
        - type
        - filename
        - format
        - content
      properties:
        type:
          type: string
          enum:
            - document
        tool_use_id:
          type: string
        filename:
          type: string
        format:
          type: string
          enum:
            - csv
            - json
            - txt
        content:
          type: string
        description:
          type: string
    UiSchemaEvent:
      type: object
      title: ui_schema
      description: 모든 UI 구성 요소를 하나의 트리로 나타냅니다. `include_ui_schema`가 필요합니다. 최대 한 번만 전송됩니다.
      required:
        - type
        - schema
      properties:
        type:
          type: string
          enum:
            - ui_schema
        schema:
          type: object
    FollowUpEvent:
      type: object
      title: follow_up
      description: 추천 후속 질문입니다. `include_followups`가 필요합니다. 최대 한 번만 전송됩니다.
      required:
        - type
        - suggestions
      properties:
        type:
          type: string
          enum:
            - follow_up
        suggestions:
          type: array
          items:
            type: string
    MessageEndEvent:
      type: object
      title: message_end
      description: >-
        턴이 완료되었습니다. `stop_reason`이 `error`이면 `api_error`처럼 처리하세요. 그 전에 받은 답변
        텍스트는 불완전합니다.
      required:
        - type
        - stop_reason
        - usage
      properties:
        type:
          type: string
          enum:
            - message_end
        stop_reason:
          $ref: '#/components/schemas/StopReason'
        usage:
          $ref: '#/components/schemas/Usage'
    ErrorEvent:
      type: object
      title: error
      description: 스트림이 시작된 후 턴이 실패했습니다. 그 전에 받은 답변 텍스트는 불완전합니다.
      required:
        - type
        - error
      properties:
        type:
          type: string
          enum:
            - error
        error:
          $ref: '#/components/schemas/ErrorObject'
    PingEvent:
      type: object
      title: ping
      description: 10초마다 전송되는 하트비트입니다. 무시하세요.
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - ping
    ContentBlock:
      oneOf:
        - $ref: '#/components/schemas/TextBlock'
        - $ref: '#/components/schemas/ImageBlock'
        - $ref: '#/components/schemas/ToolUseBlock'
        - $ref: '#/components/schemas/ToolResultBlock'
    UserContext:
      type: object
      additionalProperties: false
      description: 질문하는 사용자입니다.
      properties:
        wallet:
          type: string
          minLength: 1
          maxLength: 128
          description: 사용자의 주소입니다. 이를 통해 "내 지갑"과 "내 잔액" 같은 표현을 사용할 수 있습니다.
        address_kind:
          type: string
          minLength: 1
          maxLength: 32
          description: '`wallet` 또는 `token`: `wallet`이 무엇인지 지정합니다. `wallet`이 필요합니다.'
        time_zone:
          type: string
          minLength: 1
          maxLength: 64
          description: '`America/New_York`와 같은 IANA 시간대입니다. 이를 통해 "오늘" 같은 표현을 사용할 수 있습니다.'
        network:
          type: string
          enum:
            - mainnet
            - devnet
          default: mainnet
          description: 조회할 네트워크입니다.
    Attachment:
      type: object
      additionalProperties: false
      required:
        - url
        - kind
      properties:
        url:
          type: string
          format: uri
          description: 이미지 URL입니다.
        kind:
          type: string
          enum:
            - image
          description: 항상 `image`입니다.
    ImageBlock:
      type: object
      additionalProperties: false
      description: URL로 지정한 이미지입니다. `user` 메시지에서만 사용할 수 있습니다. Base64 이미지는 지원되지 않습니다.
      required:
        - type
        - source
      properties:
        type:
          type: string
          enum:
            - image
        source:
          type: object
          additionalProperties: false
          required:
            - type
            - url
          properties:
            type:
              type: string
              enum:
                - url
            url:
              type: string
              format: uri
  headers:
    RetryAfter:
      description: 다시 시도하기 전에 기다릴 시간(초)입니다.
      schema:
        type: integer
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-Api-Key
      description: Helius API 키입니다.
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: Helius API 키입니다.

````

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