Skip to content
Clients

LobeChat

LobeChat is an open-source AI chat app that can use several model providers at once. Enter TokenArmy's base URL and API key in its Anthropic provider and you can use Claude models in LobeChat. Setting names vary a little between LobeChat versions; if you can't find one, look for AI Providers and API Proxy URL.

Before you start

  • A TokenArmy API key: create one in API Keys. It starts with sk-ta- and the full key is shown only once.
  • A balance in your account; see Billing & top-up.

Setup (recommended: the Anthropic provider)

  1. Open LobeChat, go to Settings → AI Providers (older versions call it Language Model) and choose Anthropic.
  2. Enter your TokenArmy key as the API Key.
  3. Enter https://tokenarmy.shop as the API Proxy URL, without a trailing /v1.
  4. Click Fetch Models, or add a model id by hand, for example claude-sonnet-5-5.
  5. Click Check (connectivity check), pick the model, and once it passes turn the provider on.
  6. Go back to the chat view, pick this model in the model selector and start a conversation.

Using the OpenAI-compatible format instead

If you prefer the OpenAI-compatible format, use the same key in the OpenAI provider and enter https://tokenarmy.shop/v1 as the API Proxy URL (this one must include /v1). Add the model id by hand as well.

Self-hosted LobeChat: environment variables

If you deploy LobeChat yourself (for example with Docker), you can preset these environment variables so every user can use it right away:

ANTHROPIC_API_KEY=sk-ta-...
ANTHROPIC_PROXY_URL=https://tokenarmy.shop

Check the variable names against the docs of the LobeChat version you run; restart the container after changing them.

Verify

  1. Start a new chat in LobeChat, pick claude-sonnet-5-5 and send "Hello".
  2. If you get a reply, it works.
  3. Open the console usage page to see the tokens and cost of that request.

Troubleshooting

401 / invalid key

The key was not copied in full, or it went into the wrong field. TokenArmy keys start with sk-ta-. A deleted or disabled key also returns 401; create a new one in the console.

404 / endpoint not found

Almost always a wrong API proxy URL: the Anthropic provider takes https://tokenarmy.shop (no /v1), the OpenAI provider takes https://tokenarmy.shop/v1 (with /v1). Don't add a trailing slash or any other path.

The model you want is not in the list

If fetching the model list fails, add the model id by hand. Use the ids on the Models & pricing page; a wrong id returns a "model not found" error.

402: insufficient balance

Top up, then try again.

The check passes but chat shows a network error

If LobeChat has a setting such as client request mode, requests may be sent straight from your browser. Turn it off so LobeChat's server sends them, and check whether a browser extension or your company network blocks https://tokenarmy.shop.

Good to know

  • Don't put the key in a public repository or a screenshot. If it leaks, delete it in the console and create a new one.
  • LobeChat features such as automatic topic naming and assistant summaries also send requests, and they are billed at the model you selected.