# Grok API quick start

Welcome! This guide covers the basics of using Grok API, from creating an account to making your first request.

## 1. Create an account

Register with GrokAPI. We will credit $0.25 to your balance so you can test the API immediately.

## 2. Generate an API key

```bash
export XAI_API_KEY="sk-lg-YOUR_API_KEY"
```

Or add the key to your `.env` file:

```dotenv
XAI_API_KEY=sk-lg-YOUR_API_KEY
```

## 3. Install an SDK

```bash
pip install openai
```

```bash
npm install openai
```

## 4. Make your first request

```bash
curl https://api.llm-gate.tech/v1/responses \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-4.5",
    "input": "Explain why this function returns the wrong median"
  }'
```

## Existing OpenAI-compatible infrastructure

- API key: `$XAI_API_KEY`
- Base URL: `https://api.llm-gate.tech/v1`
- Model: `grok-4.5`
