Cloud, Vault & APIs · Engineering Contract · Full AI Markdown Manual (llms-full.txt) · OpenAPI 3.1 Spec
TRC Quotas, Rate Limits & Deterministic HTTP Error Reference
One canonical engineering reference for API gateway rate limits, Cloud Storage Vault upload ceilings, Sovereign Cloud enclave allocations, zero-card evaluator caps, and deterministic JSON error contracts across /api/v1.
- Scoped API Rate: 120 req / min — Per SHA-256 key · Retry-After header on HTTP 429
- Single Stream Upload: 2 GB Max / Call — Zero-buffer binary stream to Backblaze B2 Vault
- Spend Protection: HTTP 402 Guardrail — Pre-execution wallet reservation — zero post-paid overages
- Fallback Billing: Actual Model Rate — Billed at served model rate via x-trc-model-resolved
Platform Quotas, Throughput & Capacity Ceilings
Every TRC subsystem enforces explicit, predictable ceilings so automated agents and production workloads never hit undocumented silent throttling or surprise overage invoices.
| Subsystem | Default Limit / Allocation | Scaling & Overflow Behavior |
|---|---|---|
| Authenticated /api/v1 Keys | 120 requests / minute per scoped key | Returns HTTP 429 (RATE_LIMITED) with Retry-After seconds; isolate workloads by minting per-service keys |
| Zero-Card Evaluator Key (trc_eval_public_v1) | 5 req / hour · 15 req / 24h per IP · max_tokens <= 256 | Pinned to POST /api/v1/ai/deepseek/chat/completions (deepseek-flash, stream: false); mint a free account key for full access |
| Cloud Storage Vault Single Upload | Up to 2 GB per streaming POST /storage/upload | Streams directly to Backblaze B2 object storage; payloads > 2 GB or above plan quota return HTTP 413 |
| Cloud Storage Vault Total Capacity | 50 GB Free · 2 TB Basic · 5 TB Pro · 10 TB Ultimate | Expandable to 50 TB via storage add-on packs; $0.00 per-GB object download egress |
| Sovereign Cloud Enclave Services & Transfer | Hobby: 3 svc / 1 TB · Pro: 8 svc / 5 TB · Scale: 15 svc / 10 TB · Enterprise: 20 TB | Dedicated AMD EPYC (US-East) container memory & CPU boundaries with optional hard monthly spend caps |
| Context Windows (Model Gateway) | 128K – 1.05M tokens depending on model | 1M+ on DeepSeek V4.1, Gemini 3.8 Flash, Gemini 4 Hydrogen/Carbon/Argon, Qwen 3.8 Flash, and GPT-6 Astra |
Deterministic HTTP Error Codes & JSON Envelopes
All /api/v1 endpoints return structured JSON error envelopes (`{ "error": { "code": "...", "message": "..." } }`) alongside machine-readable `x-trc-*` response headers so SDKs and autonomous workflows can branch cleanly between retryable backoff and terminal configuration errors.
| HTTP Status | Error Code | Meaning | Recommended Client Action |
|---|---|---|---|
| 400 Bad Request | INVALID_REQUEST | Malformed JSON, unsupported model ID, or evaluator parameter out of bounds | Do not retry unchanged; validate request schema against /openapi.json or GET /api/v1/models |
| 401 Unauthorized | UNAUTHORIZED | Missing, malformed, or revoked Bearer trc_... / x-trc-api-key credential | Verify key in /developer/api or environment secret vault; never retry with the same invalid token |
| 402 Payment Required | INSUFFICIENT_FUNDS | Included monthly plan allowance and pre-funded TRC Wallet reached $0.00 | Halt billable retries cleanly (zero debt incurred); top up wallet in /developer/api or route via $0-markup BYOK |
| 403 Forbidden | INSUFFICIENT_SCOPE | Valid key lacks the granular scope required by this route (e.g. storage:read calling upload) | Mint or update a key in /developer/api with the required scope (e.g. models:use, storage:write) |
| 413 Payload Too Large | PAYLOAD_TOO_LARGE | Upload stream exceeds 2 GB per-request ceiling or remaining Cloud Vault quota | Check GET /api/v1/storage/usage or split multi-gigabyte archives into <= 2 GB shards |
| 429 Too Many Requests | RATE_LIMITED | Per-key (120/min) or public evaluator (5/hr) rate ceiling reached | Respect Retry-After header with exponential backoff + jitter |
| 502 / 503 Upstream Error | UPSTREAM_UNAVAILABLE | Transient upstream model provider timeout when no fallback route is permitted | Retry idempotently with exponential backoff or switch provider path (/ai/deepseek, /ai/google) |
TypeScript (Resilient Wallet & Retry Handler)
export async function callTrcGateway(prompt: string) {
const res = await fetch('https://api.trc.inc/api/v1/ai/deepseek/chat/completions', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.TRC_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'deepseek-flash',
messages: [{ role: 'user', content: prompt }],
}),
});
if (res.status === 402) {
const body = await res.json();
// Deterministic spend cap triggered — zero surprise overage billed
throw new Error(`Wallet cap reached (${body.error?.code}): top up or switch to BYOK`);
}
if (res.status === 429) {
const retryAfterSec = Number(res.headers.get('retry-after') || 2);
await new Promise((r) => setTimeout(r, retryAfterSec * 1000));
return callTrcGateway(prompt);
}
if (!res.ok) {
throw new Error(`TRC API error HTTP ${res.status}: ${await res.text()}`);
}
const resolvedModel = res.headers.get('x-trc-model-resolved');
const data = await res.json();
return { content: data.choices[0]?.message?.content, resolvedModel };
}
JSON Error Envelope Examples
{
"402_wallet_guardrail": {
"error": {
"code": "INSUFFICIENT_FUNDS",
"message": "Included plan allowance and TRC Wallet balance reached $0.00. No post-paid overage was charged."
}
},
"403_scope_mismatch": {
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "API key does not grant required scope 'storage:write'."
}
},
"429_rate_limited": {
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after window resets."
}
}
}Frequently Asked Questions
Can a runaway loop in my application ever generate a surprise post-paid bill on TRC?
No. Pre-execution wallet reservations lock estimated token or media cost before upstream dispatch and settle exact micro-dollar usage on completion. Once your pre-funded TRC Wallet reaches $0.00, requests immediately return HTTP 402.
What happens if a frontier model experiences upstream provider downtime?
When automatic fallback is enabled on supported workspace routes, TRC completes your request on a healthy fallback model, surfaces actualServedModel / x-trc-model-resolved, and bills strictly at the served model’s actual rate.