> For the complete documentation index, see [llms.txt](https://thegrid.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://thegrid.ai/docs/integrations-and-best-practices.md).

# Integrations and Best Practices

- [Integrations](https://thegrid.ai/docs/integrations-and-best-practices/integrations.md): Set up The Grid in IDEs, coding agents, routers, and agent frameworks.
- [AgentSea | Launch AI agents wired to The Grid](https://thegrid.ai/docs/integrations-and-best-practices/integrations/agentsea.md): Launch a supported AI agent locally or on a fresh cloud VM with one command, pre-wired to The Grid. Install the agentsea CLI, add your key, and connect.
- [Custom Agent Integration with The Grid | OpenAI API Setup](https://thegrid.ai/docs/integrations-and-best-practices/integrations/general-agent-skill.md): Connect any custom agent to The Grid with the OpenAI API. Set the base URL, add a consumption key, choose an instrument, and handle 402 retries.
- [Cline Integration with The Grid | OpenAI API Setup](https://thegrid.ai/docs/integrations-and-best-practices/integrations/cline.md): Connect Cline to The Grid with the OpenAI-compatible API. Set the base URL, add your consumption key, choose an instrument, and start coding.
- [Continue Integration with The Grid | config.yaml Setup](https://thegrid.ai/docs/integrations-and-best-practices/integrations/continue.md): Set up Continue with The Grid in config.yaml. Add your API key, point to the OpenAI-compatible endpoint, and map models to chat, edit, and autocomplete.
- [Cursor Integration with The Grid | Custom Provider Setup](https://thegrid.ai/docs/integrations-and-best-practices/integrations/cursor.md): Use The Grid in Cursor by overriding the OpenAI base URL, adding your API key, and registering Grid instruments as custom chat models.
- [Claude Code Integration with The Grid | Anthropic API Setup](https://thegrid.ai/docs/integrations-and-best-practices/integrations/claude-code.md): Use Claude Code with The Grid through the Anthropic Messages API. Set environment variables, map model aliases, and run Claude Code normally.
- [Kilo Code Integration with The Grid | VS Code and CLI Setup](https://thegrid.ai/docs/integrations-and-best-practices/integrations/kilocode.md): Connect Kilo Code to The Grid in VS Code or the CLI. Add your consumption key, select The Grid, and choose instruments for each mode.
- [OpenCode Integration with The Grid | Provider Setup](https://thegrid.ai/docs/integrations-and-best-practices/integrations/opencode.md): Connect OpenCode to The Grid with opencode auth /connect. Add your consumption key, choose model and small\_model, and run the agent loop.
- [OpenClaw Integration with The Grid | Custom Backend Setup](https://thegrid.ai/docs/integrations-and-best-practices/integrations/openclaw.md): Set up OpenClaw with The Grid as a custom OpenAI-compatible backend. Add a provider, allowlist instruments, and restart the gateway.
- [CrewAI Integration with The Grid | Agent LLM Setup](https://thegrid.ai/docs/integrations-and-best-practices/integrations/crewai.md): Connect CrewAI to The Grid with the LLM class. Use the OpenAI-compatible endpoint, assign Grid models to agents, and tier by role.
- [Deep Agents Integration with The Grid | LangChain Setup](https://thegrid.ai/docs/integrations-and-best-practices/integrations/deepagents.md): Use Deep Agents with The Grid through ChatOpenAI. Point to the OpenAI-compatible endpoint and set use\_responses\_api=False.
- [DeerFlow Integration with The Grid | config.yaml Setup](https://thegrid.ai/docs/integrations-and-best-practices/integrations/deerflow.md): Set up DeerFlow with The Grid in config.yaml. Add ChatOpenAI models, point to the Grid endpoint, and set use\_responses\_api to false.
- [Hermes Agent Integration with The Grid | Provider Setup](https://thegrid.ai/docs/integrations-and-best-practices/integrations/hermes-agent.md): Connect Hermes Agent to The Grid as a custom provider. Update config.yaml, set your API key, patch redirects, and route agent runs.
- [LiteLLM Integration with The Grid | SDK and Proxy Setup](https://thegrid.ai/docs/integrations-and-best-practices/integrations/litellm.md): Use LiteLLM with The Grid as an OpenAI-compatible backend. Connect through the Python SDK or proxy and route downstream tools.
- [ClawRouter with The Grid | Supported Routing Options](https://thegrid.ai/docs/integrations-and-best-practices/integrations/clawrouter.md): ClawRouter cannot route to The Grid as a backend; here's what works instead in OpenClaw.
- [Manifest Integration with The Grid | Custom Backend Setup](https://thegrid.ai/docs/integrations-and-best-practices/integrations/manifest.md): Connect Manifest to The Grid as a custom OpenAI-compatible backend. Add Grid models, map them to routing tiers, and automate selection.
- [Migrating from OpenAI](https://thegrid.ai/docs/integrations-and-best-practices/migrating-from-openai.md): Switch from the OpenAI API to The Grid by changing three values in your existing code, base URL, API key, and model string. Your SDK, request body, and response shape stay the same.
- [Migrating from Anthropic](https://thegrid.ai/docs/integrations-and-best-practices/migrating-from-anthropic.md): Move an Anthropic-based application to The Grid. Keep the Anthropic SDK against our Messages API beta, or swap to the OpenAI SDK against the Consumption API.
- [Any OpenAI-compatible tool](https://thegrid.ai/docs/integrations-and-best-practices/any-openai-compatible-tool.md): Any tool that targets OpenAI's Chat Completions API works with The Grid. Set the base URL, API key, and model. Tools built on OpenAI's Responses API (Codex and similar) don't work yet.
- [Routing patterns](https://thegrid.ai/docs/integrations-and-best-practices/routing-patterns.md): How to allocate workloads across our nine instruments. Default to Prime, escalate to Max for hard tasks, demote to Standard for volume.
- [Troubleshooting](https://thegrid.ai/docs/integrations-and-best-practices/troubleshooting.md): Common errors when integrating with The Grid and how to fix them. Auth, base URLs, instrument strings, balance, and the "is it me or The Grid" diagnostic flow.
- [Best practices for development](https://thegrid.ai/docs/integrations-and-best-practices/best-practices.md): Production patterns for The Grid. Tier routing, two-balance accounting, retry-on-retryable, streaming, FIFO consumption, Auto Mode limits, instrument pinning.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://thegrid.ai/docs/integrations-and-best-practices.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
