← All resources

How Learny Moved from OpenRouter to Darkbloom Without Touching Its Code

Learny powers its product with LLM inference, and like a lot of teams, it started with the simplest thing that works: an OpenRouter API key wired straight into the app. One key, one base URL, done. That setup carried them a long way — right up until they wanted to run inference somewhere else.

This post walks through what they did: first a short migration from a direct OpenRouter key to FreeRouter, then a backend swap from OpenRouter to Darkbloom that required zero code changes. If you run on OpenRouter today, you can follow the same two phases.

What Learny is, and where inference fits

Learny builds Learny Brain — a shared, AI-powered knowledge base for an organization. Teams connect the tools they already use (Notion, GitHub, Jira, Slack, Google Drive, and hundreds more), then ask questions in plain language: in chat, inside Slack, or through Sales and Support agents on their own website. Each answer means pulling context from across those connected tools and generating a reply with sources.

Every one of those answers is LLM inference. When each chat turn burns tokens, the gateway those tokens flow through sets your cost, your latency, and your options. For Learny, all of it flowed through a single OpenRouter key — which worked fine, right up until they wanted a second option.

You can experience the product firsthand: chat with Learny Brain right on the learny.co website. Every answer in that chat is inference routed through FreeRouter.

Phase 0 — Before

One key, one gateway, no room to move

Learny's app called OpenRouter directly. The model ids, the billing, the routing — all of it lived in application code and one provider dashboard:

Nothing wrong with this — until the day you want a different backend. Every provider change means editing code, rotating keys, and shipping a deploy to find out if it worked.

Phase 1 — Migrate

Moving to FreeRouter in a few steps

The migration keeps the app speaking the exact same OpenRouter shape and moves the key and the routing decision behind FreeRouter. In the dashboard: store the existing OpenRouter key as a provider key, create a FreeRouter key with the OpenRouter shape, and route 100% of that key's traffic to OpenRouter. Then swap two lines in the app:

base_url: https://openrouter.ai/api/v1
      --> https://api.freerouter.com/v1
api_key:  sk-or-…
      --> fr-…

Behavior after the swap is identical — same shape, same models, same upstream. The full walkthrough with verification steps is in the docs: Upgrading to FreeRouter from OpenRouter (SDK snippets: Quickstart — Migrating).

Phase 2 — Swap the backend

Darkbloom behind the scenes, no deploy

With traffic flowing through FreeRouter, changing providers is a dashboard edit, not a code change. Learny added a Darkbloom provider key (Providers lists Darkbloom as a live chat gateway with its own small model catalog) and pointed the key's routing rule at Darkbloom. The app still sends the same requests to the same FreeRouter endpoint with the same key — it never finds out the backend moved.

Two things worth knowing before you do this yourself. First, Darkbloom uses its own model ids rather than OpenRouter-style ids, so check the exact id against the provider catalog before switching a rule. Second, keep OpenRouter on the rule as a failover target while you validate: if Darkbloom answers 404 on an id or has a bad minute, a priority rule moves to the next target instead of failing the request (Routing Rules).

That is the whole point of the mediation layer: the app integrates once, and every later decision — which gateway, which model, in what proportion — happens behind the key.

What comes next

Learny's setup now leaves three obvious moves on the table: re-mapping an incoming model id to a different provider model without touching code, splitting a percentage of traffic between gateways, and running priority failover across more than two backends. Each of those gets its own post — start with Model Remaps and Routing Rules in the meantime.

Running on OpenRouter and want the same exit route? Read the migration guide, or get a FreeRouter key and route your first request today.

Route your first request today.

Bring your own keys and start routing in minutes.

Get your key