--- url: https://www.helius.dev/docs/api-reference/lana/messages last_updated: 2026-11-11 --- # Lana API (Beta) Lana is a Solana AI agent you call over HTTP. Send a question in plain English; Lana looks up wallets, tokens, transactions, and prices itself and streams back an answer. You don't define or run any tools. ## Quick Reference - Endpoint: `POST https://beta.helius-rpc.com/v1/lana/messages` (Gatekeeper beta endpoint; not on mainnet.helius-rpc.com yet) - Auth: header `X-Api-Key: YOUR_KEY` (recommended) or `?api-key=YOUR_KEY`. `Authorization: Bearer` returns 401. - Models: `lana-fast` (quick lookups) and `lana-thinking` (multi-step analysis, can stream reasoning) - Pricing: flat 2,000 credits per `lana-fast` request, 10,000 per `lana-thinking` request. Paid plans only (Free returns 403). - Charged for every HTTP 200, however the turn ends. Any other status is free. - Shaped like the Anthropic Messages API, but the Anthropic SDKs don't work with it. Call it over plain HTTP. ## Request Body - `model` (required): `lana-fast` or `lana-thinking` - `messages` (required): conversation, oldest first; last message must be `role: "user"`. Content is a string or an array of `text`, `image` (URL only), `tool_use`, `tool_result` blocks. The API doesn't store conversations. - `max_tokens`: 1 to 8,192 (default 8,192), per model step - `stream`: `true` for server-sent events, `false` (default) for one JSON response - `system`: extra instructions, up to 10,000 characters, added to Lana's own - `extensions`: `read_only` (default true; leave it on), `output_format` (`markdown` | `plain`), `include_ui_schema`, `include_followups`, `include_documents`, `enable_deep_scan`, `user_context` (`wallet`, `address_kind`, `time_zone`, `network`), `attachments` (up to 8 image URLs) Unknown fields return 400. `tools`, `tool_choice`, `temperature`, `top_p`, `top_k`, `stop_sequences`, and `metadata` return 400. ```bash curl -N https://beta.helius-rpc.com/v1/lana/messages \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{ "model": "lana-fast", "stream": true, "messages": [{ "role": "user", "content": "What is the current price of SOL?" }], "extensions": { "read_only": true } }' ``` ## Streaming Events `message_start` first; then any mix of `content_block_delta` (`text_delta` is the answer, `thinking_delta` is reasoning), `tool_use`, `tool_result`, `source`, `ui_block`, `document`, `progress_update`, `ping`; then `ui_schema` and `follow_up` at most once each; then `message_end` or `error`, always last. Ignore unknown event types. `message_end` carries `stop_reason` (`end_turn`, `max_tokens`, `tool_use`, `error`) and `usage` (`input_tokens`, `output_tokens`, `tool_calls`, `prompt_tokens`, `context_window`). ## Non-streaming Response One JSON object: `id`, `type: "message"`, `role: "assistant"`, `model`, `content` (`text`, `tool_use`, `tool_result` blocks), `stop_reason`, `usage`, plus `ui_schema`, `documents`, `follow_up`, `sources`, `error` when they have a value. The answer is the `text` blocks joined in order. Always check `stop_reason`. ## Errors | Status | Cause | |--------|-------| | 400 | Invalid body (JSON `invalid_request_error`), or body over 10 MB (plain text) | | 401 | Missing or invalid API key | | 403 | Free plan, or key access settings block Lana | | 429 | Plan rate limit (`Too Many Requests`), out of credits (`max usage reached`), or about 3 Lana requests already running (JSON `rate_limit_error`) | | 503 | Lana at capacity or restarting; retry after `Retry-After` | | 500 / 502 / 504 / 529 | Non-streaming turn failed before producing content (`api_error`, `tool_error`, `timeout_error`, `overloaded_error`) | After a stream starts, failures arrive as an `error` event or `message_end` with `stop_reason: "error"`. ## Docs - Guide: https://www.helius.dev/docs/lana.md - API reference: https://www.helius.dev/docs/api-reference/lana/messages.md - Credits: https://www.helius.dev/docs/billing/credits.md#lana-api-credits - Rate limits: https://www.helius.dev/docs/billing/rate-limits.md#lana-api --- Full documentation index: https://www.helius.dev/docs/llms.txt