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-fastandlana-thinking. - Lana runs its own tools.
tools,tool_choice,temperature,top_p,top_k,stop_sequences, andmetadatareturn400. systemis added to Lana’s instructions.max_tokensis 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, ormessage_stop. The stream ends withmessage_endorerror. usageaddstool_calls,prompt_tokens, andcontext_window.stop_reasoncan beerror.extensionsis Lana-only.
Endpoint and authentication
Authorization: Bearer doesn’t work on this endpoint and returns 401.
Send Content-Type: application/json on every request.
Request body
The body is a JSON object. Unknown fields are rejected with400, including unknown fields inside extensions and content blocks.
lana-fast or lana-thinking. See Models.The conversation, oldest first. It needs at least one message, and the last one must have
role: "user". See Messages.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.true streams events. false returns one JSON response when the turn ends.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.
Lana-only options. See Extensions.
Models
lana-thinking only reasons when max_tokens is 2048 or higher.
Messages
Each message has arole (user or assistant) and content:
assistant turns:
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:
message_start, always first.- Any mix of
content_block_delta,tool_use,tool_result,source,ui_block,document,progress_update, andping. ui_schema, at most once.follow_up, at most once.message_endif the turn finished, orerrorif it failed. This is always the last event.
Tips for showing a stream:
- Use
tool_usefor progress indicators only. Tool names and inputs can change. - With
"markdown"output, turn each{{cite:N}}into a link to thesourcewith thatindex, or remove it. ui_blockandui_schemacarry the same components. Lana may send onlyui_schema, so showui_blockevents if they arrive and otherwise renderui_schema.- Web searches send a
tool_resultwith the textWeb search completed.orWeb fetch completed.The pages arrive assourceevents.
Tool errors
A failed lookup doesn’t fail the turn. Lana works around it, and you don’t need to retry. Thetool_result has is_error: true, and content is JSON with a short message and a code:
Tool error codes
Tool error codes
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:
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 already200, 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:
200withstop_reason: "error"and anerrorobject, when the turn produced any content, including lookups. Always checkstop_reason.- A JSON error body, when the turn produced nothing. The status matches
error.type:400forcontext_overflow,500forapi_error,502fortool_error,504fortimeout_error, or529foroverloaded_error(the status Anthropic uses for an overloaded model; some HTTP clients don’t recognize it, so handle it like503). 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 HTTP200, streaming or not, however the turn ends. Requests that get any other status are free.
- A streaming turn that fails with an
errorevent, or that you disconnect from after it starts, is charged: the status was already200. - A non-streaming turn that fails with a
5xxor400, 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.