Buyer Production Guide
Tenson is a 100% drop-in replacement for the OpenAI Chat Completions API. Point any existing OpenAI SDK, coding assistant (Cursor, Windsurf, Cline, Continue), or agent framework to https: and start calling open-weights models at a fraction of centralized cloud prices.
1. Account Setup & Funding
- Create a unified account at
/(secured with Argon2id password hashing and 7-day HttpOnly JWT sessions).signup/ - Purchase prepaid compute points in the Buyer Console under Billing & Ledger:
- Pricing unit:
1,000 points = $1. 00 USD - Available Stripe Checkout packs:
$10(10,),000 pts $50(50,),000 pts $250(250,),000 pts $1,(000 1,).000, 000 pts - Points are credited atomically in PostgreSQL 16 via HMAC-verified
checkout.Stripe webhooks (idempotent per session ID).session. completed
- Pricing unit:
- Generate a SHA-256 API Key under API Keys:
- Keys use the prefix
sk_.tenson_ live_ . . . - The full secret is revealed once on creation. Tenson stores only the
SHA-digest in256 api_.keys
- Keys use the prefix
2. SDK Integration
Python (openai>=1.0 )
from openai import OpenAI
client = OpenAI(
base_url="https://api.tenson.app/v1",
api_key="sk_tenson_live_...",
)
stream = client.chat.completions.create(
model="qwen3-30b",
messages=[
{"role": "system", "content": "You are a concise systems architect."},
{"role": "user", "content": "Compare vLLM and Ollama for multi-tenant serving."},
],
max_tokens=512,
temperature=0.2,
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta.content
if delta:
print(delta, end="", flush=True)
TypeScript / Node.js (openai>=4.0 )
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.tenson.app/v1',
apiKey: process.env.TENSON_API_KEY,
});
const resp = await client.chat.completions.create({
model: 'llama-3.3-70b',
messages: [{role: 'user', content: 'Draft a PostgreSQL 16 double-entry migration.'}],
max_tokens: 1024,
});
console.log(resp.choices[0].message.content);
console.log('Usage:', resp.usage);
cURL
curl https://api.tenson.app/v1/chat/completions \
-H "Authorization: Bearer sk_tenson_live_..." \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-8b",
"stream": true,
"max_tokens": 256,
"messages": [{"role": "user", "content": "Hello Tenson Grid"}]
}'
3. Canonical Model Catalog & Pricing
Query live availability and exact pricing programmatically via GET /.
| Model ID | Hugging Face Repository | Min VRAM | Input / 1M Tokens | Output / 1M Tokens |
|---|---|---|---|---|
qwen3- | Qwen/ | 12 GB | 45 pts ($0.) | 90 pts ($0.) |
qwen3- | Qwen/ | 24 GB | 120 pts ($0.) | 280 pts ($0.) |
gpt- | openai/ | 24 GB | 95 pts ($0.) | 210 pts ($0.) |
deepseek- | deepseek- | 24 GB | 150 pts ($0.) | 320 pts ($0.) |
qwen2. | Qwen/ | 24 GB | 130 pts ($0.) | 260 pts ($0.) |
mistral- | mistralai/ | 24 GB | 80 pts ($0.) | 180 pts ($0.) |
gemma- | google/ | 24 GB | 100 pts ($0.) | 220 pts ($0.) |
llama- | meta- | 48 GB | 240 pts ($0.) | 480 pts ($0.) |
4. Reliability, Escrow & Failover Guarantees
Every request is protected by four built-in production safeguards:
- Pre-Flight Escrow Hold: Before routing, Tenson reserves
ceil((prompt_points inside a serialized PostgreSQL transaction (tokens * in_ rate + max_ tokens * out_ rate) / 1, 000, 000) SELECT .). Unused escrow is released immediately upon stream completion.. . FOR UPDATE - Silent 3,000ms TTFT Failover: If the selected GPU worker does not emit its first token within 3,000 ms, the Edge Gateway cancels the job, docks the worker
-2.reputation, and transparently retries up to 2 additional nodes before your client ever sees an error.0 - 100% Mid-Stream Drop Refund: If a P2P worker disconnects after streaming has begun, your entire escrow hold is refunded automatically (100%) and the worker receives a
-5.reputation penalty.0 - Invisible Centralized Overflow: When regional P2P concurrency slots are saturated, Tenson seamlessly overflows to dedicated upstream open-weights clusters (
is_) at the exact same API price.fallback = true
5. Standard Error Codes
| HTTP Status | error. | Cause & Recommended Handling |
|---|---|---|
401 | invalid_ | Missing, malformed, or revoked sk_ Bearer token. |
402 | payment_ | Available point balance is lower than the requested max_ escrow hold. Top up in /. |
429 | rate_ | Per-key 60-second RPM ceiling reached. Back off with exponential jitter. |
502 | mid_ | Worker dropped mid-stream (non-streaming request). Escrow is already 100% refunded; safe to retry. |
503 | no_ | No online P2P node and no overflow provider available for the requested model. |
6. Zero-Log Privacy Guarantee
Tenson never writes raw prompts or model completions to PostgreSQL, disk, or application logs. Your Request Logs table records strictly metadata: job_, model_, prompt_, completion_, ttft_, total_, final_, and status. For the 3% of jobs sampled for Optimistic GPU Audits, the payload exists strictly in RAM-only Redis (--appendonly no) with a hard 300s TTL and is atomically deleted (GETDEL) upon verification.