Quick Start
This guide takes you from a new account to a successful API response.
1. Create an API key
Sign in to the TokenPass Console, open API key management, and create a key. Store it in an environment variable instead of placing it directly in source code.
bash
export TOKENPASS_API_KEY="your-tokenpass-api-key"PowerShell:
powershell
$env:TOKENPASS_API_KEY = "your-tokenpass-api-key"2. Send your first request
curl
bash
curl https://tokenpass.cloud/v1/chat/completions \
-H "Authorization: Bearer $TOKENPASS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5-mini",
"messages": [{"role": "user", "content": "Hello!"}]
}'Python
python
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["TOKENPASS_API_KEY"],
base_url="https://tokenpass.cloud/v1",
)
response = client.chat.completions.create(
model="gpt-5-mini",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)JavaScript
javascript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.TOKENPASS_API_KEY,
baseURL: "https://tokenpass.cloud/v1",
});
const response = await client.chat.completions.create({
model: "gpt-5-mini",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);3. Discover model IDs
bash
curl https://tokenpass.cloud/v1/models \
-H "Authorization: Bearer $TOKENPASS_API_KEY"Use the returned id value in API requests. The documentation describes model capabilities, while this endpoint is the canonical source for callable IDs.
Next steps
- Read the API Reference for Responses, Messages, streaming, tools, and errors.
- Browse Models and Pricing.
- Configure Claude Code or OpenClaw.