Neovim with the Gateway
Use a Neovim plugin that exposes a custom OpenAI-compatible HTTP adapter. This guide uses CodeCompanion.nvim, whose current configuration separates HTTP adapters from chat and inline interactions.
GitHub Copilot plugins use GitHub's own protocol and authentication. The Keeptrusts gateway is not a forward proxy, so pointing HTTP_PROXY or HTTPS_PROXY at port 41002 does not route Copilot traffic through Keeptrusts.
Prerequisites
-
Complete Gateway Setup for IDEs.
-
Install CodeCompanion using its current installation guide.
-
Export a client API token before starting Neovim:
export KEEPTRUSTS_IDE_TOKEN="kt_..."
Configure CodeCompanion
Extend CodeCompanion's OpenAI-compatible HTTP adapter and select it for chat and inline interactions:
require("codecompanion").setup({
adapters = {
http = {
keeptrusts = function()
return require("codecompanion.adapters").extend("openai_compatible", {
env = {
url = "http://127.0.0.1:41002",
api_key = "KEEPTRUSTS_IDE_TOKEN",
chat_url = "/v1/chat/completions",
},
schema = {
model = {
default = "gpt-5.4-mini",
},
},
})
end,
},
},
interactions = {
chat = {
adapter = "keeptrusts",
},
inline = {
adapter = "keeptrusts",
},
},
})
Replace gpt-5.4-mini with a model identifier exposed by your gateway. The model name must resolve to a configured provider target; the editor configuration alone does not enable it.
This setup governs the HTTP interactions assigned to keeptrusts. ACP/CLI agents and GitHub Copilot integrations have separate transports and are not covered by this adapter.
Verify the governed path
Check authentication and model discovery from the same environment that launches Neovim:
curl -fsS \
-H "Authorization: Bearer $KEEPTRUSTS_IDE_TOKEN" \
http://127.0.0.1:41002/v1/models
Follow Keeptrusts events, then open a CodeCompanion chat or perform an inline edit:
kt events tail --since 10m --follow
A matching event proves that the request traversed the gateway. If no event appears, first check gateway event delivery, the CLI organization and region, the event time window and filters, and then CodeCompanion's active adapter.
Using another Neovim plugin
The same integration is possible when a plugin lets you configure:
- the OpenAI-compatible base URL or
/v1/chat/completionsendpoint - bearer-token authentication
- the exact model identifier
- streaming, tools, or other capabilities the plugin requires
Follow that plugin's current documentation because option names and supported interactions change independently of Keeptrusts. Do not claim chat, inline, completion, or agent coverage until each interaction produces a Keeptrusts event.
Troubleshooting
| Symptom | Check |
|---|---|
| Connection refused | Confirm kt gateway status and the configured port. |
401 Unauthorized | Confirm Neovim inherited KEEPTRUSTS_IDE_TOKEN and that the token is active. |
| Model error | Compare the adapter model with the authenticated /v1/models response. |
| Chat works but inline does not | Confirm both interactions select keeptrusts and that the chosen model supports the request. |
| No Keeptrusts event | Inspect CodeCompanion's active HTTP adapter; another adapter may be selected. |