# Getting Started
Source: https://docs.tensormachine.ai/getting-started

## 1. Create an account

Sign up at [tensormachine.ai](https://tensormachine.ai) — the free tier includes **100K tokens/month** with no credit card required. Your account comes with India data residency enabled by default.

## 2. Generate an API key

Navigate to **Dashboard → Settings → API Keys** and click **Create new key**.

- Give it a descriptive name (e.g., `my-app-prod`)
- Copy it immediately — it will not be shown again
- Store it in an environment variable, not in source code

```bash
export TENSORMACHINE_API_KEY="tx_live_..."
```

## 3. Make your first request

```bash
curl https://edge.tensormachine.ai/v1/chat/completions \
  -H "Authorization: Bearer $TENSORMACHINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-ai/glm-5.2",
    "messages": [
      { "role": "user", "content": "Hello from India!" }
    ]
  }'
```

You should receive a response like:

```json
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "z-ai/glm-5.2",
  "choices": [{
    "message": {
      "role": "assistant",
      "content": "Hello! How can I help you today?"
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 9,
    "total_tokens": 21
  }
}
```

## 4. Use the OpenAI SDK

Tensor Machine is fully OpenAI-compatible. If you already use the OpenAI SDK, switch by changing one line:

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

# After (Tensor Machine)
client = OpenAI(
    api_key="tx_live_...",
    base_url="https://edge.tensormachine.ai/v1"
)
```

Everything else — model calls, streaming, function calling — stays the same.

## Next steps

- [Authentication](/authentication) — key types, rotation, and security best practices
- [Quickstart](/quickstart) — full code examples in Python, Node.js, and cURL
- [Models](/models) — choose the right model for your use case
