TokenFlyTokenFly
API GuideGetting StartedClient Setup

VS Code (GitHub Copilot Chat) Setup

Connect VS Code GitHub Copilot Chat to Tokenfly

Installation

Download and install VS Code from the VS Code website, then search for and install the GitHub Copilot Chat extension from the marketplace.

Configure a Custom Model Endpoint

  1. Open the Chat panel, click the model picker button next to the input box, and select Manage Models from the menu.

  2. Click Add Model, then choose Custom Endpoint.

  3. Enter a group name (the group name shown in the model picker, e.g. Tokenfly).

  4. Enter a display name and API Key: sk-xxx.

  5. Select Chat Completions as the API type.

  6. VS Code will automatically open chatLanguageModels.json — fill in the model details:

    [
      {
        "name": "Tokenfly",
        "vendor": "customendpoint",
        "apiKey": "sk-xxx",
        "apiType": "chat-completions",
        "models": [
          {
            "id": "gpt-5.4",
            "name": "GPT-5.4",
            "url": "https://tokenfly.com/v1/chat/completions",
            "toolCalling": true,
            "maxInputTokens": 900000,
            "maxOutputTokens": 100000
          }
        ]
      }
    ]
  7. Save the file, then select GPT-5.4 in the Chat panel's model picker to use it.

Configuration Reference

FieldPurpose
vendorFixed value customendpoint
apiKeyAccess token
apiTypeAPI protocol type; the gateway is OpenAI-compatible, use chat-completions
models[].idModel name sent to the gateway on request
models[].urlFull request URL
models[].toolCallingWhether tool calling is supported; must be true for Agent mode
models[].maxInputTokens / maxOutputTokensContext window size; adjust to match actual values if different

Verification

Select GPT-5.4 in the model picker and start a conversation — a normal reply confirms the setup works. If the newly added model doesn't appear immediately in the picker, restart VS Code.

How is this guide?