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

# Quickstart

Create an account, generate a key and send an API request.

***

## Step 1: Create Your Account

1. Go to [app.tensorx.ai/register](https://app.tensorx.ai/register)
2. Enter your email and password
3. Check your inbox for a verification email
4. Click the verification link

***

## Step 2: Generate an API Key

1. Go to your [Dashboard](https://app.tensorx.ai/dashboard)
2. Navigate to **API Keys**
3. Click **Generate New Key**
4. Enter a name (e.g., "My First Key")
5. Click **Create**

{% hint style="warning" %}
Copy the key immediately. The full API key is only shown once; store it securely.
{% endhint %}

***

## Step 3: Make Your First API Call

Test that everything works with a simple curl command:

```bash
curl https://api.tensorx.ai/v1/models \
  -H "Authorization: Bearer YOUR_API_KEY"
```

You should see a JSON list of available models.

***

## Step 4: Chat with a Model

Send a chat-completions request:

{% tabs %}
{% tab title="curl" %}

```bash
curl https://api.tensorx.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "z-ai/glm-5.2",
    "messages": [
      {"role": "user", "content": "Hello! What can you help me with?"}
    ]
  }'
```

{% endtab %}

{% tab title="Python" %}

```python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.tensorx.ai/v1"
)

response = client.chat.completions.create(
    model="z-ai/glm-5.2",
    messages=[
        {"role": "user", "content": "Hello! What can you help me with?"}
    ]
)

print(response.choices[0].message.content)
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://api.tensorx.ai/v1'
});

const response = await client.chat.completions.create({
  model: 'z-ai/glm-5.2',
  messages: [
    { role: 'user', content: 'Hello! What can you help me with?' }
  ]
});

console.log(response.choices[0].message.content);
```

{% endtab %}
{% endtabs %}

***

## Step 5: Check Your Usage

1. Go to [Dashboard → Usage](https://app.tensorx.ai/dashboard/usage)
2. See your request history with timestamps, models, tokens, and costs
3. Export to CSV if needed

***

## Next steps

| Next Step                    | Link                                                   |
| ---------------------------- | ------------------------------------------------------ |
| Browse available models      | [Models](/api-reference/models.md)                     |
| Learn about chat completions | [Chat API](/api-reference/chat-completions.md)         |
| Add function calling         | [Function Calling](/api-reference/function-calling.md) |
| Set up streaming             | [Streaming](/api-reference/streaming.md)               |
| Connect your favorite tool   | [Integrations](/readme.md#integrations)                |

***

## OpenAI-compatible clients

For an OpenAI-compatible client, set the TensorX API key and base URL:

```python
# Before (OpenAI)
client = OpenAI(api_key="sk-...")

# After (TensorX)
client = OpenAI(
    api_key="YOUR_TENSORX_KEY",
    base_url="https://api.tensorx.ai/v1"
)
```

Use a model ID returned by `GET /v1/models`. Parameters that are not supported by the selected model can require application changes.

***

## Common Issues

| Problem                | Solution                                                                         |
| ---------------------- | -------------------------------------------------------------------------------- |
| "Insufficient balance" | Add credits to your account in the [Dashboard](https://app.tensorx.ai/dashboard) |
| "401 Unauthorized"     | Check your API key is correct and complete                                       |
| "404 Not Found"        | Base URL must include `/v1`: `https://api.tensorx.ai/v1`                         |
| Key not working        | Make sure you copied the full key including `sk-` prefix                         |

***

## Need Help?

* **Email**: <support@tensorx.ai>
* **Docs**: [docs.tensorx.ai](https://docs.tensorx.ai)


---

# 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/quickstart.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.
