GitHub Copilot (VS Code) logo
Editors

Use TokenRex with GitHub Copilot (VS Code)

Add TokenRex chat models to VS Code Copilot through its native Custom Endpoint provider.

Setup checked against the linked official documentation. No live TokenRex session inside this tool has been verified. Use a compatible chat model and its real limits; configuration support does not establish support for every model or feature.

Before you start

  • A current VS Code installation with Copilot chat
  • A private TokenRex API key
  • An enabled compatible chat model; organization policies may restrict BYOK

Setup methods

01

Add TokenRex to Copilot Chat

The code is a model-entry fragment for the file VS Code generates, not a replacement for the full configuration. This configures Copilot Chat model access, not all inline completions or a different agent harness.

  1. 1

    Install or update VS Code and its Copilot chat support. Open the Chat view. Follow any workspace-trust or sign-in requirements shown by your version.

  2. 2

    Create a private TokenRex API key and copy an enabled chat model ID from Models & Pricing. The example model is replaceable; image, video, speech and embedding endpoints are not coding-agent chat models.

  3. 3

    Open the model picker and choose Manage Language Models, or run Chat: Manage Language Models from the Command Palette.

  4. 4

    Select Add Models → Custom Endpoint. Enter group name TokenRex, a display name and your private key when prompted.

  5. 5

    Choose Chat Completions for this guide. VS Code opens chatLanguageModels.json; preserve the generated provider structure and other configured models.

  6. 6

    Set the model's id to your exact TokenRex chat ID and its url to https://tokenrex.ai/api/public/v1. Use apiType chat-completions. Keep the generated secure key input reference rather than committing a raw key.

  7. 7

    Save and select the configured model from the chat picker. Restart VS Code if it does not appear. Set token limits only from that model's verified specifications.

  8. 8

    Start a new conversation with the selected model, send a short read-only question and check its response and TokenRex usage. Test streaming and tool calls separately before approving file edits or terminal actions. These checks can incur normal model charges.

Configuration
{
  "id": "gpt-6-astra",
  "name": "TokenRex",
  "url": "https://tokenrex.ai/api/public/v1",
  "apiType": "chat-completions"
}

Setup reference

Troubleshooting

Custom Endpoint is unavailable
Update VS Code, check the current official UI instructions and your organization's BYOK policy. CLI provider settings do not configure VS Code.
Chat model changes but inline suggestions do not
This guide configures chat model access. Inline suggestions and other harnesses have separate settings and capabilities.
Authentication fails
Check that the saved TokenRex key is active and belongs in the tool's API-key field, not its subscription sign-in. Remove accidental spaces, check your wallet balance, and never share the key in screenshots or exported settings.
The model is missing or the request URL returns 404
Copy an exact enabled model ID from Models & Pricing. Follow this method's URL field: some tools expect the versioned base, others the root or full completion address. Check the documented API protocol before changing the path.
Chat works but streaming or tools fail
Test a short plain-text conversation first. Confirm the selected model and installed tool version support the required protocol and capabilities. Enable agent actions only after separately checking streaming and tool calls.

Further references

Verify the connection

Send a short message with the selected model, read its response, then confirm the exact model appears in your TokenRex usage. Test streaming and tool use separately before larger agent tasks.