> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getbased.health/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect an AI provider to getbased

> Connect cloud, private-enclave, crypto-paid, custom, local, and remote compatible AI backends, then compare their lab-import accuracy and speed.

getbased supports OpenRouter, PPQ, Routstr, Venice, Custom API, Local AI, and **CLI agents** for chat and supported AI features. Some providers also expose private or encrypted modes, such as PPQ Private TEE and Venice Encrypted TEE Mode. You can switch in **Settings → AI** without losing your data. Direct-provider requests go from the browser to the selected endpoint without a getbased relay fallback. CLI routes go through your local Companion to the selected agent or personal gateway. Supported browser credentials are wrapped with a device key when passphrase encryption is off and with your passphrase-derived key when it is on.

Already use an installed agent? [Connect it through Companion](/guides/cli-agents). **Local** means a compatible model server; **CLI agents** means an agent harness with its own configuration and account. Neither label guarantees on-device inference.

<Note>
  Voice uses a separate service chosen in **Settings → Voice**. **Same as chat** can reuse a connected OpenRouter, PPQ, or Venice account and otherwise falls back on-device. You can also select on-device voice, a compatible voice server, one of those AI accounts, xAI, or ElevenLabs independently from the provider that generates chat answers. See [Use voice in AI chat](/guides/voice).
</Note>

<Note>
  Before the first request to a cloud AI or cloud voice recipient, getbased shows a recipient-specific consent prompt. Nothing is sent if you decline. An approval also covers later requests you choose to initiate with that recipient; review or withdraw approvals at any time in **Settings → Privacy**.
</Note>

## Which features need AI?

| Feature | Requires AI? |
| - | - |
| PDF import | Yes |
| Meal-photo or nutrition-label analysis | Yes, with an image-capable model |
| Manual meal entry, targets, and nutrition history | No |
| Meal model benchmarks | Yes, with at least one configured image-capable model |
| AI chat panel | Yes |
| Focus card (dashboard insight) | Yes |
| Live context-card summaries and status dots | Yes (demo profiles include precomputed versions) |
| Live AI-generated card tips | Yes (demo profiles include precomputed versions) |
| Web search in chat | Yes (OpenRouter, PPQ, Venice) |
| Test AI models with the built-in report | Yes |
| Charts, tables, trend alerts | No |
| Manual entry | No |
| JSON export / import | No |
| Correlations, compare dates | No |

All non-AI features work fully without any provider configured. You can load a demo profile, enter results manually, and explore charts and trends before setting up AI.

