What is gp.nvim?
gp.nvim is a Neovim AI plugin for chat and code operations — interactive chat buffers, inline rewrites and command-driven edits. It lets you define custom providers and agents in its setup, which is how Tokonomix plugs in: one provider entry, 130+ models.
- Adds chat buffers and code-operation commands inside Neovim.
- Custom backends go in the
providerstable (endpoint,secret). - Each
agentreferences a provider and a model. - Open source; read the key from an environment variable via
os.getenv.
Why route gp.nvim through Tokonomix?
- A single provider entry reaches 130+ models without per-provider setup inside Neovim.
- Name an agent’s model
tokonomix-consensusfor risky in-editor prompts; define a second agent on a direct slug for routine chat. - Per-call spend caps bound usage, and region / origin routing keeps repo data compliant.
- Cost is metered to the cent in your Tokonomix dashboard.
Connect Tokonomix to gp.nvim
In your gp.nvim setup, add a Tokonomix entry to providers and reference it from an agent.
require("gp").setup({
providers = {
tokonomix = {
endpoint = "https://tokonomix.ai/api/v1/chat/completions",
secret = os.getenv("TOKONOMIX_API_KEY"), -- tok-your-key
},
},
agents = {
{ provider = "tokonomix", name = "Tokonomix", chat = true, command = true,
model = { model = "tokonomix-consensus" } },
},
})Verify it works
- Add the provider and agent to your
gp.nvimsetup and exportTOKONOMIX_API_KEY. - Open a chat buffer or run a code command against the Tokonomix agent.
- Confirm the call and token usage in your Tokonomix dashboard.