How it works
Why Solwyn is a wrapper, not a proxy — the context-engine and intelligence-engine split, direct-to-provider calls, and the fail-open default.
Solwyn is a wrapper, not a proxy. When you write Solwyn(OpenAI()), you get back an object with the same surface as the client you passed in. Your LLM calls travel directly from your application to the provider — Solwyn is never in the request or response path. After each call returns, the SDK reads the token counts the provider already put on the response and forwards only those counts to Solwyn Cloud.
Your App + Solwyn SDK Solwyn Cloud
+-----------------------+ +------------------+
| your code | token counts | PricingService |
| | | (no prompts) | Budget state |
| Solwyn(OpenAI()) | -------------> | Cost dashboard |
| | | | Alerts |
| LLM provider <------ -- direct call +------------------+
+-----------------------+Two engines
The SDK and the cloud API split responsibilities cleanly:
- The SDK is a context engine. After each LLM call, it reads the raw token counts from the provider's usage fields and normalizes them into a single breakdown. It does no pricing math itself.
- The cloud API is the intelligence engine. It owns all pricing tables, computes dollar costs from those token counts, enforces budget limits, and powers the dashboard and alerts.
This split is why pricing updates require only an API deploy — never an SDK release. The counts the SDK sends are stable; the cost computed from them lives entirely server-side.
Calls go direct to the provider
Because Solwyn wraps rather than proxies, the control plane being slow or unreachable cannot slow down or block your LLM traffic by default. The request path is your process to the provider, full stop. Solwyn observes the result after the fact; it never sits between you and the model.
Fail-open by default
If Solwyn Cloud is unreachable, your LLM calls proceed normally with local tracking — there is no downtime from the control plane. This is the default (fail_open=True). Hard enforcement that can block calls is opt-in: set budget_mode="hard_deny" (Founder tier and above), and optionally fail_open=False to deny calls when the budget service is unreachable. See Budget Enforcement for the full enforcement model.
What this buys you
- No prompt capture — only token counts and structural metadata leave your process. The SDK never reads, logs, or transmits your prompts or responses.
- Provider-agnostic — wrap OpenAI, Anthropic, Google Gemini, Amazon Bedrock, or Together clients, or any OpenAI-compatible endpoint, with the same surface. See Providers.
- Server-side pricing — the API owns every pricing table, so new models and rate changes ship without touching your code.
The exact wire contract
This page describes the shape of the design. For the precise, field-by-field list of what is and is not transmitted — the canonical MetadataEvent contract — see Privacy. The SDK is open source, so the claim is auditable.