Skip to main content
The Lana API is a Solana AI agent you call over HTTP. You send it a question in plain English, and it looks up wallets, tokens, transactions, and prices for you, then streams back an answer. Lana runs every lookup on the Helius side, so you don’t define or run any tools. It’s available on paid Helius plans (Developer and above), at a flat price per request: 2,000 credits for lana-fast and 10,000 credits for lana-thinking. See Pricing. The API is shaped like the Anthropic Messages API, but the Anthropic SDKs don’t work with it. Call it over plain HTTP, as in the examples below. See Differences from the Anthropic Messages API. Lana runs on Anthropic’s Claude models. Your questions and conversation are sent to Anthropic to generate answers.
The Lana API is in beta on the Gatekeeper (Beta) endpoint, beta.helius-rpc.com. It isn’t available on mainnet.helius-rpc.com yet. New events and fields can be added during the beta.

What you can ask Lana

  • “Who are the largest holders of this token?”
  • “What is the current price of SOL?”
  • “How did my wallet do this week?”
  • “Which programs did this wallet use most over its last 5,000 transactions?”
  • “Export the top holders of this token as a CSV.”

Quickstart

1

Get an API key

Copy an API key from the Helius Dashboard.
2

Ask a question

Replace YOUR_API_KEY and run:
cURL
-N makes curl print each event as soon as it arrives.
3

Read the answer

The response is a stream of events:
The answer is the text_delta chunks, in order. With lana-thinking, you can also get thinking_delta chunks: that’s Lana’s reasoning, so show it apart from the answer, or skip it.

Read the stream in code

Both examples check the HTTP status, print the answer as it streams, and stop if the turn fails or the stream ends early.

Differences from the Anthropic Messages API

  • The models are lana-fast and lana-thinking.
  • Lana runs its own tools. tools, tool_choice, temperature, top_p, top_k, stop_sequences, and metadata return 400.
  • system is added to Lana’s instructions.
  • max_tokens is optional (default and maximum 8,192), and images must be URLs.
  • The events are different. There’s no content_block_start, content_block_stop, message_delta, or message_stop. The stream ends with message_end or error.
  • usage adds tool_calls, prompt_tokens, and context_window. stop_reason can be error.
  • extensions is Lana-only.

Endpoint and authentication

Send your Helius API key in one of these ways: Authorization: Bearer doesn’t work on this endpoint and returns 401. Send Content-Type: application/json on every request.
Your API key spends your plan’s credits. Call Lana from your server, not from a browser or an app you ship to users.

Request body

The body is a JSON object. Unknown fields are rejected with 400, including unknown fields inside extensions and content blocks.
string
required
lana-fast or lana-thinking. See Models.
object[]
required
The conversation, oldest first. It needs at least one message, and the last one must have role: "user". See Messages.
integer
default:"8192"
The most output tokens Lana can write in one model step, from 1 to 8192. A turn with lookups takes several steps, so the turn’s total output_tokens can be higher than max_tokens. Below 2,048, lana-thinking doesn’t reason.
boolean
default:"false"
true streams events. false returns one JSON response when the turn ends.
string
Extra instructions, from 1 to 10,000 characters, such as “Answer in three bullet points.” They’re added to Lana’s own instructions, not used in place of them.
object
Lana-only options. See Extensions.

Models

lana-thinking only reasons when max_tokens is 2048 or higher.

Messages

Each message has a role (user or assistant) and content:
The API doesn’t store conversations. To ask a follow-up, send the whole conversation again with the new question at the end. Lana’s answer text is enough for the assistant turns:
Lana only looks up addresses that appear in the conversation, in its own lookup results, or in extensions.user_context.wallet. content is a non-empty string or a non-empty array of blocks: Images must be URLs. Base64 images aren’t supported. You don’t need tool_use or tool_result blocks. They let you replay the lookups from an earlier turn, as Lana returned them, so Lana can reuse those results. tool_result also takes an optional is_error boolean.

Extensions

All extensions are optional. The include_* options make output possible. Lana decides whether to send it. extensions also accepts progress_context and transaction_filter_context. The Orb explorer uses them, and you don’t need them. user_context fields:

