# OpenLegion > OpenLegion puts an AI agent inside your product: each of your customers gets their own agent, made from a template you write as code, working through your own functions as its tools. ## Start - [OpenLegion docs](https://platform.openlegion.ai/docs): What OpenLegion is, and where to start. - [Quickstart](https://platform.openlegion.ai/docs/quickstart): An agent in your Next.js app, chatting in your UI and calling one of your own functions, in test mode, in about 10 minutes. - [How it works](https://platform.openlegion.ai/docs/how-it-works): Templates, workspaces, agents, runs and actions: what each one is, and who holds what. - [Add OpenLegion with a coding agent](https://platform.openlegion.ai/docs/add-to-your-app): A prompt for Claude Code, Cursor or Codex that adds OpenLegion to your app. ## Guides - [Give your customers an assistant that works in your product](https://platform.openlegion.ai/docs/guides/assistant-in-your-product): From the quickstart to an assistant your customers use: your auth, a workspace per customer, tools on your own data, approvals, webhooks, limits and going live. - [Your functions as tools](https://platform.openlegion.ai/docs/guides/tools): defineTool: what ctx carries, trust and effect, tainted runs, and the tools to guard against what a run has read. - [Approvals and roles](https://platform.openlegion.ai/docs/guides/approvals): The policy, an action from held to receipt, who may approve, and deciding from your backend or your UI. - [Webhooks](https://platform.openlegion.ai/docs/guides/webhooks): Events, the kit's handlers, testing locally with npx openlegion dev, retries, and verifying an endpoint outside the kit. - [Your customers' own accounts](https://platform.openlegion.ai/docs/guides/connections): Your customers connect their own accounts, such as Google Calendar and Drive, on a page in your brand, and their agent works in them: apps, connect sessions, your own OAuth app and reconnecting. - [Let your users bring their own model key](https://platform.openlegion.ai/docs/guides/model-keys): Your users run their workspace's agents on their own Anthropic or OpenAI key: allowing it, the kit's card, what runs on the key and what stays on OpenLegion, and why a key isn't saved or a run stops. - [The chat: what streams and what reloads](https://platform.openlegion.ai/docs/guides/chat): Every part a reply streams, what history holds, what the chat reads after a reload, waiting runs, whose threads a member sees, and the kit's routes. - [Credits, budgets and limits](https://platform.openlegion.ai/docs/guides/money): What a credit is, the run budget, per-workspace caps and grants, your pool, and the refusals each one gives. - [Keys, your team and going live](https://platform.openlegion.ai/docs/guides/keys-and-team): Keys and their scopes, the three starting points, rotation, your team's roles in the console, and the checks before live mode. ## Reference - [API reference](https://platform.openlegion.ai/docs/api): Every route of the Platform API, generated from the OpenAPI document the API itself is built from. - [CLI reference](https://platform.openlegion.ai/docs/cli): The CLI, npx openlegion: init, login, dev, listen, deploy, templates, connectors and events. - [Errors](https://platform.openlegion.ai/docs/errors): Every error code: where it appears, what it means and what to do next. Every error's doc_url lands here. - [Template spec](https://platform.openlegion.ai/docs/template-spec): What a template version takes, field by field: the agents, their budget and limits, tools, connectors, triggers and what end customers may change. - [Platform tools](https://platform.openlegion.ai/docs/platform-tools): Every tool id a template can list: what the tool does, what the chat draws for it, and whether a call waits for approval by default. - [Changelog](https://platform.openlegion.ai/docs/changelog): What changed in the API, the SDK and the CLI, newest first, and the renames before the first dated version. ## Optional - [Every page in one file](https://platform.openlegion.ai/llms-full.txt): the pages above, concatenated