<Tip>
  The built-in demo profiles ship with precomputed context-card insights. Local AI can recalculate edited demo cards automatically, while cloud and other potentially paid providers stay off for demo-card recalculation until you explicitly enable live AI for the selected provider and model. The consent is session-only, so a reload or model/provider change requires a new confirmation. See [Health context](/guides/context-cards#demo-profiles-and-ai-cost).
</Tip>

## Set up a provider

<Tabs>
  <Tab title="CLI agents">
    Open **Settings → AI → CLI agents**, run the displayed **Copy connection command** on the same computer as your browser, and choose **Check connection**. Enable an available Codex, OpenCode, Hermes, Grok Build, or OpenClaw agent. Node.js 20+ and an installed, configured agent are required; the hosted app can use this connection without moving your data to localhost.

    The Companion reuses the agent's existing sign-in. Models and supported reasoning choices are available in Settings and beside the chat microphone. Images and non-chat features require declared adapter/model capabilities; personal gateways support chat and, when advertised, text-only feature jobs, but not image imports or the local tool bridge. Read [CLI setup, automatic startup, privacy, and troubleshooting](/guides/cli-agents) before connecting.
  </Tab>

  <Tab title="OpenRouter">
    OpenRouter is the easiest way to get started. It gives you access to 200+ models — Claude, GPT, Gemini, DeepSeek, Grok, Qwen, and more — with a single account. Pay with a card or USDC. Supports web search in chat.

    **Connect with OAuth (easiest):**

    <Steps>
      <Step title="Select OpenRouter in Settings">
        Open **Settings** (gear icon in the header) and go to the **AI** tab. Select **OpenRouter**.
      </Step>

      <Step title="Click Connect with OpenRouter">
        Click the **Connect with OpenRouter** button. You'll be redirected to OpenRouter to authorize getbased. No API key needed — the app handles the token exchange automatically.
      </Step>

      <Step title="Choose a model">
        Back in Settings, pick a model from the curated dropdown. Recommended models are sorted first and marked with a star.
      </Step>
    </Steps>

    **Connect with an API key:**

    <Steps>
      <Step title="Get an API key">
        Create an account and generate an API key at [openrouter.ai](https://openrouter.ai).
      </Step>

      <Step title="Paste your key in Settings">
        Open **Settings → AI**, select **OpenRouter**, and paste your API key.
      </Step>

      <Step title="Choose a model">
        Pick a model from the dropdown, or type any OpenRouter model ID into the custom input field.
      </Step>
    </Steps>

    <Tip>
      The OAuth connect button also appears in the chat panel when no provider is configured — you can set up OpenRouter without going to Settings.
    </Tip>
  </Tab>

  <Tab title="PPQ">
    PPQ is a pay-per-query AI aggregator with 300+ models. No subscription, no KYC, no identity verification. Top up directly in the app with Bitcoin, Lightning, Monero, Litecoin, or Bitrefill gift cards. Supports web search in chat.

    <Steps>
      <Step title="Select PPQ in Settings">
        Open **Settings → AI** and select **PPQ**.
      </Step>

      <Step title="Create an account">
        Click **Create Account**. This is instant and requires no signup form — PPQ accounts are fully anonymous.
      </Step>

      <Step title="Save your API key">
        Copy your API key and store it somewhere safe. PPQ accounts are anonymous with no recovery mechanism — if you lose the key, you lose access to your balance.
      </Step>

      <Step title="Top up your balance">
        Click **Top Up** and follow the payment flow. The app shows a QR code and polls for payment confirmation. Supported: Lightning, Bitcoin, Monero, Litecoin, Aqua, and Bitrefill gift cards.
      </Step>

      <Step title="Choose a model">
        Pick a model from the curated dropdown. Your balance is displayed with color coding so you always know what you have available.
      </Step>
    </Steps>

    You can also paste an existing API key from [ppq.ai](https://ppq.ai) if you already have an account.

    <Tip>
      **Private TEE mode:** When PPQ advertises supported private models, enable **Private TEE mode** to encrypt prompts and responses between your browser and a verified Tinfoil enclave. No local proxy is required. The green **🔒✓** indicator appears after attestation succeeds. Web search is disabled while Private TEE mode is active.
    </Tip>
  </Tab>

  <Tab title="Routstr">
    Routstr is a decentralized AI network powered by Bitcoin micropayments. getbased has a built-in Cashu eCash wallet — fund it with Lightning, then connect to any Routstr node discovered via Nostr relays. Your prompts go directly from your browser to the node you choose. No account, no subscription.

    <Steps>
      <Step title="Select Routstr in Settings">
        Open **Settings → AI** and select **Routstr**.
      </Step>

      <Step title="Fund your wallet">
        Click **Deposit** and pay the Lightning QR code (or paste a Cashu token from an external wallet). Your wallet balance is shown in the settings panel.
      </Step>

      <Step title="Pick a node">
        The app discovers online Routstr nodes via Nostr relays. Click **Connect** on any node in the list.
      </Step>

      <Step title="Deposit sats to the node">
        Choose how many sats to deposit to the node for your session. You receive a session key that authenticates your requests.
      </Step>

      <Step title="Start chatting">
        Your wallet balance and your node session balance are shown separately. You can move sats between them freely at any time.
      </Step>
    </Steps>

    **Wallet features:**

    * **Seed phrase** — a 12-word BIP-39 mnemonic is generated on your first deposit. Write it down — it is the only way to recover your wallet on another device.
    * **Lightning withdraw** — send sats to a Lightning address or pay a BOLT11 invoice.
    * **Cashu token send/receive** — withdraw as a shareable Cashu token, or deposit one from an external wallet.
    * **Node withdraw** — pull remaining sats back from a node into your local wallet.

    <Warning>
      Your seed phrase is shown once when you first deposit. You can view it again from the wallet menu under Seed & Restore. Without it, your wallet cannot be recovered.
    </Warning>

    For the full wallet, refund, token export, and recovery behavior, see [Routstr AI provider](/guides/routstr).

    <Tip>
      **Private TEE mode:** Nodes that support attested private models show a **Private TEE** badge. Enable the toggle to encrypt prompt and response bodies in your browser before the node forwards them to a verified Tinfoil enclave. The node can still see your session credential, selected model, request timing and size, network metadata, and billing information. Web search and image attachments are disabled.
    </Tip>
  </Tab>

  <Tab title="Venice AI">
    Venice is a hosted AI provider that advertises a no-log policy. That is a provider policy, not something getbased independently verifies. Venice also proxies access to third-party models. Web search is available with standard Venice models but disabled in encrypted mode.

    <Steps>
      <Step title="Get an API key">
        Create an account and generate an API key at [venice.ai](https://venice.ai).
      </Step>

      <Step title="Select Venice in Settings">
        Open **Settings → AI** and select **Venice**.
      </Step>

      <Step title="Paste your API key">
        Enter your API key in the field provided.
      </Step>

      <Step title="Choose a model">
        Pick a model from the dropdown. The model catalog identifies which current models support Venice's encrypted protocol.
      </Step>
    </Steps>

    <Tip>
      **Encrypted TEE Mode:** Message content is encrypted in your browser with ECDH, HKDF-SHA256, and AES-256-GCM. Before connecting, getbased requires full Intel TDX verification with DCAP and signed NVIDIA GPU evidence through NRAS. If either check fails, the encrypted session does not start. The **🔒 TEE + GPU** badge means both required checks passed; hover, focus, or tap it for the individual results and remaining limits. The checks do not prove that the TDX environment and GPU run together, enforce an approved Venice code-measurement allowlist, or independently verify the source of every response. The API key, model, roles, request settings, timing, sizes, and network metadata remain visible to Venice. Web search and image attachments are disabled.
    </Tip>
  </Tab>

  <Tab title="Custom API">
    Connect any OpenAI-compatible API endpoint with your own base URL and API key. Works with OpenAI, Mistral, Groq, Together, xAI, Fireworks, Deepinfra, vLLM, LiteLLM, and any service that implements the `/v1/chat/completions` standard.

    <Steps>
      <Step title="Select Custom in Settings">
        Open **Settings → AI** and select **Custom**.
      </Step>

      <Step title="Enter your base URL">
        Type the base URL of your endpoint — for example, `https://api.openai.com/v1`.
      </Step>

      <Step title="Enter your API key">
        Paste your API key for the service.
      </Step>

      <Step title="Validate and pick a model">
        Click **Save & Validate**. The app checks your key and fetches the model list from your endpoint. Pick a model from the dropdown, or type a model ID manually if your endpoint doesn't expose a `/v1/models` listing.
      </Step>
    </Steps>

    <Tip>
      Use Custom when you have a direct API key for a service that is not one of the built-in providers. If the service is available through OpenRouter or PPQ, those are easier — they handle model discovery and show pricing automatically.
    </Tip>

    <Note>
      Custom API endpoints are always called directly from your browser. The endpoint must allow requests from the exact getbased origin. If browser CORS or network policy blocks the request, getbased reports the direct-connection failure and does not fall back to a getbased relay.
    </Note>
  </Tab>

  <Tab title="Local AI">
    Connect directly to an OpenAI-compatible server. That server can run on this device, another machine on your LAN, or a remote host. getbased identifies the execution location in Settings so you can distinguish truly local models from LAN, remote, and cloud-hosted models.

    <Warning>
      **Local AI describes the connection type, not a privacy guarantee.** Only a loopback server such as `localhost`, `127.0.0.1`, or `[::1]` running a downloaded model keeps requests on this device. LAN and remote endpoints send data off this browser device, and Ollama `:cloud` models run on Ollama's servers.
    </Warning>

    <Steps>
      <Step title="Choose a compatible server">
        Install a server locally or obtain the address of a compatible endpoint:

        * [Ollama](https://ollama.com) — command-line, easiest setup
        * [LM Studio](https://lmstudio.ai) — GUI with drag-and-drop model loading
        * Unsloth Studio — compatible local server with automatic model and runtime discovery
        * [Jan](https://jan.ai) — open-source desktop app
        * llama.cpp, LocalAI, or any OpenAI-compatible server
      </Step>

      <Step title="Load a model">
        Download a model to run locally. In Ollama, for example:

        ```bash theme={null}
        ollama pull qwen2.5:14b
        ```

        For reliable lab PDF parsing, use a model with at least 14B parameters. The built-in Model Advisor in Settings shows which of your installed models are suitable for lab analysis.
      </Step>

      <Step title="Select Local in Settings">
        Open **Settings → AI** and select **Local**.
      </Step>

      <Step title="Enter your server URL">
        The default is `http://localhost:11434` for Ollama. Enter the base URL for another local, LAN, or remote server. Add an API key if that endpoint requires one.
      </Step>

      <Step title="Test the connection">
        Click **Test**. getbased detects native Ollama and LM Studio servers when possible, recognizes Unsloth Studio through its compatible model metadata, and otherwise uses the standard OpenAI-compatible model list. Choose a text-generation model from the discovered list.
      </Step>
    </Steps>

    ### Native and first-class server support

    Ollama and LM Studio expose extra information beyond the compatible API. When detected, getbased can show loaded state, context length, quantization, model size, and VRAM use. It can also request a larger context for complex imports and release a loaded model when switching between supported servers on the same machine. Unsloth Studio is recognized as its own Local AI provider, exposes its active runtime when available, and can offer image-capable models for meal analysis.

    On a current LM Studio server, a large import can reload the selected model at the planned context, verify the context LM Studio actually fitted into memory, and generate through the streaming compatible endpoint. If the previous instance cannot be unloaded, getbased checks whether it is really gone and otherwise stops with manual-unload guidance instead of loading a duplicate model into memory.

    Generic compatible servers continue to work through `/v1/models` and `/v1/chat/completions`, but they may not expose loaded state, context controls, native performance metrics, or model unloading.

    <Note>
      If getbased says the loaded context is too small, reload the model with a larger context or use a smaller or chunked input. Imports can request a larger native context from supported Ollama and LM Studio servers. getbased also rejects marker output cut off by the output or context limit instead of accepting a partial report.
    </Note>

    ### CORS setup

    The server must allow requests from the exact origin where you opened getbased. For the hosted app, that origin is `https://app.getbased.health`. Avoid `*` when the server supports an explicit origin, especially if API authentication is enabled.

    | Server | How to enable CORS |
    | - | - |
    | Ollama (Linux) | `OLLAMA_ORIGINS=https://app.getbased.health ollama serve` |
    | Ollama (macOS) | `launchctl setenv OLLAMA_ORIGINS "https://app.getbased.health"` then restart Ollama |
    | Ollama (Windows) | Add `OLLAMA_ORIGINS` = `https://app.getbased.health` as a system environment variable, then restart Ollama |
    | LM Studio | Enable CORS and API authentication in LM Studio Settings |
    | Jan | Settings → Advanced → Enable CORS |

    If you self-host getbased at another origin, replace `https://app.getbased.health` with the origin shown in your browser, including its scheme and port.

    <Warning>
      An HTTPS page cannot call a plain HTTP LAN or remote server because browsers block mixed content. Use an HTTPS endpoint, a loopback address, or an encrypted local tunnel. A self-hosted getbased page served over plain HTTP can call an HTTP LAN server when CORS permits it, but that traffic is unencrypted unless a VPN or tunnel protects it.
    </Warning>

    <Tip>
      The Model Advisor appears for discovered Local AI endpoints. It rates suitable text models for lab analysis and shows the metadata the server exposes. Ollama can also suggest a model to pull; remote servers let you enter their available VRAM for a fit estimate.
    </Tip>
  </Tab>
</Tabs>

## Recommended models

The Settings and chat model pickers scope choices to the active provider and privacy mode. Search is available for long catalogs. Supported catalogs show curated groups:

* **Recommended** — the latest, most capable models for lab interpretation, sorted first
* **Other** — all remaining available models

Recommendations are starting points, not a guarantee of clinical accuracy, entitlement, or suitability for a particular report. Check results and compare models on your own task.

Recommendation families and exact IDs change with the catalog. Use the in-app list rather than a fixed list in this guide. CLI catalogs are scoped further to the selected agent and execution target; personal gateways identify their current/default model instead of importing recommendations from unrelated providers. Explicitly unavailable entries are excluded, but an agent may only discover an account restriction when it sends a request.

When the active model exposes reasoning controls, adjust them in Settings or in the chat picker. Unsupported controls stay unavailable rather than guessing from a model name. A model can reason internally without offering a separate effort setting. Supported settings also pass through the selected private/TEE transport; a reasoning slider does not add privacy protection.

Meal-photo selectors are separate: they show only models reported as image-capable and can follow the chat assistant or use a dedicated route. Following a CLI assistant uses its actual selected model and capability, not the last direct-provider model. If the route cannot process images, select a compatible feature route explicitly. Use [Meal Benchmarks](/guides/meals-nutrition#compare-meal-estimates) to compare those models on the same images.

<Warning>
  **Use the same model for all your imports.** When you import a lab PDF, the AI generates marker keys (like `biochemistry.glucose`) to map results. Different models may generate slightly different keys for the same marker, which can cause the same biomarker to appear as two separate entries in your charts. Pick a model and stick with it. If you do switch, getbased runs a pre-flight check before each import and warns you if your model has changed since the last import.
</Warning>

## Test before you choose

Open **Settings → Data → Test models on lab reports** to run the same verified 68-result report through different setups. You can compare raw accuracy, getbased's corrected result, speed, tokens, and runtime details side by side.

The comparison works across local models, hosted compatible endpoints, and built-in cloud providers. You can also import the same personal report with different setups and compare the review effort each one required. See [Test and compare AI models](/guides/ai-model-testing).

## How much does it cost?

AI providers usually charge for input and output tokens, and image-capable models may also price image input. Catalogs and prices change frequently. getbased uses the current pricing metadata returned by supported providers when available and shows tracked tokens and estimated cost on chat, meal analysis, and benchmark results. A provider can still bill a canceled or failed request even when it returns no usage count.

| Path | Provider fee |
| - | - |
| Built-in cloud provider | Current provider/model price; shown when usage and pricing are available |
| Custom or hosted compatible endpoint | Determined by that endpoint |
| CLI agent or personal gateway | Existing agent account, subscription limits, or configured API billing; usage reporting depends on the adapter |
| Downloaded model on this device or your own server | No per-request provider fee; hardware and electricity costs remain |

<Tip>
  Review the model's current provider price before a large import or multi-model meal benchmark. When the provider returns usage, getbased records it per result so you can compare cost with review quality.
</Tip>

<Tip>
  Run a downloaded model on your own hardware with [Ollama](https://ollama.com), [LM Studio](https://lmstudio.ai), Unsloth Studio, or [Jan](https://jan.ai) and pay no provider fee. Hardware needs depend on the model and quantization; the Model Advisor shows what the connected server reports and what may fit.
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.