# Troubleshooting

Common issues and solutions when using Tensorix 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.tensorix.ai`
   * For Cursor/Cline: `https://api.tensorix.ai/v1`
2. **Replace the placeholder** `YOUR_API_KEY` with your actual Tensorix 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.tensorix.ai/dashboard](https://app.tensorix.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.1"
export ANTHROPIC_SMALL_FAST_MODEL="z-ai/glm-5.1"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="z-ai/glm-5.1"
export ANTHROPIC_DEFAULT_SONNET_MODEL="z-ai/glm-5.1"
export ANTHROPIC_DEFAULT_OPUS_MODEL="z-ai/glm-5.1"
```

{% 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.1`         | `glm-5.1`    |
| `minimax/minimax-m2`   | `minimax-m2` |
| `minimax/minimax-m2.5` | `m2.5`       |

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

***

## Authentication Failed

### Cause

Invalid or expired API key.

### Solution

1. Log in to [app.tensorix.ai](https://app.tensorix.ai)
2. Navigate to your [dashboard](https://app.tensorix.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 Tensorix 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.

### Solution

* Wait a few seconds between requests
* Check your usage at [app.tensorix.ai/dashboard](https://app.tensorix.ai/dashboard)
* Contact support if you need higher rate limits

***

## Need More Help?

* 📧 **Email**: <support@tensorix.ai>
* 📚 **Documentation**: [docs.tensorix.ai](https://docs.tensorix.ai)
* 💬 **Contact Support**: [Contact page](https://github.com/Tensorix-ai/tensorix-docs/blob/main/support/support/README.md)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tensorix.ai/support/troubleshooting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
