# Quickstart

> First call in three minutes — create an API key, verify with curl, then point your SDK's base_url at the gateway.

There are only three things to do: **get a key, change the base URL, pick a model**. There is no
TokRouter-specific SDK or config file.

## 1. Create an API key

Sign in to the console and open the **Tokens** page, then click **Create token**. The token is shown
in full only once — copy it somewhere safe immediately.

- Tokens look like `sk-xxxxxxxx`
- A token can carry a quota cap and an expiry; create one per project when you need isolation
- A lost token cannot be recovered — delete it and create a new one

<Callout type="info" title="Where to keep the key">
Never put it in frontend code or commit it. Inject it as an environment variable such as
`TOKROUTER_API_KEY`.
</Callout>

## 2. Verify with curl

```bash
export TOKROUTER_API_KEY="sk-your-token"

curl https://api.tokrouter.dev/v1/chat/completions \
  -H "Authorization: Bearer $TOKROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.4-mini",
    "messages": [{"role": "user", "content": "Reply with one word: ok"}]
  }'
```

The response body is the standard OpenAI Chat Completions shape (`choices[0].message.content`).

<Callout type="warn" title="Getting a 401? Check these three">
1. Is the header `Bearer sk-…`? A missing `Bearer ` prefix returns 401.
2. Is the token expired or disabled? The Tokens page shows its status.
3. Did you use your console password as the key? They are not the same thing.
</Callout>

## 3. Point your SDK at the gateway

OpenAI Python:

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["TOKROUTER_API_KEY"],
    base_url="https://api.tokrouter.dev/v1",
)

resp = client.chat.completions.create(
    model="claude-opus-5-5",          # the OpenAI SDK can call Claude too
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
```

OpenAI Node:

```ts

const client = new OpenAI({
  apiKey: process.env.TOKROUTER_API_KEY,
  baseURL: 'https://api.tokrouter.dev/v1',
})
```

For the Anthropic SDK, Gemini and DashScope see [Anthropic protocol](/en/quickstart/anthropic/) and
the [SDK list](/en/sdks/).

## 4. Pick a model

Model ids use the vendor's own names. See [Models](/en/models/) for the list and prices. You can also
list what is available to your token:

```bash
curl https://api.tokrouter.dev/v1/models \
  -H "Authorization: Bearer $TOKROUTER_API_KEY"
```

## Next steps

- [Authentication](/en/authentication/): key scope, rotation and security practice
- [Billing and quota](/en/billing/): per-component pricing, quota caps, whether failures are billed
- [Streaming](/en/guides/streaming/), [tool calling](/en/guides/tool-calling/),
  [structured output](/en/guides/structured-output/)
- [API reference](/en/api-reference/): endpoints, fields and errors
