Windows Setup Guide
Set up and use Token101 API on Windows — step-by-step from account creation to your first API call.
Overview
This guide walks you through connecting to the Token101 API on Windows. Token101 supports two API formats:
- OpenAI format —
POST https://token.ppthub.shop/api/v1/chat/completions(recommended for most tools) - Anthropic format —
POST https://token.ppthub.shop/api/v1/messages
All models (GPT, Claude, Gemini, Qwen) work with both formats. You can use any OpenAI-compatible tool or SDK to call any model.
Step 1 — Create an Account and Get Your API Key
- Open your browser and go to https://token.ppthub.shop
- Register or log in to your account
- Go to Settings → API Keys
- Click Create API Key
- Copy the generated
sk-...key immediately
Your API key is only shown once at creation time. Store it in a safe place right away — you cannot retrieve it again.
Step 2 — Install Node.js (Required for Claude Code)
Skip this step if you only need Python or curl access.
Claude Code requires a Node.js environment to run.
Option A: Official Installer (Recommended)
- Open your browser and go to https://nodejs.org
- Click the LTS version to download the
.msiinstaller - Run the installer and keep all default settings
Option B: Package Manager
If you have Chocolatey or Scoop installed:
# Chocolatey
choco install nodejs
# Scoop
scoop install nodejsVerify Installation
Open PowerShell or CMD and run:
node --version
npm --versionIf both commands print version numbers, Node.js is installed correctly.
Windows tips:
- Use PowerShell instead of CMD for better compatibility
- If you see permission errors, try running PowerShell as Administrator
- Some antivirus software may flag new executables — add Node.js to your allowlist if needed
Step 3 — Set Your API Key as an Environment Variable
Temporary (current session only)
Open PowerShell and run:
$env:TOKEN101_API_KEY = "sk-your-api-key-here"This setting is lost when you close the window.
Permanent (user-level, survives restarts)
[System.Environment]::SetEnvironmentVariable("TOKEN101_API_KEY", "sk-your-api-key-here", [System.EnvironmentVariableTarget]::User)Restart PowerShell after running this command for the change to take effect.
Verify the Variable
# PowerShell
echo $env:TOKEN101_API_KEY
# CMD
echo %TOKEN101_API_KEY%Expected output: your sk-... key. If the output is empty or shows the variable name literally, the variable was not set correctly — repeat the step above.
Step 4 — Send Your First Request
Option A: curl (PowerShell)
curl -X POST https://token.ppthub.shop/api/v1/chat/completions `
-H "Content-Type: application/json" `
-H "Authorization: Bearer $env:TOKEN101_API_KEY" `
-d '{
"model": "gpt-5.2",
"messages": [{"role": "user", "content": "Hello! What can you do?"}],
"max_tokens": 256
}'Option B: Python (OpenAI SDK)
Install the SDK first:
pip install openaiThen run:
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["TOKEN101_API_KEY"],
base_url="https://token.ppthub.shop/api/v1",
)
response = client.chat.completions.create(
model="gpt-5.2",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello! What can you do?"},
],
max_tokens=256,
)
print(response.choices[0].message.content)
print(f"Tokens used: {response.usage.total_tokens}")Option C: Node.js (OpenAI SDK)
Install the SDK first:
npm install openaiThen run:
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.TOKEN101_API_KEY,
baseURL: 'https://token.ppthub.shop/api/v1',
});
const response = await client.chat.completions.create({
model: 'gpt-5.2',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Hello! What can you do?' },
],
max_tokens: 256,
});
console.log(response.choices[0].message.content);Step 5 — Connect Claude Code (Optional)
Claude Code is an AI coding assistant that runs in your terminal. You can point it at Token101 to use any supported model.
Install Claude Code
npm install -g @anthropic-ai/claude-codeVerify:
claude --versionConfigure Environment Variables
Token101 uses the Anthropic protocol format for Claude Code and now supports both common auth styles:
ANTHROPIC_AUTH_TOKEN: Claude Code sendsAuthorization: Bearer ...ANTHROPIC_API_KEY: Claude Code sendsX-Api-Key: ...
Token101 accepts both headers, so either variable works. We recommend ANTHROPIC_AUTH_TOKEN because it matches what the one-command install script writes — keeping to a single variable avoids the ambiguous state where both are set. Set only one.
# Temporary (current session)
$env:ANTHROPIC_BASE_URL = "https://token.ppthub.shop/api"
$env:ANTHROPIC_AUTH_TOKEN = "sk-your-api-key-here"For permanent setup:
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://token.ppthub.shop/api", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "sk-your-api-key-here", [System.EnvironmentVariableTarget]::User)Restart PowerShell after setting permanent variables.
If you already use ANTHROPIC_API_KEY locally, that still works too — just don't set both at once:
$env:ANTHROPIC_API_KEY = "sk-your-api-key-here"When ANTHROPIC_BASE_URL points to a non-Anthropic host, Claude Code changes some MCP tool search behavior by design. If you want a full gateway-grade Claude Code experience later, you should also validate tool_reference forwarding.
Start Claude Code
# Start in any directory
claude
# Start in a specific project
cd C:\path\to\your\project
claudeOnce started, you can ask Claude Code things like:
- "Help me understand the structure of this project"
- "Find and fix the bug in this function"
- "Write a React component for a login form"
Troubleshooting
PowerShell execution policy error
If you see "cannot be loaded because running scripts is disabled":
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserclaude command not found
- Confirm Claude Code installed successfully:
npm list -g @anthropic-ai/claude-code - Close and reopen PowerShell
- Check that npm's global bin is in your PATH:
npm config get prefix
npm install is slow
Use a mirror registry:
npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.comAPI returns 401
- Check that
ANTHROPIC_API_KEYorANTHROPIC_AUTH_TOKENis set correctly - Confirm the key starts with
sk-and is at least 32 characters - Verify the key still exists in your dashboard under Settings → API Keys
Next Steps
- Supported Models — full model list with pricing
- Billing & Credits — how credits work and how to top up
- Rate Limits — request quotas by plan
- Error Handling — common errors and how to fix them