Streaming events

With "stream": true, you get status 200 and Content-Type: text/event-stream. Each event looks like this:
data is one line of JSON. Its type matches the event name. Events arrive in this 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. This is always the last event.
New event types and fields can be added. Ignore any you don’t recognize. Tips for showing a stream:
  • Use tool_use for progress indicators only. Tool names and inputs can change.
  • With "markdown" output, turn each {{cite:N}} into a link to the source with that index, or remove it.
  • ui_block and ui_schema carry the same components. Lana may send only ui_schema, so show ui_block events if they arrive and otherwise render ui_schema.
  • Web searches send a tool_result with the text Web search completed. or Web fetch completed. The pages arrive as source events.

Tool errors

A failed lookup doesn’t fail the turn. Lana works around it, and you don’t need to retry. The tool_result has is_error: true, and content is JSON with a short message and a code:
New codes can be added. Treat an unknown code as internal.

Stop reasons

stop_reason is on message_end and in the JSON response:

Usage

Lana’s own instructions and lookup tools take about 45,000 tokens on every model step, so input_tokens is high even for a short question. Pricing is per request, so token counts don’t change what you pay.

Non-streaming response

With "stream": false, you get one JSON object when the turn ends:
The answer is the text blocks, joined in order. Reasoning and progress_update are streaming only. These fields appear only when they have a value:

Errors

Before the stream starts

These return a non-200 status, even with "stream": true. No events are sent, and you aren’t charged. The first two 429s come from your plan, and the response body says which one you hit. The third comes from Lana and has a JSON body. Lana’s own errors (400 for an invalid body, 429 with rate_limit_error, and 503) have a JSON body. Errors from Gatekeeper (401, 403, the oversized-body 400, and the plan 429s) are plain text. Branch on error.type, not on message:

After the stream starts

The status is already 200, so a failure ends the stream with an error event, or with message_end and stop_reason: "error". That message_end has no error object; treat it like an api_error. Any answer text before it is partial. Show it as incomplete, or discard it.

Without streaming

With "stream": false, a failed turn returns either:
  • 200 with stop_reason: "error" and an error object, when the turn produced any content, including lookups. Always check stop_reason.
  • A JSON error body, when the turn produced nothing. The status matches error.type: 400 for context_overflow, 500 for api_error, 502 for tool_error, 504 for timeout_error, or 529 for overloaded_error (the status Anthropic uses for an overloaded model; some HTTP clients don’t recognize it, so handle it like 503). These aren’t charged. Handle them as in Error types.

Error types

Treat any other type like api_error.

Limits

When a turn nears 5 minutes, Lana stops looking things up and answers with what it has. Long turns usually end with a partial answer that says what’s missing, not a timeout. Set your HTTP client’s read timeout above 5 minutes. When streaming, a ping arrives every 10 seconds, so a much longer gap means the connection dropped. If you disconnect, Lana stops the turn. A request whose stream has already started is still charged. When Lana is at capacity, new requests get 503 before anything streams. They aren’t charged. Retry after the Retry-After header.

Pricing

Each request costs a flat price that depends on the model: The price is the same for streaming and non-streaming requests and on every paid plan (Developer and above). Lana isn’t available on the Free plan. Credits come from your plan. See Credits.

What’s charged

You’re charged for every request that gets HTTP 200, streaming or not, however the turn ends. Requests that get any other status are free.
  • A streaming turn that fails with an error event, or that you disconnect from after it starts, is charged: the status was already 200.
  • A non-streaming turn that fails with a 5xx or 400, or a request rejected before the turn starts (400, 401, 403, 429, 503), is free.

More examples

Set the tone and the user’s wallet

cURL

Scan a wallet’s full history

cURL

Get UI components, follow-ups, and a CSV

cURL

Next steps

API Reference

The request and response schema, with a playground.

Rate Limits

Lana’s per-plan rate limits.

Credits

How Lana requests use your plan’s credits.

Contact Support

Get help through Discord, chat, or email.