> For the complete documentation index, see [llms.txt](https://docs.tensorx.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tensorx.ai/ai-coding-assistants/claude-code-vscode.md).

# Claude Code VS Code

The Claude Code VS Code extension can also be configured to use TensorX models.

{% hint style="info" %}
This guide covers the VS Code extension. For the terminal CLI, see [Claude Code CLI](/ai-coding-assistants/claude-code-cli.md).
{% endhint %}

## Installation

1. Open VS Code Extensions (`Ctrl+Shift+X` / `Cmd+Shift+X`)
2. Search for **"Claude Code"**
3. Click **Install**

## Configuration

Open VS Code settings (`Cmd/Ctrl + ,`) and search for "Claude Code". Click **"Edit in settings.json"** and add:

```json
{
  "claudeCode.environmentVariables": [
    {
      "name": "ANTHROPIC_BASE_URL",
      "value": "https://api.tensorx.ai"
    },
    {
      "name": "ANTHROPIC_AUTH_TOKEN",
      "value": "<YOUR_TENSORX_API_KEY>"
    },
    {
      "name": "ANTHROPIC_MODEL",
      "value": "z-ai/glm-5.3"
    },
    {
      "name": "ANTHROPIC_SMALL_FAST_MODEL",
      "value": "z-ai/glm-5.3"
    },
    {
      "name": "ANTHROPIC_DEFAULT_HAIKU_MODEL",
      "value": "z-ai/glm-5.3"
    },
    {
      "name": "ANTHROPIC_DEFAULT_SONNET_MODEL",
      "value": "z-ai/glm-5.3"
    },
    {
      "name": "ANTHROPIC_DEFAULT_OPUS_MODEL",
      "value": "z-ai/glm-5.3"
    },
    {
      "name": "API_TIMEOUT_MS",
      "value": "3000000"
    },
    {
      "name": "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC",
      "value": "1"
    }
  ]
}
```

{% hint style="danger" %}
**Important:** You must set ALL model variables (`ANTHROPIC_MODEL`, `ANTHROPIC_SMALL_FAST_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_OPUS_MODEL`). Missing any will cause Claude Code to try calling Anthropic models directly, resulting in errors.
{% endhint %}

## Model selection

Call `GET /v1/models` with your TensorX API key and use one of the returned IDs. If the integration depends on a capability or token limit, query `GET /v1/model/info` before selecting the model. See [Models](/api-reference/models.md) for examples.

***

## Switching Models

To switch models, update **all** model values in your VS Code `settings.json`:

1. Replace `z-ai/glm-5.3` with your chosen model ID in all five places
2. Restart VS Code or reload the window

## One-Time OAuth

Like the CLI, the VS Code extension requires a one-time Anthropic OAuth for interactive features. A free Anthropic account works - you won't be charged by Anthropic as all requests route through TensorX.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tensorx.ai/ai-coding-assistants/claude-code-vscode.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
