1. Base URL & Virtual Key Authentication
Use any official OpenAI SDK, evaluation harness, or HTTP client by pointing base_url at /v1 with your tenant virtual key.
Endpoint Base URL:
https://dotprod.tech/v1
Header:
Authorization: Bearer sk-...
Virtual keys are hashed with SHA-256 and tenant-isolated. Upstream Cloudflare Workers AI and Modal/vLLM proxy credentials never leave the DotProd Worker boundary.
2. Streaming Chat Completions (Python, TypeScript, cURL)
POST /v1/chat/completions — pass stream_options.include_usage=true to receive exact uncached, cached, and output token counts on the final SSE frame.
Python (openai SDK)
cURL (SSE Stream + Session Continuity)
3. Hybrid Routing (Workers AI + Modal/vLLM) & Stripe Webhooks
Built-in operational endpoints for upstream GPU clusters and Stripe Checkout settlement.
- Workers AI Default:
private-modelandprivate-model-fastexecute directly on Cloudflare Workers AI at the edge. - Modal / vLLM GPU Routing: Register any
.modal.run/v1or.modal.direct/v1endpoint in Owner Console with awk-... .ws-...token to authenticate automatically viaModal-KeyandModal-Secret. - Stripe Webhook Endpoint: Point Stripe webhooks at
https://dotprod.tech/billing/webhooks/stripeforcheckout.session.completed,checkout.session.async_payment_succeeded,charge.refunded,charge.dispute.created, andcharge.dispute.closed.
4. Durable Object Credit Reservations, Guardrails & Error Codes
Each tenant is backed by a single-threaded SQLite Durable Object (TenantLedgerDO) that prevents concurrent overspend near zero balance.
- Uncached vs. Cached Input — Prefix-cached prompt tokens are metered separately in
GET /usage(preservingnullwhen upstream omits cache telemetry). - 400 Bad Request — Guardrail content policy intervention (
content_blocked) or unsupported non-text/tool bypass payload. - 401 Unauthorized — Missing, invalid, blocked, or revoked virtual API key.
- 402 Payment Required — Available prepaid credit balance in
TenantLedgerDOis below the conservative request reservation ceiling. - 403 Forbidden — Requested model is not enabled for your tenant, or the tenant account is suspended.
- 429 Too Many Requests — Per-tenant sliding-window RPM rate limit or
max_budgetpolicy ceiling reached.