# API quickstart: first Claude, GPT or Gemini call

> Send your first request to Claude, GPT or Gemini through one OpenAI-compatible endpoint, in five steps.

Updated: 2026-10-03

If your code already talks to OpenAI or Anthropic, the change is two lines: the base URL and the key. These steps take you from a new account to the model's first reply, and the last example comes in four languages: cURL, Python, JavaScript and PowerShell.

### 1. Create your account

Sign up with your email, or continue with Google or GitHub. We ask for a phone number once so we can reach you about your account or balance.

### 2. Top up your balance

API requests are paid from your balance as you go, and every model costs less than its official price. Before you pay, the top-up screen shows the balance that will be added to your account. Details in [Pricing and balance](https://5abeer.ai/en/docs/start/pricing.md).

Claude Sonnet 5.5 (`claude-sonnet-5.5`) per 1M tokens: input $0.60 (official $2), output $3 (official $10). Official price checked October 19, 2026.

### 3. Create an API key

In your dashboard open **API → Keys** and create a key for the provider whose models you want. Copy it into an environment variable:

macOS / Linux:

```bash
export KHABEER_API_KEY="YOUR_5ABEER_API_KEY"
```

Windows:

```powershell
$env:KHABEER_API_KEY = "YOUR_5ABEER_API_KEY"
```

> Treat this key like a password. Never ship it in browser code, and don't share it.

### 4. Pick your base URL

Use the URL that matches the code you already have. Each format reads the key from its usual header.

| Format | Base URL | Key header |
| --- | --- | --- |
| OpenAI | `https://api.5abeer.ai/v1` | `Authorization: Bearer <KEY>` |
| Anthropic | `https://api.5abeer.ai` | `x-api-key: <KEY>` |
| Gemini | `https://api.5abeer.ai/v1beta` | `x-goog-api-key: <KEY>` |

### 5. Send your first request

Copy the example and run it in the terminal where you saved the key. Pick the format and the language; you can switch the model from the menu above the code.

```bash
curl --request POST "https://api.5abeer.ai/v1/chat/completions" \
  --header "Authorization: Bearer $KHABEER_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"model":"claude-sonnet-5.5","messages":[{"role":"user","content":"Write a product idea in one sentence."}]}'
```

```python
import os
import requests

response = requests.post(
    "https://api.5abeer.ai/v1/chat/completions",
    headers={
        "Authorization": f"Bearer {os.environ['KHABEER_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
    "model": "claude-sonnet-5.5",
    "messages": [
        {
            "role": "user",
            "content": "Write a product idea in one sentence."
        }
    ]
},
    stream=False,
    timeout=60,
)

response.raise_for_status()
print(response.json())
```

If you get a reply shaped like the one under the code, everything works.

## If the request fails

- [`INVALID_API_KEY`](https://5abeer.ai/en/docs/help/errors.md#INVALID_API_KEY): the key is wrong or was copied incompletely. Check that the environment variable is set in the same terminal.
- [`INSUFFICIENT_BALANCE`](https://5abeer.ai/en/docs/help/errors.md#INSUFFICIENT_BALANCE): your balance doesn't cover this request. Top up, then try again.
- [`MODEL_PLATFORM_NOT_ALLOWED`](https://5abeer.ai/en/docs/help/errors.md#MODEL_PLATFORM_NOT_ALLOWED): the key belongs to another provider. Create a key for this model's provider.

Every code and what it means is in [Errors and fixes](https://5abeer.ai/en/docs/help/errors.md).

## What's next

- [Base URLs](https://5abeer.ai/en/docs/start/base-urls.md): Use the OpenAI or Anthropic library without changing your code.
- [Claude Code](https://5abeer.ai/en/docs/apps/claude-code.md): Run the terminal coding agent on our models.
- [Models and prices](https://5abeer.ai/en/models): Our price next to the official one, for every model.
