> 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/support/troubleshooting.md).

# Troubleshooting

Common issues and solutions when using TensorX with AI coding tools.

***

## API Error: Cannot read properties of undefined

### Cause

Usually happens when environment variables are conflicting or the base URL is incorrect.

### Solution

1. **Verify your API base URL**:
   * For Claude Code: `https://api.tensorx.ai`
   * For Cursor/Cline: `https://api.tensorx.ai/v1`
2. **Replace the placeholder** `YOUR_API_KEY` with your actual TensorX API key
3. **Clear conflicting environment variables**:

```bash
# For Claude Code
unset ANTHROPIC_AUTH_TOKEN ANTHROPIC_BASE_URL

# For Cursor/Cline
unset OPENAI_API_KEY OPENAI_BASE_URL
```

4. **Check your API credits** at [app.tensorx.ai/dashboard](https://app.tensorx.ai/dashboard)

***

## Claude Code: Model Errors or Background Task Failures

### Cause

Claude Code requires **all 5 model environment variables** to be set, even if you only use one model. Missing variables cause background task failures.

### Solution

Set all required model variables:

```bash
export ANTHROPIC_MODEL="z-ai/glm-5.3"
export ANTHROPIC_SMALL_FAST_MODEL="z-ai/glm-5.3"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="z-ai/glm-5.3"
export ANTHROPIC_DEFAULT_SONNET_MODEL="z-ai/glm-5.3"
export ANTHROPIC_DEFAULT_OPUS_MODEL="z-ai/glm-5.3"
```

{% hint style="warning" %}
**All 5 variables are required.** Claude Code uses different model variables for different internal tasks. If any are missing, you'll see errors.
{% endhint %}

***

## Connection Timeout

### Cause

The default timeout may be too short for complex operations.

### Solution

Increase the timeout value in your configuration:

```bash
export API_TIMEOUT_MS="3000000"
```

***

## Model Not Found

### Cause

Using incorrect model ID format.

### Solution

Always use the full model ID with provider prefix:

| Correct              | Incorrect    |
| -------------------- | ------------ |
| `z-ai/glm-5.3`       | `glm-5.3`    |
| `minimax/minimax-m3` | `MiniMax M3` |
| `minimax/minimax-m3` | `m3`         |

Browse all available models at [tensorx.ai/models](https://tensorx.ai/models).

***

## Authentication Failed

### Cause

Invalid or expired API key.

### Solution

1. Log in to [app.tensorx.ai](https://app.tensorx.ai)
2. Navigate to your [dashboard](https://app.tensorx.ai/dashboard)
3. Generate a new API key
4. Update your configuration with the new key

***

## OAuth Conflict (Claude Code)

### Cause

Claude Code's built-in OAuth login conflicts with TensorX configuration.

### Solution

If you accidentally trigger OAuth:

1. Press `Ctrl+C` to cancel the OAuth prompt
2. Verify your environment variables are set correctly
3. Restart Claude Code

{% hint style="info" %}
**Print mode (`-p`)** works without any Anthropic account or OAuth - it's the fastest way to test your setup.
{% endhint %}

***

## Rate Limiting

### Cause

Too many requests in a short period, or too many tokens reserved in a single request.

### Diagnosing RPM vs TPM Limits

Check the `Limit type` field in the 429 error message to determine which limit you hit:

| Error message          | You hit | Meaning                             |
| ---------------------- | ------- | ----------------------------------- |
| `Limit type: requests` | RPM     | Too many API calls per minute       |
| `Limit type: tokens`   | TPM     | Too many tokens reserved per minute |

### Solution

* **If you hit RPM:** Wait a few seconds between requests, or batch similar calls together
* **If you hit TPM:** Your `max_tokens` value may be too high — each request reserves its full `max_tokens` against your TPM allowance while in flight

{% hint style="warning" %}
Some clients set `max_tokens` to the full context-window size. This can reserve most of the key's TPM allowance even when the response is short. Remove that client default where possible. If the application requires an explicit response budget, query `GET /v1/model/info` and choose a value at or below the model's `model_info.max_output_tokens`.
{% endhint %}

* Check your usage at [app.tensorx.ai/dashboard](https://app.tensorx.ai/dashboard)
* See [Rate Limits](https://docs.tensorx.ai/api-reference/rate-limits) for tier details and how to request higher limits
* Contact <support@tensorx.ai> if you need higher limits

***

## Need More Help?

* **Email**: <support@tensorx.ai>
* **Documentation**: [docs.tensorx.ai](https://docs.tensorx.ai)
* **Contact Support**: [Contact page](/support/support.md)


---

# 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/support/troubleshooting.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.
