# Coding agents Use PrivateMind with your favorite coding agent, IDE, or editor. OpenAI-compatible endpoint, no proxy required. Most coding agents and AI-powered IDEs speak the OpenAI API, and PrivateMind serves the same API at a different base URL. Swap `https://api.openai.com` for `https://api.privatemind.com`, paste your PMIND key, and pick a model from your org's catalog. For Claude Code, which uses the Anthropic API, see [Claude Code](https://docs.privatemind.com/coding-agents.html#claude-code). ## The general setup | Setting | Value | | --- | --- | | **Base URL** | `https://api.privatemind.com/v1` | | **API key** | Your PMIND key from the **API Keys** page | | **Model** | Anything from your catalog: `fast`, `reasoning`, or a specific model id | Any tool that lets you set a custom OpenAI-compatible endpoint works. It talks to PrivateMind directly, with no proxy or local server in between. ## Cline [Cline](https://cline.bot) is a VS Code extension for AI-assisted coding: file edits, terminal commands and completions. **1. Install** Open VS Code → Extensions → search **Cline** → Install. **2. Open provider settings** Click the Cline icon in the Activity Bar, open Settings (⚙), and choose **OpenAI Compatible**. **3. Fill in PrivateMind** | Setting | Value | | --- | --- | | Base URL | `https://api.privatemind.com/v1` | | API Key | Your PMIND key | | Model ID | `fast` or any model from your catalog | Click **Done**. Cline now routes every completion through PrivateMind. **4. Test it** Open a file and ask Cline to explain a function or refactor some code. The answer comes from your org's models, not OpenAI's. ## Cursor [Cursor](https://cursor.com) is an AI-native code editor. Composer, Cmd+K, and tab completion all support custom providers. 1. Open **Cursor Settings → Models**. 2. Scroll to **OpenAI API**. 3. Turn on **Use your own key**. 4. Set: - **OpenAI Base URL**: `https://api.privatemind.com/v1` - **OpenAI API Key**: Your PMIND key Cursor composers and completions now run on your PrivateMind deployment instead of Cursor's built-in models. ## Kilo Code [Kilo Code](https://kilo.ai) is an open-source coding agent for VS Code and JetBrains IDEs, built on OpenCode, with chat, agent mode and multi-file edits. **1. Install** In VS Code, open Extensions, search **Kilo Code** and install it. In a JetBrains IDE, open **Settings → Plugins → Marketplace** and install **Kilo Code**. Open Kilo Code once so it creates its config. **2. Add PrivateMind as a provider** Edit Kilo's global config, `~/.config/kilo/kilo.jsonc` (on Windows, `%USERPROFILE%\.config\kilo\kilo.jsonc`). VS Code, JetBrains and the `kilo` CLI all read this file: ```json { "$schema": "https://app.kilo.ai/config.json", "model": "privatemind/fast", "provider": { "privatemind": { "npm": "@ai-sdk/openai-compatible", "name": "PrivateMind", "options": { "baseURL": "https://api.privatemind.com/v1", "apiKey": "PMIND...:..." }, "models": { "fast": { "name": "Fast", "limit": { "context": 128000, "output": 4096 } }, "reasoning": { "name": "Reasoning", "limit": { "context": 200000, "output": 65536 } } } } } } ``` In VS Code you can add the same provider from Kilo's Settings (⚙) instead. Open **Providers → Custom provider**, set Provider API to **OpenAI Compatible** and Base URL to `https://api.privatemind.com/v1`, and enter your PMIND key. Then click **Fetch models** to pick from your catalog. Context and output limits can only be set in the file. **3. Test it** Pick a PrivateMind model in Kilo's model picker and ask it to explain or change some code. Chat and agent requests go to your org's models. > [!NOTE] > Kilo's inline autocomplete runs on Kilo's own gateway, not on a custom provider, so it does not use PrivateMind. ## OpenCode [OpenCode](https://opencode.ai) is a terminal-based coding agent that talks to any OpenAI-compatible provider. Edit `opencode.json` (project root or `~/.config/opencode/opencode.json`): ```json { "$schema": "https://opencode.ai/config.json", "provider": { "privatemind": { "npm": "@ai-sdk/openai-compatible", "name": "PrivateMind", "options": { "baseURL": "https://api.privatemind.com/v1", "apiKey": "PMIND...:..." }, "models": { "fast": { "name": "Fast", "limit": { "context": 128000, "output": 4096 } }, "reasoning": { "name": "Reasoning", "limit": { "context": 200000, "output": 65536 } } } } } } ``` Run `npx opencode` and pick the PrivateMind provider in `/models`. ## Claude Code [Claude Code](https://code.claude.com) speaks the Anthropic Messages API, which PrivateMind also serves ([Messages API](https://docs.privatemind.com/messages-api.html)). Point it at PrivateMind with environment variables: ```bash export ANTHROPIC_BASE_URL=https://api.privatemind.com export ANTHROPIC_AUTH_TOKEN="PMIND...:..." export ANTHROPIC_MODEL= export ANTHROPIC_DEFAULT_OPUS_MODEL= export ANTHROPIC_DEFAULT_SONNET_MODEL= export ANTHROPIC_DEFAULT_HAIKU_MODEL= export CLAUDE_CODE_SUBAGENT_MODEL= claude ``` Set **every** model variable. Claude Code runs background tasks, such as titles and summaries, on its small-model slot. An unset slot asks for a `claude-*` model name, which PrivateMind does not have. You can put a faster model in the Haiku slot and a stronger one in the others. Two of Claude Code's web tools behave differently through PrivateMind: - **WebSearch** runs as a server-side tool on Anthropic's API. PrivateMind doesn't run it and doesn't return an error. The model answers from what it already knows, without searching, so don't rely on its results being current. - **WebFetch** fetches pages from your machine, but first asks `api.anthropic.com` whether each domain is allowed. That check sends every fetched domain to Anthropic, and fails where `api.anthropic.com` is blocked. Set `"skipWebFetchPreflight": true` in Claude Code's settings to turn it off. Everything else works: file edits, the shell, subagents, MCP servers and hooks. ## Codex CLI [Codex CLI](https://github.com/openai/codex) speaks the OpenAI Responses API, which PrivateMind also serves ([Responses API](https://docs.privatemind.com/responses-api.html)). The quickest setup is from the key screen: 1. Create a key on the **API Keys** page. 2. In the **Save Your API Key** dialog, pick **Codex CLI** and choose **Download config.toml (key included)**. 3. Save the file as `~/.codex/config.toml`. If you already have that file, merge the two (see below). The file sets your default model and its context window. It also holds the key itself as `experimental_bearer_token`, so keep it private, for example with `chmod 600 ~/.codex/config.toml`. To write the file yourself, add PrivateMind as a provider in `~/.codex/config.toml`: ```toml model = "coding" model_provider = "privatemind" check_for_update_on_startup = false [analytics] enabled = false [features] plugins = false [model_providers.privatemind] name = "PrivateMind" base_url = "https://api.privatemind.com/v1" env_key = "PRIVATEMIND_API_KEY" wire_api = "responses" ``` Put your key in the variable that `env_key` names, then start Codex: ```bash export PRIVATEMIND_API_KEY="PMIND...:..." codex ``` - **Don't call the provider `OpenAI`.** Codex turns on behaviour meant for OpenAI's own API when the provider has that exact name. - **`model`** takes any chat model id or alias from your catalog. The example uses the `coding` alias. - **`[analytics]`, `[features]` and `check_for_update_on_startup`** stop Codex's own traffic to its vendor: without them it sends usage metrics and syncs a plugin catalog on every start. With them, Codex connects only to PrivateMind. - **If you already have a `config.toml`**, put the top-level lines above its first `[section]` and merge the sections. Top-level keys placed after a section belong to that section, and Codex then falls back to its default provider. - **"Model metadata for `coding` not found. Defaulting to fallback metadata"** is printed at start. It is harmless. Tool calls, resuming a session, `--output-schema`, viewing images on a vision model and automatic compaction all work. With `--output-schema`, a final answer that doesn't match the schema is generated again with the schema enforced (see [Structured output](https://docs.privatemind.com/responses-api.html#with-tools-on-offer)). Codex's web search is a hosted tool that PrivateMind does not run, so with it on, the model answers without searching. ## KX qSQL suggester [mcp-qsql-suggester](https://github.com/KxSystems/mcp-qsql-suggester) is KX's MCP server for writing q/kdb+ queries. Its one tool, `generate_qsql`, draws several candidate queries from the `qsql-qwen35-9b` model, parses and runs each one, and returns the shortest of the largest group that agree. You run the server yourself and point it at PrivateMind for the model. Install it from their README, then start it against PrivateMind: ```bash VLLM_BASE_URL=https://api.privatemind.com/v1 \ VLLM_API_KEY=$PMIND_KEY \ MCP_QSQL_HOST=127.0.0.1 \ python -m mcp_server.server --transport streamable-http ``` Nothing else needs changing: the server asks for `qsql-qwen35-9b`, the id PrivateMind serves the model under. First check with `GET /v1/models` that the model is in your org's catalog. Then point your MCP client at `http://127.0.0.1:9000/mcp`. Their repo also includes two Claude Code skills, `/qsql-coder` and `/qsql-coder-quick`, that drive the tool and check what comes back. > [!WARNING] > The server runs the q it generates and has no authentication of its own, so keep it on loopback or behind something that authenticates. Their README covers running it for a team. ## What works Because PrivateMind is OpenAI-compatible, these tools and many more work out of the box: - **VS Code extensions**: Cline, Kilo Code, Tabnine (BYOK mode), Codeium (BYOK mode) - **IDEs**: Cursor, Windsurf, Zed - **Terminal tools**: Aider, Codex CLI, Opencode, ollama (with remote endpoint configured) - **Automation**: n8n, Make.com, Zapier (use the HTTP module with the OpenAI format) If it asks for an OpenAI API key or base URL, give it your PMIND key and `https://api.privatemind.com/v1`. Claude Code and other tools built on the Anthropic API are set up differently: see [Claude Code](https://docs.privatemind.com/coding-agents.html#claude-code) above. Codex CLI needs a provider entry: see [Codex CLI](https://docs.privatemind.com/coding-agents.html#codex-cli). ## Where next - [Models](https://docs.privatemind.com/models.html) to browse what's in your org's catalog - [Authentication](https://docs.privatemind.com/authentication.html) for key format and rotation - [OpenAI SDK compatibility](https://docs.privatemind.com/openai-sdk.html) if you want to write your own tooling