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

# Créer un message Lana

> Posez une question à Lana, un agent d’IA Solana, et obtenez la réponse sous forme de flux d’événements ou d’une réponse JSON unique.

Chaque requête coûte **10 000 crédits** avec `lana-thinking` ou **2 000 crédits** avec `lana-fast`.

Nécessite une offre payante. Les requêtes avec l’offre gratuite renvoient `403 Forbidden`.

Pour consulter le guide de démarrage rapide, la diffusion d’événements et la gestion des erreurs, reportez-vous au [guide de l’API Lana](https://www.helius.dev/docs/fr/lana.md).

## Paramètres de la requête

**model** `string` *required*

`lana-thinking` pour une analyse en plusieurs étapes, avec jusqu’à 20 étapes de recherche par échange ; ce modèle peut diffuser son raisonnement. `lana-fast` pour les recherches rapides et les faits isolés, avec jusqu’à 4 étapes de recherche par échange.

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

**messages** `array` *required*

La conversation, du message le plus ancien au plus récent. Elle doit contenir au moins un message, et le dernier doit avoir `role` `user`. L’API ne stocke pas les conversations ; envoyez la conversation complète avec chaque requête.

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

L’auteur du message.

* `user`
* `assistant`

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

Une chaîne non vide ou un tableau non vide de blocs de contenu. `text` est autorisé pour les deux rôles, `image` et `tool_result` uniquement dans les messages `user`, et `tool_use` uniquement dans les messages `assistant`.

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

Le nombre maximal de tokens de sortie que Lana peut générer au cours d’une étape du modèle. Un échange comprenant des recherches nécessite plusieurs étapes ; son `output_tokens` total peut donc être supérieur. En dessous de 2 048, `lana-thinking` n’effectue aucun raisonnement.

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

`true` diffuse des événements envoyés par le serveur. `false` renvoie un seul objet JSON à la fin de l’échange.

**system** `string`

Des instructions supplémentaires, comme « Répondez en trois points. » Elles s’ajoutent aux propres instructions de Lana et ne les remplacent pas.

**extensions** `object`

Options propres à Lana. Elles sont toutes facultatives. Les options `include_*` permettent de produire une sortie ; Lana décide de l’envoyer ou non.

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

Supprime les outils de transfert, d’échange et de lancement de jetons. Laissez la valeur `true`.

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

`plain` indique à Lana de ne pas utiliser Markdown et supprime les marqueurs `{{cite:N}}`. Les événements `source` sont toujours reçus.

* `markdown`
* `plain`

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

Autorise les composants d’interface utilisateur sous forme d’événements `ui_block` et `ui_schema`.

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

Autorise jusqu’à 3 suggestions de questions complémentaires.

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

Autorise les fichiers CSV, JSON ou texte téléchargeables sous forme d’événements `document`.

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

Permet à Lana de lire jusqu’à 10 000 transactions dans l’historique d’une adresse (50 000 pour les comptages et les totaux), avec jusqu’à 3 analyses par échange. Réseau principal uniquement. Sans cette option, Lana lit jusqu’à 100 transactions par recherche. Le tarif forfaitaire reste identique.

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

Identité de la personne qui pose la question.

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

L’adresse de l’utilisateur, afin que « mon portefeuille » et « mon solde » fonctionnent.

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

`wallet` ou `token` : ce que représente `wallet`. Nécessite `wallet`.

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

Un fuseau horaire IANA, tel que `America/New_York`, afin que « aujourd’hui » fonctionne.

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

Le réseau dans lequel effectuer la recherche.

* `mainnet`
* `devnet`

**extensions.attachments** `array`

Jusqu’à 8 images ajoutées au dernier message de l’utilisateur. Les blocs `image` dans `messages` ne sont pas pris en compte dans cette limite.

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

L’URL de l’image.

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

Toujours `image`.

* `image`

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

Utilisé par l’explorateur Orb. Vous n’en avez pas besoin.

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

Utilisé par l’explorateur Orb. Vous n’en avez pas besoin.


## OpenAPI

````yaml openapi/lana/openapi.yaml POST /v1/lana/messages
openapi: 3.0.3
info:
  title: Lana API
  description: >
    Lana is a Solana AI agent you call over HTTP. Send a question in plain
    English, and Lana looks up

    wallets, tokens, transactions, and prices, then answers. The API is shaped
    like the Anthropic

    Messages API, but the Anthropic SDKs don't work with it.


    ## Authentication


    Send your Helius API key in one of these ways:

    - Header (recommended): `X-Api-Key: YOUR_API_KEY`

    - Query parameter: `?api-key=YOUR_API_KEY`


    `Authorization: Bearer` doesn't work on this endpoint and returns `401`.
  version: 1.0.0
  contact:
    name: API Support
    url: https://helius.dev
servers:
  - url: https://beta.helius-rpc.com
    description: Gatekeeper (Beta)
security:
  - ApiKeyHeader: []
  - ApiKeyQuery: []
tags:
  - name: Messages
    description: Ask Lana a question
paths:
  /v1/lana/messages:
    post:
      tags:
        - Messages
      summary: Create a Lana message
      description: >
        Sends a conversation to Lana and returns its answer. With `"stream":
        true`, the answer

        arrives as server-sent events (`text/event-stream`). With `"stream":
        false` (the default),

        it arrives as one JSON object when the turn ends.


        With `"stream": true`, the `200` and the first events arrive when Lana
        first responds, or

        after 10 seconds at most, and a `ping` event arrives every 10 seconds
        after that. Set

        your HTTP client's read timeout to 30 seconds or more; a 5-second
        default, as in `httpx`,

        is too short. A request that fails before the response starts gets a
        normal error

        response with the matching status, so check the HTTP status before you
        read the body as a

        stream. After the response starts, a failure arrives as a final `error`
        event.


        Each request costs a flat 10,000 credits with `lana-thinking` or 2,000
        credits with

        `lana-fast`. Every request that gets HTTP `200` is charged, however the
        turn ends.

        Requests that fail before the response starts get another status and are
        free. Paid

        plans only.
      operationId: createLanaMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessagesRequest'
            examples:
              nonStreaming:
                summary: Non-streaming
                value:
                  model: lana-thinking
                  messages:
                    - role: user
                      content: What is the current price of SOL?
                  extensions:
                    read_only: true
              streaming:
                summary: Streaming
                value:
                  model: lana-thinking
                  stream: true
                  messages:
                    - role: user
                      content: >-
                        Who are the largest holders of
                        EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v?
                  extensions:
                    read_only: true
      responses:
        '200':
          description: >
            The turn ran. With `"stream": false`, one JSON object. Check
            `stop_reason`: a turn

            that fails after producing content still returns `200`, with
            `stop_reason: "error"`

            and an `error` object.


            With `"stream": true`, a stream of server-sent events. Each event is
            an

            `event: <type>` line and a `data: <json>` line, followed by a blank
            line. The stream

            starts with `message_start` and always ends with `message_end` or
            `error`. New event

            types and fields can be added; ignore any you don't recognize.
          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":"The
                largest USDC holders are"}}


                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: >
            The body is invalid, for example an unknown model, an unknown field,
            or a `max_tokens`

            over 8,192. `message` names each bad field. Not charged.


            A body over 10 MB is rejected by Gatekeeper with a plain-text `Bad
            Request` body.


            A turn that fails before the response starts because the
            conversation doesn't fit

            in the context window also returns `400`, with `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: >
            The API key is missing or invalid, or was sent as `Authorization:
            Bearer`. Plain-text body. Not charged.
          content:
            text/plain:
              schema:
                type: string
        '403':
          description: >-
            Your plan doesn't include Lana (the Free plan), or your key's access
            settings block it. Plain-text body. Not charged.
          content:
            text/plain:
              schema:
                type: string
        '429':
          description: >
            Not charged. One of:

            - Plain-text `Too Many Requests`: you're over your plan's rate
            limit. Retry after `Retry-After` (1 second).

            - Plain-text `max usage reached`: your project is out of credits. No
            `Retry-After`; retrying fails until you add credits or upgrade.

            - JSON with `error.type` `rate_limit_error`: your project already
            has about 3 Lana requests running. Retry after `Retry-After` (5
            seconds).
          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: >-
            The turn failed with `api_error` before the response started. Not
            charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: >-
            The turn failed with `tool_error` before the response started. Not
            charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: >-
            Lana is at capacity or restarting. Retry after `Retry-After` (5
            seconds at capacity, 30 while restarting). Not charged.
          headers:
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: >-
            The turn failed with `timeout_error` before the response started.
            Not charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '529':
          description: >-
            The turn failed with `overloaded_error` before the response started.
            Some HTTP clients don't recognize `529`; handle it like `503`. Not
            charged.
          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` for multi-step analysis, with up to 20 lookup steps
            per turn; it can stream reasoning. `lana-fast` for quick lookups and
            single facts, with up to 4 lookup steps per turn.
          example: lana-thinking
        messages:
          type: array
          minItems: 1
          description: >-
            The conversation, oldest first. It needs at least one message, and
            the last one must have `role` `user`. The API doesn't store
            conversations; send the whole conversation on every request.
          items:
            $ref: '#/components/schemas/Message'
        max_tokens:
          type: integer
          minimum: 1
          maximum: 8192
          default: 8192
          description: >-
            The most output tokens Lana can write in one model step. A turn with
            lookups takes several steps, so the turn's total `output_tokens` can
            be higher. Below 2,048, `lana-thinking` doesn't reason.
        stream:
          type: boolean
          default: false
          description: >-
            `true` streams server-sent events. `false` returns one JSON object
            when the turn ends.
        system:
          type: string
          minLength: 1
          maxLength: 10000
          description: >-
            Extra instructions, such as "Answer in three bullet points." They're
            added to Lana's own instructions, not used in place of them.
        extensions:
          $ref: '#/components/schemas/Extensions'
    MessageResponse:
      type: object
      description: >-
        The non-streaming response. The answer is the `text` blocks, joined in
        order.
      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: >-
            All UI components as one tree. Present when `include_ui_schema` is
            on and there's something to show.
        documents:
          type: array
          description: Present when `include_documents` is on and Lana made files.
          items:
            $ref: '#/components/schemas/Document'
        follow_up:
          type: array
          description: Present when `include_followups` is on and Lana suggested questions.
          items:
            type: string
        sources:
          type: array
          description: Present when Lana used web pages.
          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 is trading at ...
        stop_reason: end_turn
        usage:
          input_tokens: 90800
          output_tokens: 96
          tool_calls: 1
          prompt_tokens: 45600
          context_window: 200000
    StreamEvent:
      description: >
        One server-sent event. The `data` JSON's `type` matches the `event`
        name. Order:

        1. `message_start`, always first.

        2. Any mix of `content_block_delta`, `tool_use`, `tool_result`,
        `source`, `ui_block`, `document`, `progress_update`, and `ping`.

        3. `ui_schema`, at most once.

        4. `follow_up`, at most once.

        5. `message_end` if the turn finished, or `error` if it failed. Always
        last.
      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: Who wrote the message.
        content:
          description: >-
            A non-empty string, or a non-empty array of content blocks. `text`
            is allowed in both roles, `image` and `tool_result` only in `user`
            messages, and `tool_use` only in `assistant` messages.
          oneOf:
            - type: string
              minLength: 1
            - type: array
              minItems: 1
              items:
                $ref: '#/components/schemas/ContentBlock'
    Extensions:
      type: object
      additionalProperties: false
      description: >-
        Lana-only options. All are optional. The `include_*` options make output
        possible; Lana decides whether to send it.
      properties:
        read_only:
          type: boolean
          default: true
          description: Removes the transfer, swap, and token-launch tools. Leave it `true`.
        output_format:
          type: string
          enum:
            - markdown
            - plain
          default: markdown
          description: >-
            `plain` tells Lana not to use Markdown and removes `{{cite:N}}`
            markers. `source` events still arrive.
        include_ui_schema:
          type: boolean
          default: false
          description: Allows UI components, as `ui_block` and `ui_schema` events.
        include_followups:
          type: boolean
          default: false
          description: Allows up to 3 suggested follow-up questions.
        include_documents:
          type: boolean
          default: false
          description: Allows downloadable CSV, JSON, or text files, as `document` events.
        enable_deep_scan:
          type: boolean
          default: false
          description: >-
            Lets Lana read up to 10,000 transactions of an address's history
            (50,000 for counts and totals), up to 3 scans per turn. Mainnet
            only. Without it, Lana reads up to 100 transactions per lookup. Same
            flat price.
        user_context:
          $ref: '#/components/schemas/UserContext'
        attachments:
          type: array
          maxItems: 8
          description: >-
            Up to 8 images added to the last user message. `image` blocks in
            `messages` don't count toward this limit.
          items:
            $ref: '#/components/schemas/Attachment'
        progress_context:
          type: object
          description: Used by the Orb explorer. You don't need it.
        transaction_filter_context:
          type: object
          description: Used by the Orb explorer. You don't need it.
    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: >-
        A lookup from an earlier turn, replayed as Lana returned it. `assistant`
        messages only.
      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: The result of a replayed lookup. `user` messages only.
      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 finished its answer.

        - `max_tokens`: the answer hit `max_tokens` and may be cut off.

        - `tool_use`: the turn ended on a lookup step, usually at the step
        limit.

        - `error`: the turn failed. The answer is incomplete.
    Usage:
      type: object
      required:
        - input_tokens
        - output_tokens
        - tool_calls
        - prompt_tokens
      properties:
        input_tokens:
          type: integer
          description: Input tokens for the whole turn.
        output_tokens:
          type: integer
          description: Output tokens for the whole turn.
        tool_calls:
          type: integer
          description: >-
            Lookups run in the turn, including some that never appear as
            `tool_use`.
        prompt_tokens:
          type: integer
          description: >-
            Input tokens in the last model step. Use it to see how full the
            context is.
        context_window:
          type: integer
          description: The model's context window, currently `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: Matches the `{{cite:N}}` markers in the answer.
        url:
          type: string
        title:
          type: string
        snippet:
          type: string
    ErrorObject:
      type: object
      required:
        - type
        - message
      properties:
        type:
          type: string
          description: >
            Branch on this, not on `message`. Known values:
            `invalid_request_error`, `context_overflow`,

            `overloaded_error`, `timeout_error`, `tool_error`,
            `rate_limit_error`, `api_error`.

            Treat any other value like `api_error`.
          example: invalid_request_error
        message:
          type: string
    MessageStartEvent:
      type: object
      title: message_start
      description: The turn started.
      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: >-
        A chunk of the answer (`text_delta`), or of Lana's reasoning
        (`thinking_delta`, `lana-thinking` only, when Lana reasons). Show
        reasoning apart from the answer, or skip it.
      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 started a lookup. Use it for progress indicators only; tool names
        and inputs can change.
      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: >-
        A lookup finished. A failed lookup doesn't fail the turn; Lana works
        around it.
      required:
        - type
        - tool_use_id
        - content
      properties:
        type:
          type: string
          enum:
            - tool_result
        tool_use_id:
          type: string
        content:
          type: string
          description: >-
            A preview of up to 500 characters. When `is_error` is `true`, JSON
            with an `error` message and a `code`.
        is_error:
          type: boolean
    SourceEvent:
      type: object
      title: source
      description: A web page Lana used.
      required:
        - type
        - index
        - url
        - title
      properties:
        type:
          type: string
          enum:
            - source
        index:
          type: integer
          description: Matches the `{{cite:N}}` markers in the answer.
        url:
          type: string
        title:
          type: string
        snippet:
          type: string
    ProgressUpdateEvent:
      type: object
      title: progress_update
      description: A short status line during a long turn. Show it apart from the answer.
      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 milliseconds.
    UiBlockEvent:
      type: object
      title: ui_block
      description: One UI component. Needs `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: A downloadable file. Needs `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: All UI components as one tree. Needs `include_ui_schema`. At most once.
      required:
        - type
        - schema
      properties:
        type:
          type: string
          enum:
            - ui_schema
        schema:
          type: object
    FollowUpEvent:
      type: object
      title: follow_up
      description: Suggested next questions. Needs `include_followups`. At most once.
      required:
        - type
        - suggestions
      properties:
        type:
          type: string
          enum:
            - follow_up
        suggestions:
          type: array
          items:
            type: string
    MessageEndEvent:
      type: object
      title: message_end
      description: >-
        The turn finished. With `stop_reason` `error`, treat it like an
        `api_error`; any answer text before it is partial.
      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: >-
        The turn failed after the stream started. Any answer text before it is
        partial.
      required:
        - type
        - error
      properties:
        type:
          type: string
          enum:
            - error
        error:
          $ref: '#/components/schemas/ErrorObject'
    PingEvent:
      type: object
      title: ping
      description: A heartbeat every 10 seconds. Ignore it.
      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: Who's asking.
      properties:
        wallet:
          type: string
          minLength: 1
          maxLength: 128
          description: The user's address, so "my wallet" and "my balance" work.
        address_kind:
          type: string
          minLength: 1
          maxLength: 32
          description: '`wallet` or `token`: what `wallet` is. Needs `wallet`.'
        time_zone:
          type: string
          minLength: 1
          maxLength: 64
          description: An IANA time zone, such as `America/New_York`, so "today" works.
        network:
          type: string
          enum:
            - mainnet
            - devnet
          default: mainnet
          description: The network to look up.
    Attachment:
      type: object
      additionalProperties: false
      required:
        - url
        - kind
      properties:
        url:
          type: string
          format: uri
          description: The image URL.
        kind:
          type: string
          enum:
            - image
          description: Always `image`.
    ImageBlock:
      type: object
      additionalProperties: false
      description: An image by URL. `user` messages only. Base64 images aren't supported.
      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: Seconds to wait before retrying.
      schema:
        type: integer
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-Api-Key
      description: Your Helius API key.
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: Your Helius API key.

````

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