# Cruxy Learn > OpenAI-compatible LLM gateway for the Cruxy model tiers (canto, saga, and epos), plus embeddings, rerank, and content moderation behind one base URL (https://api.cruxy.ai) and one Bearer key. Each link points at the page as raw markdown (its URL with a `.md` suffix), for direct model ingestion rather than HTML. For every page concatenated into one file, fetch https://learn.cruxyai.com/llms-full.txt. The same pages are served by a read-only MCP server at https://learn.cruxyai.com/mcp (Streamable HTTP, no key) with three tools: list_pages, get_page, and search_docs. ## Learn - [Start here](https://learn.cruxyai.com/learn/en/start-here.md): Two reading paths through the Cruxy API: the whole API in nine pages, and building an agent with tools, structured output, memory, and rules. ## Docs - [One gateway for every model tier](https://learn.cruxyai.com/docs/en.md): An OpenAI-compatible LLM gateway for the Cruxy model tiers: chat, embeddings, and moderation behind one API key. - [Features overview](https://learn.cruxyai.com/docs/en/get-started/features.md): What the Cruxy gateway gives you: OpenAI-compatible chat on three tiers, specialized model endpoints, and memory and rules you control. - [Quickstart](https://learn.cruxyai.com/docs/en/get-started/quickstart.md): Get an API key with device login, then make your first chat call. - [Get your API key](https://learn.cruxyai.com/docs/en/get-started/api-keys.md): Pick the right kind of key, mint a signed-in key with device login, verify it with GET /api/v1/me, and know when it expires. - [Authentication](https://learn.cruxyai.com/docs/en/get-started/authentication.md): Send your Cruxy API key as a Bearer token in the Authorization header on every authenticated request. - [Migrate from OpenAI](https://learn.cruxyai.com/docs/en/migrate/from-openai.md): Move an OpenAI client to Cruxy: change the base URL and the key, pass a tier as the model, and know what carries over and what differs. - [OpenAI SDK compatibility](https://learn.cruxyai.com/docs/en/migrate/openai-sdk-compatibility.md): What POST /v1/chat/completions supports, ignores, and rejects from an OpenAI request, and how its streams, tool calls, and errors behave in the openai SDK. - [Chat](https://learn.cruxyai.com/docs/en/build/chat.md): OpenAI-compatible chat completions across the Cruxy tiers, streaming or not. - [Streaming](https://learn.cruxyai.com/docs/en/build/streaming.md): Read chat completions as Server-Sent Events: the frame order, the chunk and usage shapes, and how to tell a finished stream from a failed one. - [Embeddings](https://learn.cruxyai.com/docs/en/build/embeddings.md): Turn text into vectors with the cruxy-embed model. - [Rerank](https://learn.cruxyai.com/docs/en/build/rerank.md): Order candidate documents against a query with the cruxy-rerank model. - [Moderations](https://learn.cruxyai.com/docs/en/build/moderations.md): Classify text against content-safety categories with the cruxy-guard model. - [Feedback](https://learn.cruxyai.com/docs/en/build/feedback.md): Report the outcome of a prior call: accepts, rejects, thumbs, test results. - [Conversations](https://learn.cruxyai.com/docs/en/build/conversations.md): Store chat history on the server: create a conversation, append each turn, list and count the shelves, search your own messages, and archive. - [Files](https://learn.cruxyai.com/docs/en/build/files.md): Upload a file, read its metadata, download its content, and attach it to a chat turn with file_ids. Chat reads text, PDF, Word, and image files. - [Choosing a tier](https://learn.cruxyai.com/docs/en/build/choosing-a-tier.md): Compare canto, saga, and epos by profile, output cap, deadline, and reasoning default, then pick the tier that fits each call. - [Auto routing](https://learn.cruxyai.com/docs/en/build/auto-routing.md): Send model auto and the gateway picks a tier for each request before billing; read cruxy.routed_tier to see which tier served it. - [Reasoning effort](https://learn.cruxyai.com/docs/en/build/reasoning-effort.md): Set how much a tier thinks before it answers, from none to high, and keep hidden thinking from spending your whole max_tokens budget. - [Memory](https://learn.cruxyai.com/docs/en/build/memory.md): Let chat recall stored facts and capture new ones. Memory is on by default for signed-in keys and off for developer keys until a request opts in. - [Standing rules](https://learn.cruxyai.com/docs/en/build/rules.md): Inject your organization's standing rules into chat as defaults. Rules are on for signed-in keys and off for developer keys unless you opt in. - [Vaults](https://learn.cruxyai.com/docs/en/build/vaults.md): A vault is a shared space in your organization: its members share memory, rules, and files. Create one, manage members, and chat inside it. - [Indic languages](https://learn.cruxyai.com/docs/en/build/indic-languages.md): Cruxy supports 20+ Indic languages. Send text as UTF-8, measure token counts per script with the tokens endpoint, and test each language before launch. - [Prompts](https://learn.cruxyai.com/docs/en/build/prompts.md): Store a prompt under a stable name, add immutable versions as you revise it, and fetch a version at runtime to send to chat. - [Define tools](https://learn.cruxyai.com/docs/en/build/tools.md): Describe your functions in the tools array with a JSON Schema for their arguments, and use tool_choice to control when the model calls one. - [Handle tool calls](https://learn.cruxyai.com/docs/en/build/tool-calls.md): Read the tool calls the model returns, run each function, send every result back by tool_call_id, and repeat until finish_reason is stop. - [Tutorial: build a tool-using agent](https://learn.cruxyai.com/docs/en/build/tool-agent.md): Build a working TypeScript agent that offers two tools, runs the calls the model returns, and loops on finish_reason until it answers. - [Reliability](https://learn.cruxyai.com/docs/en/build/reliability.md): Run Cruxy in production: per-tier deadlines, which errors to retry and how, Idempotency-Key, telling a finished stream from a failed one, and status. - [Errors and retries](https://learn.cruxyai.com/docs/en/build/errors-and-retries.md): Read the error envelope, look up every error code the API defines, and decide which failures to retry and how long to wait. - [Rate limits and budgets](https://learn.cruxyai.com/docs/en/build/rate-limits.md): How the gateway meters you: rate_limited versus budget_exhausted, the rate-limit headers, spend caps, and reading your live headroom. - [Plan limits](https://learn.cruxyai.com/docs/en/build/plan-limits.md): What each Cruxy plan allows: models, context window, usage share for the API, uploads, storage, and projects, and when each allowance resets. - [Usage and cost](https://learn.cruxyai.com/docs/en/build/usage-and-cost.md): Read the usage object on each response: token counts, billable and cached tokens, the shape of the cost object, and how a stream reports usage. - [Request IDs and metadata](https://learn.cruxyai.com/docs/en/build/request-ids.md): Read the X-Request-Id header and each call's request_id, the Cruxy-Version header and the cruxy block, and quote a request when you report a problem. - [Organizations and workspaces](https://learn.cruxyai.com/docs/en/build/organization.md): Invite people to your organization, manage roles and memberships, review organization memory suggestions, and split spend across workspaces. - [Production checklist](https://learn.cruxyai.com/docs/en/best-practices/production-checklist.md): Check an integration before launch: the key kind, memory and rules on every request, idempotency, timeouts and retries, stream completion, request IDs, status. - [Tier and effort for cost and latency](https://learn.cruxyai.com/docs/en/best-practices/tiers-and-effort.md): Pick a tier and a reasoning effort for each kind of call by its cost and latency, starting from a default per job and measuring with each response's usage. - [Prompting basics](https://learn.cruxyai.com/docs/en/best-practices/prompting.md): Write prompts for canto, saga, and epos: what the gateway adds to every turn, where your instructions go, how to size max_tokens, and how to test a prompt. - [Evals](https://learn.cruxyai.com/docs/en/build/evals.md): Run the same test cases against a tier and read a pass or fail for each: create a suite, add cases, start a run, and poll for results. - [Security](https://learn.cruxyai.com/docs/en/best-practices/security.md): Keep Cruxy keys out of browsers, code, and logs, scope each key to what it needs, keep secrets out of memory, and turn capture off for anonymous traffic. - [TypeScript SDK](https://learn.cruxyai.com/docs/en/sdk/typescript.md): Install the Cruxy TypeScript SDK, published on npm as @cruxy/api, create a client with your key, and call chat, embeddings, rerank, and more. - [Chat with the TypeScript SDK](https://learn.cruxyai.com/docs/en/sdk/typescript/chat.md): Send chat requests with the TypeScript SDK, read the native v2 response, stream the reply, call tools, and set memory, rules, and files per request. - [Embeddings, rerank, and more with the SDK](https://learn.cruxyai.com/docs/en/sdk/typescript/methods.md): Call embeddings, rerank, moderations, models, token counting, identity, device login, and feedback with the TypeScript SDK, and read the results. - [SDK errors, retries, and timeouts](https://learn.cruxyai.com/docs/en/sdk/typescript/errors-and-retries.md): Catch the TypeScript SDK's typed errors, set up retries that follow the gateway's retry contract, and set timeouts, idempotency keys, and request IDs. - [Errors](https://learn.cruxyai.com/docs/en/reference/errors.md): The error response shape and what 400, 401, 403, and 429 mean. ## API Reference - [API Reference](https://learn.cruxyai.com/docs/en/reference/api.md): The complete Cruxy API: every endpoint, typed and interactive. ## Cruxy Code - [Get started with the CLI](https://learn.cruxyai.com/docs/en/cruxy-code.md): Install the cruxy coding agent from npm, check the Node.js version it needs, sign in, and run your first task from a terminal. - [Sign in from the CLI](https://learn.cruxyai.com/docs/en/cruxy-code/authentication.md): Sign the cruxy CLI in with device login, know what the credential it saves can do, when it expires, and how to sign out and revoke it. - [CLI command reference](https://learn.cruxyai.com/docs/en/cruxy-code/commands.md): Every cruxy command, subcommand, flag, and default as the 1.19.0 help prints them, plus the session commands, keys, and exit codes. - [CLI configuration](https://learn.cruxyai.com/docs/en/cruxy-code/configuration.md): Where the cruxy CLI reads settings from, the order they merge in, the environment variables it honors, and the defaults for each setting. - [Projects, permissions, and context](https://learn.cruxyai.com/docs/en/cruxy-code/projects-and-context.md): How the cruxy CLI scopes work to a project, what asks for your approval, what stays on your machine, and what it sends to the Cruxy API. - [Troubleshoot the CLI](https://learn.cruxyai.com/docs/en/cruxy-code/troubleshooting.md): Read a cruxy error and its code, then fix the sign-in, config, network, approval, and setup failures you are most likely to hit. ## Cookbook - [Cookbook](https://learn.cruxyai.com/docs/en/resources/cookbook.md): Task-shaped recipes that combine Cruxy endpoints to do a real job: retrieval, tool loops, streaming, moderation, extraction, and evals. - [Retrieval-augmented generation](https://learn.cruxyai.com/docs/en/resources/cookbook/rag.md): Embed a corpus, rank it by cosine, reorder the shortlist with rerank, then ground a chat answer in the winning passages. - [Streaming chat in the browser](https://learn.cruxyai.com/docs/en/resources/cookbook/streaming-ui.md): Consume the OpenAI-style SSE stream in a browser, render deltas without jank, and recover when the connection breaks mid-response. - [Moderation gate](https://learn.cruxyai.com/docs/en/resources/cookbook/moderation-gate.md): Screen user input with cruxy-guard before it reaches chat, and act on the flagged boolean, not the uncalibrated category scores. - [Structured JSON extraction](https://learn.cruxyai.com/docs/en/resources/cookbook/structured-extraction.md): Turn free text into JSON that matches your schema: pick a tier that supports structured output, send response_format, and validate the result. - [Retrieval over vault files](https://learn.cruxyai.com/docs/en/resources/cookbook/vault-retrieval.md): Answer a question from the text files a vault holds: list them, download and chunk the text, rank with embeddings and rerank, then ask chat. - [Compare two prompt versions with evals](https://learn.cruxyai.com/docs/en/resources/cookbook/prompt-eval-loop.md): Decide between two versions of a stored prompt with data: build an eval suite for each from the same cases, run both on one tier, and compare. ## Resources - [Resources](https://learn.cruxyai.com/docs/en/resources.md): Reference material, tools for models and agents, and help: the tier catalog, changelog, glossary, llms.txt, the Docs MCP server, and support. - [Models](https://learn.cruxyai.com/docs/en/reference/models.md): Discover the public tier catalog at runtime with GET /api/v1/models. - [Changelog](https://learn.cruxyai.com/docs/en/reference/changelog.md): What changed in the Cruxy API and its docs, newest first: each dated release by its API version, plus the additive changes that need no pin. - [Glossary](https://learn.cruxyai.com/docs/en/resources/glossary.md): Definitions for the Cruxy vocabulary: tiers, the cruxy block, request_id, device login, and the 429 codes. - [API guide for agents](https://learn.cruxyai.com/docs/en/resources/api-guide.md): A dense, single-page reference for calling the Cruxy API correctly: auth, tiers, chat, tool calling, embeddings, rerank, moderations, and errors. - [Docs MCP server](https://learn.cruxyai.com/docs/en/resources/mcp-server.md): Connect an MCP client to these docs at learn.cruxyai.com/mcp to list, read, and search every page as tools. Public and read-only, with no key. - [Known limitations](https://learn.cruxyai.com/docs/en/build/known-limitations.md): What the Cruxy API does not do today, why each limit matters for your code, and the workaround to use until it changes. - [Support](https://learn.cruxyai.com/docs/en/resources/support.md): Check platform status at status.cruxyai.com, look up an error, and email support@cruxyai.com with the IDs that let support find your request.