# MandAPI Cookbook (en) Base API: https://api.mandapi.com/v1 Examples require an account API key and a model available to that key. - [Build a small streaming chat app](https://mandapi.com/en/cookbook/get-started/chat-app.md): List your available models, send one message, stream the reply, and keep a local conversation using the OpenAI-compatible MandAPI endpoint. - [Move an OpenAI-compatible chat integration to MandAPI](https://mandapi.com/en/cookbook/get-started/migrate.md): Change the chat connection boundary while preserving the application's existing messages, response handling and interface. - [Connect Claude Code to MandAPI](https://mandapi.com/en/cookbook/coding-agents/claude-code.md): Configure the Anthropic-compatible endpoint, choose a supported model and check your first coding session. - [Configure Claude Desktop with a MandAPI gateway](https://mandapi.com/en/cookbook/coding-agents/claude-desktop.md): Use Claude Desktop's third-party inference panel with an Anthropic-compatible MandAPI connection. - [Review a selected code diff with MandAPI](https://mandapi.com/en/cookbook/coding-agents/code-review.md): Preview a small staged diff, then request a second opinion without changing or committing code. - [Use Codex CLI with MandAPI](https://mandapi.com/en/cookbook/coding-agents/codex-cli.md): Add a custom Responses provider with an environment-based key, while keeping existing project settings. - [Start a coding session in MandAPI Connect](https://mandapi.com/en/cookbook/coding-agents/connect.md): Use the Windows desktop app to open Claude Code or Codex CLI with your MandAPI account. - [Use MandAPI for chat in Cursor](https://mandapi.com/en/cookbook/coding-agents/cursor.md): Set the OpenAI-compatible endpoint in Cursor and start with a supported chat model. - [Connect Hermes Agent to MandAPI](https://mandapi.com/en/cookbook/coding-agents/hermes.md): Add MandAPI as a custom Chat Completions endpoint in Hermes. - [Create a MandAPI model profile for Junie CLI](https://mandapi.com/en/cookbook/coding-agents/junie.md): Use Junie's custom JSON profiles with a complete Chat Completions request URL. - [Use an MCP tool with a MandAPI-backed coding session](https://mandapi.com/en/cookbook/coding-agents/mcp-servers.md): Keep model inference in MandAPI while Claude Code connects to an MCP server locally. - [Add MandAPI as an OpenClaw model provider](https://mandapi.com/en/cookbook/coding-agents/openclaw.md): Register a custom provider, select a real model and check a local chat before connecting channels. - [Add MandAPI to OpenCode v1](https://mandapi.com/en/cookbook/coding-agents/opencode.md): Configure an OpenAI-compatible provider and select your MandAPI model in OpenCode v1. - [Build an FAQ support chat in n8n](https://mandapi.com/en/cookbook/integrations/n8n-support.md): Download a small workflow, connect a MandAPI credential, and answer support questions from an editable business FAQ. - [Describe objects in an image with MandAPI](https://mandapi.com/en/cookbook/integrations/vision.md): Send a local image to a current Vision-capable model through Chat Completions. - [Build a small terminal interface for your agent](https://mandapi.com/en/cookbook/building-agents/agent-tui.md): Expose progress, reference reads, and resumable steps with a portable Python terminal interface. - [Summarize an older conversation while keeping recent turns](https://mandapi.com/en/cookbook/building-agents/compact-context.md): Compact application-managed message history without promoting a summary to an instruction. - [Draft with one model and review with another](https://mandapi.com/en/cookbook/building-agents/delegate.md): Coordinate two ordinary chat requests in your own application. - [Stop repeated tool calls and runaway agent loops](https://mandapi.com/en/cookbook/building-agents/detect-loops.md): Enforce a step limit and detect identical calls using application trace data. - [Build a headless agent with read-only tools](https://mandapi.com/en/cookbook/building-agents/headless-agent.md): Create a Python worker with local action validation, JSON events, saved state, and bounded chat requests. - [Require human approval before an action](https://mandapi.com/en/cookbook/building-agents/human-approval.md): Keep a model's proposed action separate from permission to execute it. - [Resume longer tasks from local checkpoints](https://mandapi.com/en/cookbook/building-agents/long-horizon.md): Keep progress across runs without resetting attempt limits or treating saved text as system instructions. - [Classify supplied support messages into a fixed set of labels](https://mandapi.com/en/cookbook/evaluate-and-optimize/classify-text.md): Ask a chat model for JSON, then validate the result in your application. - [Prepare reviewed examples for a smaller-model experiment](https://mandapi.com/en/cookbook/evaluate-and-optimize/distillation.md): Build a local JSONL dataset and holdout set without assuming a MandAPI training service. - [Extract and validate fields from invoice text](https://mandapi.com/en/cookbook/evaluate-and-optimize/extract-invoice.md): Turn supplied invoice text into a small validated record using ordinary chat output. - [Build multilingual RAG with local retrieval and MandAPI](https://mandapi.com/en/cookbook/evaluate-and-optimize/rag.md): Compute neural embeddings and reranking locally, then let MandAPI answer from the selected passages. - [Check the boundaries of your own FAQ application](https://mandapi.com/en/cookbook/evaluate-and-optimize/red-teaming.md): Run harmless local cases for unknown questions, policy overrides and fabricated actions. - [Export your application's usage events as CSV](https://mandapi.com/en/cookbook/administration/activity-export.md): Turn your own JSONL records into a minimal spreadsheet report without treating it as a platform bill. - [Review the API keys in your account](https://mandapi.com/en/cookbook/administration/key-audit.md): Build a useful key inventory, identify unused connections and reduce the impact of a lost or exposed key. - [Replace an API key without losing track of active applications](https://mandapi.com/en/cookbook/administration/key-rotation.md): Create a replacement, update each consumer, verify the connection and revoke the old credential. - [Read token usage and reconcile it with your dashboard](https://mandapi.com/en/cookbook/administration/usage.md): Capture the usage returned by a chat response and compare it with the actual request and credit records in your own account. - [Record application usage by anonymous user](https://mandapi.com/en/cookbook/administration/user-tracking.md): Add your own request identifiers and minimal usage events without assuming a MandAPI analytics API.