Skip to content
gp.nvim logo

gp.nvim via Tokonomix

Add a Tokonomix provider to gp.nvim — give Neovim chat and code ops 130+ models and consensus on one key.

providers + agentNeovim pluginMIT · open sourceNeovim
gp.nvim — Neovim AI plugin for chat and code ops, via Tokonomix

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 providers table (endpoint, secret).
  • Each agent references 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-consensus for 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.nvim setup and export TOKONOMIX_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.

Model selection

Which model and endpoint should my agent use?

Pick by what your agent does, then swap the model id any time — every model in the catalog works through the same key.

What your agent doesUse this
Edits files / calls tools and streams responses (most coding agents)An Anthropic model via the Anthropic endpoint (tools + streaming both work)
Calls tools but does not need streaming (any model)The OpenAI-compatible endpoint with a single model id
Wants tools and streaming on a non-Anthropic modelRun non-streaming for now — streaming tool-calls on other providers is not enabled yet
Plain chat, no toolsEither endpoint; streaming is fine
Wants a cross-model verdict (consensus) on a high-stakes answerSet model to tokonomix-consensus on the OpenAI-compatible endpoint — note: consensus rejects tool requests (no tool-calling)
Endpoint & API reference (technical)

anthropic-messages → https://tokonomix.ai/api/anthropic — tools ✓, streaming ✓ (use an Anthropic model). openai-completions → https://tokonomix.ai/api/v1 — tools ✓ (single-model passthrough), streaming with tools not yet enabled. Plain chat: streaming works on both. Consensus: openai-completions, model tokonomix-consensus, no tools. Swap the model id to any slug returned by GET /api/v1/models.

Browse all models →

Related agents