TensoRoute Developer Guide
A clear and straightforward guide on how to integrate TensoRoute API into your IDE, configure streaming, choose models, and handle common errors.
1. What is TensoRoute?
TensoRoute provides direct, low-latency API access to top Claude models at rates 3–4x below official pricing. You only pay for the tokens you actually use, with no recurring subscriptions or expiring credits.
Key Highlights:
- Ultra-Fast Response (<120ms): Immediate time-to-first-token.
- Real-time SSE Streaming: Continuous token output directly inside your editor.
- Dual Protocol Compatibility: Works seamlessly with both OpenAI (
/v1/chat/completions) and Anthropic (/v1/messages) endpoints. - Prepaid Token Wallet: Check your live token balance anytime at /check.
2. Available Models
You can specify any of the following model IDs in your requests:
| Model | Model ID | Best Used For |
|---|---|---|
| Claude Opus 5.5 | claude-opus-5.5 | Complex architectural logic, large-scale refactoring, multi-file codebases |
| Claude Opus 5 | claude-opus-5 | Deep analytical reasoning, mathematical logic, code audits |
| Claude Sonnet 5.5 | claude-sonnet-5.5 | Fast coding beast, daily software engineering, agentic tools |
| Claude Sonnet 5 | claude-sonnet-5 | High precision, rapid instruction following, general assistant tasks |
3. Quickstart: 3-Step Setup
- Get your API key: Your key starts with
sk-(e.g.sk-60367cda5c76bb...). - Set your Base URL:
- For OpenAI-compatible tools (Cursor, Cherry Studio, Python): use
https://tensoroute.space/v1 - For Anthropic-compatible tools (Cline native, Claude Code): use
https://tensoroute.space
- For OpenAI-compatible tools (Cursor, Cherry Studio, Python): use
- Enter your Model ID (such as
claude-sonnet-5.5) and start building!
4. IDE Integration Examples
Cline (VS Code Extension — Recommended)
- Click the Cline gear icon to open Settings.
- API Provider: Select
AnthropicorOpenAI Compatible. - Base URL:
https://tensoroute.space(if Anthropic) orhttps://tensoroute.space/v1(if OpenAI). - API Key: Paste your
sk-...key. - Model ID: Enter
claude-sonnet-5.5orclaude-opus-5.5.
Cursor
- Open Cursor Settings → Models.
- Turn on Override OpenAI Base URL.
- Set Base URL to
https://tensoroute.space/v1. - Set OpenAI API Key to your
sk-...key. - Add
claude-sonnet-5.5orclaude-opus-5.5to your active model list.
Cherry Studio
- Open Settings → Providers.
- Add a new provider: OpenAI Compatible.
- API Base URL:
https://tensoroute.space/v1. - API Key: your
sk-...key. - Add models:
claude-sonnet-5.5,claude-opus-5.5.
Python (OpenAI SDK Streaming Example)
from openai import OpenAI
client = OpenAI(
base_url="https://tensoroute.space/v1",
api_key="sk-YOUR_KEY_HERE"
)
stream = client.chat.completions.create(
model="claude-sonnet-5.5",
messages=[{"role": "user", "content": "Write a clean binary search in Go."}],
stream=True
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
cURL (Fast Terminal Test)
curl https://tensoroute.space/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-YOUR_KEY_HERE" \
-d '{
"model": "claude-sonnet-5.5",
"stream": true,
"messages": [{"role": "user", "content": "Hello!"}]
}'
5. Common Errors & Troubleshooting
Cause: The request is missing the Authorization: Bearer sk-... header, or the key was entered incorrectly.
Fix: Ensure the key begins with sk- and there are no extra leading/trailing whitespace characters.
Cause: Your token balance has reached zero, or the key has been temporarily suspended.
Fix: Visit https://tensoroute.space/check, paste your key, and check remaining tokens. Contact your provider for a balance top-up.
Cause: Incorrect Base URL path.
Fix: When using OpenAI-compatible libraries, ensure the URL ends with /v1 (e.g. https://tensoroute.space/v1). Do not include /chat/completions in the Base URL as the client library appends it automatically.
Cause: Short-lived upstream cluster load spike.
Fix: Wait 2–3 seconds and re-submit your prompt. Requests resume smoothly without any loss of tokens.
6. Key & Token Balance Checker
You can check your active token balance, total usage, and past request history at any time without logging in: