CopilotC-Nvim / CopilotC-Nvim/CopilotChat.nvim

docs: hosted OpenAI-compat get_url must be full /v1/chat/completions

Open Beginner friendly
#1,582 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
3.7k
Forks
171
Avg merge
16h 26m
Merged PRs (30d)
1

Description

The custom providers example uses get_url returning a full chat URL. Two details are easy to get wrong on a hosted OpenAI-compatible Chat Completions host:

  1. get_url must return the full …/v1/chat/completions URL. CopilotChat does not append that path.
  2. Reuse copilot.prepare_input / prepare_output. Do not point embeddings at this host.

PZERO is a live OpenAI-compatible host. Catalog: GET https://api.pzero.studio/v1/models. Default text id: deepseek-v4-flash. Prepaid Bearer key (pzero_…).

{
  providers = {
    pzero = {
      get_url = function()
        return 'https://api.pzero.studio/v1/chat/completions'
      end,
      get_headers = function()
        return { ['Authorization'] = 'Bearer ' .. vim.env.PZERO_API_KEY }
      end,
      get_models = function()
        return { { id = 'deepseek-v4-flash', name = 'deepseek-v4-flash' } }
      end,
      prepare_input = require('CopilotChat.config.providers').copilot.prepare_input,
      prepare_output = require('CopilotChat.config.providers').copilot.prepare_output,
    },
  },
}
export PZERO_API_KEY="pzero_…"

Do not return https://api.pzero.studio/v1 from get_url (missing chat path). Do not return https://api.openai.com/... (that is OpenAI, not this host).

No first-party plugin asked. If a named vendor subsection is too much, the gotchas above are the docs gap; the block is a worked example for searchers.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the custom providers documentation linked in the issue and inspect the existing provider example. Update it to show a full /v1/chat/completions URL, the copilot prepare_input and prepare_output helpers, and the relevant PZERO setup and gotchas. Done means the example is discoverable and no longer suggests the incomplete or incorrect URLs.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, neovim
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.