Leni developers
Build on Leni’s intelligent runtime platform, powered by your data and context
A single Leni API gives your agents everything they need to deliver exceptional, highly accurate outputs: authorized data, organizational and personal Context, and specialized real-estate tools. Use it server-to-server over HTTP or connect compatible AI assistants through Leni’s remote MCP runtime. Both connection modes use the same Leni accounts, tenant boundaries, and usage policies as the Leni application.
Server-to-server
HTTP API
Sandbox, development, and production project keys call https://api.prod.ca-central-1.leni.co. The key itself determines its environment, limits, and billing behavior; there is no separate sandbox hostname.
| Setting | Value |
|---|---|
| Base URL | https://api.prod.ca-central-1.leni.co |
| Authentication | X-Api-Key: <key> or Authorization: Bearer <key> |
| JSON requests | Content-Type: application/json |
| File requests | Use multipart parts named files or the documented JSON base64 shape. |
Project keys are not MCP credentials
Quick start
curl -sS "https://api.prod.ca-central-1.leni.co/users/custom-analysts" \
-H "X-Api-Key: $LENI_API_KEY"- Sandbox keys are limited to 5 requests per minute and a monthly trial quota.
- Development keys are limited to 60 requests per minute.
- Production keys are limited to 120 requests per minute. Metered analysis uses included subscription credit first, then funded API credits when available.
- Respect
Retry-Afteron429responses and use idempotent retry behavior. - Supported attachments are limited to 50 MB per decoded file.
Start with the four-step HTTP API quickstart and use the retry and async lifecycle guide before sending production traffic.
Current surface
HTTP API reference
The authenticated project-key owner is the security principal for these routes. User and organization identifiers supplied by a client cannot be used to impersonate a different account.
| Method | Path | Purpose |
|---|---|---|
| GET | /users/sdk/me | Verify a project key and read sanitized owner metadata. |
| POST | /users/run-models | Run a Leni AI request. Durably accepted work returns HTTP 202 and exact identifiers for polling. |
| GET | /users/me/chat-messages | List the authenticated API-key owner’s messages. |
| GET | /users/me/chat-messages/:messageId | Read one owned message and its current state. |
| GET | /users/me/chat-sessions/:sessionId | Read a session in which the authenticated owner participates. |
| GET | /users/me/chat-sessions/:sessionId/messages | Read the authorized transcript for a session. |
| POST | /users/me/chat-sessions/attachments | Resolve authorized file references for a session or message. |
| POST | /users/me/chat-sessions/message-responses | Read authorized persisted response rows for a session or message. |
| POST | /users/get-user-memory | List Context available to the authenticated owner. |
| POST | /users/memory/search | Search normalized Personal or eligible Organization Context. |
| POST | /users/memory/folders | List authorized Context folders and their note IDs. |
| POST | /users/memory/:memoryId/files | Create five-minute links for files on an authorized Context note. |
| POST | /users/add-to-memory | Create a Context note, with optional supported attachments. |
| POST | /users/update-memory | Update an existing Context note owned by the authenticated context. |
| POST | /users/custom-analysts | Create a custom analyst. |
| GET | /users/custom-analysts | List custom analysts for the authenticated owner. |
| PUT | /users/custom-analysts/:analystId | Update an owned custom analyst. |
| DELETE | /users/custom-analysts/:analystId | Delete an owned custom analyst. |
See the detailed HTTP API reference for request fields, response shapes, examples, limits, uploads, polling, Context, and custom analyst contracts.
Long-running analysis
POST /users/run-models can return HTTP 202 after durable admission. Preserve the exact run, message, and session identifiers, do not repeat an accepted POST, and poll the documented owner-scoped message route until it is terminal. Do not infer a session identifier from an analysis identifier.Context access and legacy API names
memory, user_memory, and organisation_memory for backward compatibility. These identifiers refer to Personal Context and Organization Context; integrations should not rename them in requests.AI assistants
Connect through Leni MCP
The Leni intelligent runtime exposes account-scoped real-estate, financial, market-research, operating, and context tools to a compatible AI host. Each user signs in to Leni, sees the organization and requested permissions, and grants access through OAuth.
| Setting | Value |
|---|---|
| Remote MCP URL | https://mcp.leni.co/mcp |
| OAuth issuer | https://auth.leni.co |
| Transport | Streamable HTTP over HTTPS |
| Authentication | OAuth 2.0 sign-in and consent with a Leni account |
Connect from Claude
Individual Free, Pro, or Max account
- Open Customize → Connectors.
- Select Add custom connector, name it Leni, and enter
https://mcp.leni.co/mcp. - Connect, sign in to Leni, review the organization and permissions, and approve.
- Enable Leni for the conversation.
Claude Team or Enterprise
- An Owner or Primary Owner opens Organization settings → Connectors, selects Add → Custom → Web, and adds
https://mcp.leni.co/mcp. - Each member opens Customize → Connectors, finds Leni, and authenticates their own Leni account.
- The member enables Leni for the conversation. Organization policies may further limit access.
| Capability | Behavior |
|---|---|
| Account and usage | Read the plan, whether analysis is available, and the percentage of included usage remaining. Dollar credit balances are not exposed. |
| Portfolio data | Discover approved Leni semantic-layer models and run bounded, read-only queries for operating and financial data. |
| Analysis | Run context-aware real-estate, financial, market-research, operating, and organizational analysis with Leni’s specialized tools. |
| Context | Consult relevant personal and organization-scoped context. Create, update, or delete saved context only when the user explicitly requests it and the OAuth grant permits it. |
| Context folders and files | Discover authorized folders and attachment metadata, retrieve five-minute file links, and include selected context-note files in Leni analysis. Existing MCP connections must remove and reconnect Leni once to grant the new file-read permission. |
Available MCP tools
MCP hosts discover the current input and output schemas directly from Leni. The tool names and OAuth permissions below are the public runtime surface.
| Tool | Required scope | Purpose |
|---|---|---|
leni_get_account | leni:account:read | Read the connected account, plan, and analysis entitlement. |
leni_get_portfolio_occupancy | leni:data:read | Read the latest authorized portfolio occupancy. |
leni_list_data_models | leni:data:read | Discover available read-only portfolio data models. |
leni_describe_data_model | leni:data:read | Read the measures and dimensions for one data model. |
leni_query_portfolio_data | leni:data:read | Run a bounded, read-only semantic-layer query. |
leni_consult_memory_context | leni:memory:read | Find relevant personal or organization Context. |
leni_analyze_real_estate_finance | leni:analysis:run | Start a context-aware Leni analysis. |
leni_get_analysis_status | leni:analysis:read | Poll or retrieve an existing analysis. |
leni_get_analysis_session | leni:analysis:read | Read an authorized analysis-session transcript. |
leni_list_memory | leni:memory:read | List or search authorized Context notes. |
leni_list_memory_folders | leni:memory:read | List authorized Context folders and note IDs. |
leni_get_memory_files | leni:memory:files:read | Create five-minute links for files on a selected note. |
leni_create_memory | leni:memory:write | Create a text Context note after an explicit request. |
leni_update_memory | leni:memory:write | Update an authorized Context note after an explicit request. |
leni_delete_memory | leni:memory:delete | Delete an exact Context note after an explicit request. |
OAuth permissions
The consent screen shows the permissions requested by the connecting host. Leni checks the granted scope again for every tool call.
| Scope | Allows |
|---|---|
leni:account:read | Read the connected account, organization, plan, and analysis availability. |
leni:analysis:run | Start a Leni analysis that can consume included usage or API credits. |
leni:analysis:read | Read the status, result, or authorized transcript of an analysis. |
leni:data:read | Discover and query authorized portfolio data through read-only models. |
leni:memory:read | Read relevant personal and eligible organization Context. |
leni:memory:files:read | Create short-lived links for files on an authorized Context note. |
leni:memory:write | Create or update Context only after an explicit user request. |
leni:memory:delete | Delete a specific Context note only after an explicit user request. |
| MCP allowance | Current limit |
|---|---|
| Authenticated runtime requests | 120 requests per 60 seconds per signed-in subject and client |
| Structured Leni semantic queries | 20 requests per 60 seconds per signed-in principal and client |
| Memory context consultation | 12 requests per 60 seconds per Leni account across clients |
Applicable MCP limits overlap; the most restrictive one wins. Respect Retry-After after a 429 response.
When an assistant calls Leni
Example requests
- “Use Leni to show my current portfolio occupancy.”
- “Use Leni to show how many open work orders I have.”
- “Use Leni to show rent collected this month.”
- “Use Leni to explain the main drivers of the change in collections.”
- “Research downtown Toronto, then use Leni to compare it with the markets in my portfolio.”
- “Use Leni to find my loan documents and analyze the maturity terms.”
Market research through Leni
See the complete MCP runtime reference for OAuth discovery, scopes, every advertised tool, structured-query bounds, rate limits, token lifecycle, and troubleshooting.
Trust boundaries
Data access and billing
- Every MCP request is bound to the OAuth subject and that user’s active Leni organization.
- Direct portfolio queries receive server-owned organization and authorized-property filters.
- MCP clients cannot submit SQL, and direct Leni semantic-layer queries are read-only.
- One organization’s models, properties, Context, and analysis cannot be selected by another organization’s token.
- Context-file access revalidates the note under the signed-in user, organization, and model partition; clients receive a five-minute bearer link, never an S3 bucket or object key.
- Analysis uses the same included plan usage and funded API-credit spillover as Leni. When neither is available, Leni returns a usage-exhausted error.
- The account tool exposes percentage usage remaining, not the underlying dollar credit balance.
Read the developer integrations privacy notice for the data categories, connected-assistant flow, retention practices, and customer controls that apply to the HTTP API and MCP runtime.
Operations
Troubleshooting
| Problem | What to check |
|---|---|
| Leni is not used | Confirm the connector is enabled, ask explicitly to use Leni, and review the host’s tool-access mode. |
| Cannot add the connector | A Claude Team or Enterprise owner may need to add the custom connector for the organization first. |
| Sign-in or consent fails | Reconnect Leni and confirm the Leni user has an active organization. |
| Analysis is still running | HTTP API: keep the exact runId, messageId, and sessionId returned by HTTP 202, then poll GET /users/me/chat-messages/:messageId until terminal. MCP: keep the returned analysisId and ask the assistant to check status; use sessionId for transcript retrieval. |
| Usage exhausted | Open Leni to manage the plan or fund API-credit spillover, then retry. |
| HTTP API returns 401 | Confirm the key is active and sent in X-Api-Key or Authorization: Bearer. Query-string keys are not supported. |
Need help with an account or integration? Sign in to Leni and contact the team with the request ID, analysis ID, or failing endpoint. Never include a complete API key in a support message.