Lana API
Create a Lana Message
Ask Lana, a Solana AI agent, a question and get the answer as a stream of events or one JSON response.
POST
/
v1
/
lana
/
messages
curl --request POST \
--url https://beta.helius-rpc.com/v1/lana/messages \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"model": "lana-thinking",
"messages": [
{
"role": "user",
"content": "What is the current price of SOL?"
}
],
"extensions": {
"read_only": true
}
}
'{
"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
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "max_tokens: max_tokens must be <= 8192"
}
}<string><string>{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
}
}Each request costs 10,000 credits with
lana-thinking or 2,000 credits with lana-fast.
Requires a paid plan. Free-plan requests return 403 Forbidden.
For the quickstart, streaming events, and error handling, see the Lana API guide.
Request Parameters
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.lana-thinkinglana-fast
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.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.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.true streams server-sent events. false returns one JSON object when the turn ends.Extra instructions, such as “Answer in three bullet points.” They’re added to Lana’s own instructions, not used in place of them.
Lana-only options. All are optional. The
include_* options make output possible; Lana decides whether to send it.plain tells Lana not to use Markdown and removes {{cite:N}} markers. source events still arrive.markdownplain
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.
Up to 8 images added to the last user message.
image blocks in messages don’t count toward this limit.Body
application/json
Response
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.
The non-streaming response. The answer is the text blocks, joined in order.
end_turn: Lana finished its answer.max_tokens: the answer hitmax_tokensand 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.
Available options:
end_turn, max_tokens, tool_use, error Was this page helpful?
⌘I
curl --request POST \
--url https://beta.helius-rpc.com/v1/lana/messages \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"model": "lana-thinking",
"messages": [
{
"role": "user",
"content": "What is the current price of SOL?"
}
],
"extensions": {
"read_only": true
}
}
'{
"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
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "max_tokens: max_tokens must be <= 8192"
}
}<string><string>{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
}
}