Choose a path
Three branches, same destination: a working connection to Lev that you can trust for the rest of the build.
Best for platform engineers, product teams, internal tools, and sync jobs. Validate auth and fetch a small page of deals.
Best for AI product teams and operator workflows. Connect Lev to a client like Cursor or Claude and verify auth and tool discovery.
Best for terminal workflows, shell scripts, CI/CD, and LLM coding agents. Install the CLI, authenticate, and list deals.
Before you start
- A Lev account with API access enabled.
- A way to generate an API key — the Lev web app or the API itself.
- A client you want to test with:
curl,fetch,requests, Cursor, Claude, or the Lev CLI.
Path A: First REST API call
Three phases: create a key, confirm it works, then fetch your first page of deals.
Generate the credential every later call signs with.
- Open Settings. Sign in to app.lev.com, click your name at the bottom of the sidebar, then click Settings.
- Create the key. Select the API Keys tab, click Create key, enter a label like "Quickstart Key", and click Create.
- Copy the key immediately. The full value is only shown once — store it in a secret manager before closing the dialog.
Copy your key nowThe full API key is only displayed at creation time. If you lose it, revoke it and create a new one.
If you are automating key provisioning instead of using the web app, create a key via the API:
You have an API key that starts withlev_sk_saved somewhere safe.Prove the key works and see exactly which resources it can reach before you ship any real calls.
- Send the validation request. Call
POST /api/external/v2/auth/validate-api-keywith the key in the request body. - Confirm
valid: true. A200response with"valid": truemeans Lev accepted the key. - Read the
scopesarray. The scopes list tells you which endpoints this key can call — save it for the next phase.
POST /api/external/v2/auth/validate-api-keyValidate an API key and receive authentication details
Request body:
{ "api_key": "lev_sk_abc123def456..." }Response (200):
{ "request_id": "...", "data": { "valid": true, "user_id": 1234, "account_id": 56, "scopes": ["deals:read", "deals:write", "contacts:read"], "tier": "standard" } }A200 OKresponse with"valid": true, auser_id, anaccount_id, and a non-emptyscopesarray.- Send the validation request. Call
Hit a real read endpoint so you know end-to-end auth, routing, and pagination are working.
- Send a paginated read. Call
GET /api/external/v2/build/deals?limit=5with your API key in theAuthorizationheader. - Verify the payload shape. Confirm the response includes a
dataarray and apaginationobject withhas_moreandnext_cursor. - Troubleshoot failures by status. A
401means yourAuthorizationheader is wrong; a403means the key's scopes don't cover deals — inspectgranted_scopesfromGET /meor the previous validation response.
Example response:
{ "request_id": "a1b2c3d4-...", "timestamp": "2026-03-20T15:30:45Z", "data": [ { "id": 101, "title": "123 Main St Acquisition", "loan_amount": 5000000.0, "loan_type": "acquisition", "transaction_type": "purchase", "created_at": "2026-01-15T10:00:00Z" } ], "pagination": { "total": 42, "limit": 5, "cursor": "eyJpZCI6IDEwMX0=", "has_more": true, "next_cursor": "eyJpZCI6IDEwNn0=" } }A200 OKwith up to five deal objects and apagination.has_moreflag.- Send a paginated read. Call
Next: Authentication for the full auth model, required headers, and every failure mode.
Path B: First MCP integration
Three phases: choose the right auth model, point your MCP client at Lev, then verify the connection with a safe read.
Decide whether the MCP client will sign in interactively or carry a long-lived credential — the choice drives the rest of the config.
- Use JWT / OAuth for interactive clients. If the user signs in through the client UI (Cursor, Claude), pick JWT / OAuth so each session is scoped to that user.
- Use an API key only for server bridges. Reserve API keys for server-side bridges that can safely hold a long-lived credential in a secret store.
- Plan your
X-Origin-Appvalue. Always send a meaningfulX-Origin-Appheader so Lev can identify the calling surface in logs and rate limits.
You know which auth path to configure and whatX-Origin-Appstring to send.Wire the client to Lev — the exact config shape varies by client, but the core pieces are the same.
- Point the client at the Lev MCP URL. Use
https://api.levcapital.com/mcpas the server URL in your client's MCP configuration. - Enable OAuth or paste a token. Follow the client's prompt for OAuth, or paste an API key if you are running a server bridge.
- Set the origin header. Include
X-Origin-Appwith a descriptive value likecursor-lev-quickstart.
Cursor / Claude-style JSON{ "mcpServers": { "lev": { "url": "https://api.levcapital.com/mcp", "headers": { "X-Origin-App": "cursor-lev-quickstart" } } } }2 examples. View source for the rest.Lev appears as a connected MCP server in your client's integrations list.- Point the client at the Lev MCP URL. Use
Confirm the connection is account-aware before you trust it with real work.
- Ask an identity question. Prompt the client: "What account am I connected to in Lev?" — the answer should name your workspace.
- Request a small read. Ask for "my first five deals" and confirm the client returns real, scoped data.
- Inspect granted scopes. Ask "Which scopes are granted to this connection?" — compare against the scopes you expected from Path A or your config.
Account-aware replies to all three prompts, with scope data that matches your setup.
Next: MCP Setup for client-specific configuration and troubleshooting.
Path C: First CLI query
Three phases: install the binary, authenticate once, then fetch deals from the terminal.
Put the
levbinary on your PATH so every later command resolves.- Install with pipx. Run
pipx install lev-cli(requires Python 3.13+). - Verify the binary resolves. Run
lev --versionand confirm you see a version string. - Pick an alternative install if needed. See CLI Setup for Homebrew, standalone binaries, and Windows installers.
Running lev --version in any new terminal returns a version string.- Install with pipx. Run
Store your API key in the OS keychain so later commands don't have to prompt.
- Start the login flow. Run
lev auth login. - Paste your API key when prompted. The key is stored in your OS keychain — never written to a file.
- Create a key first if you don't have one. If you skipped Path A, create a key in app.lev.com under Settings → API Keys.
lev auth loginThe CLI confirms it is authenticated and shows which user / account it is connected to.- Start the login flow. Run
Confirm the CLI is connected and see the agent-friendly JSON output mode.
- Check auth status. Run
lev auth statusand confirm the connection is active. - List deals. Run
lev deals list— the CLI prints a formatted table in an interactive terminal. - Pipe to JSON for agents. When piped, the CLI auto-switches to JSON, which an LLM coding agent can parse directly.
lev auth status # Confirm connection lev deals list # Fetch your deals (table) # Example: an agent or script capturing JSON output lev deals list -o json | jq '.data[0].title'A formatted table when running interactively, and structured JSON when piping to another command.- Check auth status. Run
Next: CLI Setup for the full walkthrough and CI/CD patterns.
Next steps
Go one level deeper based on what you are building:
- Authentication — Learn the auth model, required headers, and failure modes in detail.
- Deals — Start with the core deal resource if you are building a product integration.
- MCP Setup — Continue from the MCP path with client-specific setup and troubleshooting.
- CLI Commands — Full command reference with syntax, flags, and output examples.
- Data Sync Patterns — Use the production sync recipe when you are moving data into another system.