> ## 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

> Задайте вопрос Lana, ИИ-агенту Solana, и получите ответ в виде потока событий или одного ответа JSON.

Каждый запрос стоит **10 000 кредитов** с `lana-thinking` или **2 000 кредитов** с `lana-fast`.

Требуется платный тариф. Запросы на бесплатном тарифе возвращают `403 Forbidden`.

Краткое руководство, сведения о потоковых событиях и обработке ошибок см. в [руководстве по Lana API](https://www.helius.dev/docs/ru/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`.

**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 сканирований за ход. Только для основной сети. Без этого параметра 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`

Часовой пояс IANA, например `America/New_York`, необходимый для обработки слова «сегодня».

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

Сеть, в которой выполняется поиск.

* `mainnet`
* `devnet`

**extensions.attachments** `array`

До 8 изображений, добавляемых к последнему сообщению пользователя. Блоки `image` в `messages` не учитываются в этом ограничении.

**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 ru/openapi/lana/openapi.yaml POST /v1/lana/messages
openapi: 3.0.3
info:
  title: Lana API
  description: >
    Lana — это ИИ-агент Solana, к которому вы обращаетесь через HTTP. Отправьте
    вопрос на естественном английском языке, и Lana найдет

    кошельки, токены, транзакции и цены, а затем ответит. API устроен аналогично
    Anthropic

    Messages API, но SDK Anthropic с ним не работают.


    ## Аутентификация


    Передайте ключ 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` статус `200` и первые события поступают, когда Lana
        впервые отвечает, или

        не позднее чем через 10 секунд. После этого событие `ping` поступает
        каждые 10 секунд. Установите

        тайм-аут чтения HTTP-клиента не менее 30 секунд; значение по умолчанию 5
        секунд, как в `httpx`,

        слишком мало. Если запрос завершается ошибкой до начала ответа,
        возвращается обычный ответ

        об ошибке с соответствующим статусом, поэтому проверяйте статус HTTP,
        прежде чем читать тело как

        поток. Если ошибка возникает после начала ответа, она поступает как
        последнее событие `error`.


        Каждый запрос имеет фиксированную стоимость: 10 000 кредитов с
        `lana-thinking` или 2 000 кредитов с

        `lana-fast`. Плата взимается за каждый запрос, получивший 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`: ход,

            завершившийся ошибкой после создания содержимого, по-прежнему
            возвращает `200` с `stop_reason: "error"`

            и объектом `error`.


            При `"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` перечисляются все недопустимые поля. Плата
            не взимается.


            Тело размером более 10 МБ отклоняется Gatekeeper с текстовым телом
            `Bad Request`.


            Если ход завершается ошибкой до начала ответа из-за того, что диалог
            не помещается

            в контекстное окно, также возвращается `400`, а `error.type` имеет
            значение `context_overflow`.
          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 (тариф Free) или настройки доступа ключа
            блокируют ее. Текстовое тело. Плата не взимается.
          content:
            text/plain:
              schema:
                type: string
        '429':
          description: >
            Плата не взимается. Возможные варианты:

            - Текст `Too Many Requests`: превышено ограничение частоты запросов
            вашего тарифа. Повторите попытку через время из `Retry-After` (1
            секунда).

            - Текст `max usage reached`: в проекте закончились кредиты.
            Заголовок `Retry-After` отсутствует; повторные попытки будут
            завершаться ошибкой, пока вы не добавите кредиты или не перейдете на
            более высокий тариф.

            - JSON с `error.type` `rate_limit_error`: в вашем проекте уже
            выполняется около 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: >-
            Все компоненты пользовательского интерфейса в виде одного дерева.
            Присутствует, когда включен `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: >
        Одно событие, отправляемое сервером. Значение `type` в JSON поля `data`
        совпадает с именем `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_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 сканирований за
            ход. Только для mainnet. Без этого параметра Lana читает до 100
            транзакций за один поиск. Та же фиксированная цена.
        user_context:
          $ref: '#/components/schemas/UserContext'
        attachments:
          type: array
          maxItems: 8
          description: >-
            До 8 изображений, добавленных к последнему сообщению пользователя.
            Блоки `image` в `messages` не учитываются в этом ограничении.
          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-thinking`, когда Lana рассуждает). Отображайте
        рассуждения отдельно от ответа или пропускайте их.
      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`, это JSON с сообщением `error` и `code`.
        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: >-
        Один компонент пользовательского интерфейса. Требует
        `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: >-
        Все компоненты пользовательского интерфейса в виде одного дерева.
        Требует `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: >-
            Часовой пояс IANA, например `America/New_York`, позволяющий
            обрабатывать слово «сегодня».
        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.