Get started
Lancelot Docs
Lancelot joins what each customer pays you with what they cost you in AI, then fixes the ones losing money.
Lancelot is a margin agent for companies that sell AI. It reads revenue from Stripe or RevenueCat, reads AI usage from your app, and shows the margin on every customer, plan, feature and model. When a customer costs more than they pay, it explains why and proposes a fix. With your OK, it applies the fix inside your app.
Set up in three steps
- Connect revenue. A read-only Stripe key or RevenueCat. Lancelot imports the last 12 months.
- Send usage. Wrap your OpenAI or Anthropic client with the Node.js or Python SDK, or import from OpenRouter or Helicone.
- Tag each call with a customer ID. The same ID your revenue system knows. See Customer IDs.
The Quickstart walks through all three in about ten minutes.
What Lancelot never does
- Read prompts or responses. It receives token counts, the model, a customer ID and a feature label.
- Sit between you and your model provider. Calls go straight from your app to OpenAI or Anthropic.
- Block your app when it's down. The SDK fails open: if Lancelot is unreachable, every call is allowed.
- Move money. Stripe and RevenueCat keys are read-only.
Where to go next
| If you want to | Read |
|---|---|
| Get your first margin today | Quickstart |
| Understand the numbers | How Lancelot works |
| Let Lancelot throttle, pause or switch models | Fixes and autonomy |
| Stop a runaway customer inside your app | Emergency stop and budgets |
| Call the API directly | API reference |