You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provider Policy Decision Traces for OpenAI-Compatible SDKs (September 2026)
#89
Pricing note checked during the September 14, 2026 run: the live AIWave pricing endpoint reported group_ratio.default=1 and group_ratio.vip=0.9. The dated static price snapshot reported checked=2026-09-10, currency=USD, and unit=per_1m_text_tokens. Always check the current endpoint before using these rows in production billing math.
Provider policy is usually described as a backend concern: decide which provider is allowed, apply a route rule, and hide the rest behind an OpenAI-compatible endpoint. That abstraction is useful, but SDK examples need one more artifact when they teach production usage: a provider policy decision trace.
I do not mean a full private receipt. A decision trace should not contain the prompt, completion, API key, account identifier, or customer-specific workload data. It is a small public-safe record that explains how the example interpreted its own route policy at the time of the call. If a developer later asks why a request used one provider family instead of another, the maintainer can inspect the trace before touching private logs.
This differs from a generic model snapshot. A model snapshot says what row and version the example saw. A provider policy trace says why the route was allowed in the first place. In a multi-provider application, those are separate questions. A model can have a valid price row and still be disallowed for a workload because of data policy, output budget, cache behavior, region expectation, or fallback scope.
Before writing this post, I rechecked AIWave's public pricing surfaces. The live endpoint at https://aiwave.live/api/pricing returned success=true, 64 model rows, pricing version a42d372ccf0b5dd13ecf71203521f9d2, default multiplier 1, and VIP multiplier 0.9. The dated endpoint at https://aiwave.live/api/v1/pricing returned pricing version 8c7a0c0b30661ccbc13d142cb54d1e4ae445fe774b2c6fa501080db97c7a3e56, checked=2026-09-10, and 64 rows.
Selected dated rows from that snapshot:
Model ID
Input / 1M
Cache-hit input / 1M
Output / 1M
Effective date
deepseek-flash
$0.70
$0.0233
$2.10
2026-09-10
deepseek-v4-flash
$0.638
$0.0202884
$1.914
2026-08-27
deepseek-v4-pro
$1.914
$0.0637362
$5.742
2026-08-27
glm-5.1
$2.10
$0.680001
$6.5999997
2026-08-27
kimi-k3
$4.50
$0.90
$22.50
2026-08-27
The trace should be generated before the request is sent, then attached to test fixtures or debug output. That timing matters. If the trace is created after the response, it can quietly inherit whatever the backend actually did. The purpose is to preserve the client-side expectation: this workload was allowed to use this provider family, under this policy name, with this dated price source and this group multiplier.
For SDK maintainers, the test is lightweight. Assert that every example with routing logic has a policy name, allowed provider list, pricing source, checked date, group label, and redaction list. If fallback is enabled, add fallback_allowed=true and a bounded list of fallback families. If fallback is disabled, say so explicitly.
That small habit prevents a support thread from starting with "the gateway picked the wrong provider." The better first question becomes: did the SDK, the policy, and the backend all agree on the same route decision?
Discussion question: should provider policy decision traces live in SDK debug middleware, or should examples generate them explicitly so developers learn the policy boundary field by field?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Provider policy is usually described as a backend concern: decide which provider is allowed, apply a route rule, and hide the rest behind an OpenAI-compatible endpoint. That abstraction is useful, but SDK examples need one more artifact when they teach production usage: a provider policy decision trace.
I do not mean a full private receipt. A decision trace should not contain the prompt, completion, API key, account identifier, or customer-specific workload data. It is a small public-safe record that explains how the example interpreted its own route policy at the time of the call. If a developer later asks why a request used one provider family instead of another, the maintainer can inspect the trace before touching private logs.
The fields are simple:
{ "trace_type": "provider_policy_decision", "sdk_family": "python", "base_url": "https://aiwave.live/v1", "requested_model": "deepseek-v4-pro", "allowed_provider_families": ["DeepSeek"], "policy_reason": "coding-agent-long-context", "pricing_source": "https://aiwave.live/api/v1/pricing", "pricing_checked": "2026-09-10", "group": "default", "group_multiplier": 1, "redacted_fields": ["api_key", "prompt", "completion", "account_identifier"] }This differs from a generic model snapshot. A model snapshot says what row and version the example saw. A provider policy trace says why the route was allowed in the first place. In a multi-provider application, those are separate questions. A model can have a valid price row and still be disallowed for a workload because of data policy, output budget, cache behavior, region expectation, or fallback scope.
Before writing this post, I rechecked AIWave's public pricing surfaces. The live endpoint at
https://aiwave.live/api/pricingreturnedsuccess=true, 64 model rows, pricing versiona42d372ccf0b5dd13ecf71203521f9d2, default multiplier1, and VIP multiplier0.9. The dated endpoint athttps://aiwave.live/api/v1/pricingreturned pricing version8c7a0c0b30661ccbc13d142cb54d1e4ae445fe774b2c6fa501080db97c7a3e56,checked=2026-09-10, and 64 rows.Selected dated rows from that snapshot:
deepseek-flash$0.70$0.0233$2.10deepseek-v4-flash$0.638$0.0202884$1.914deepseek-v4-pro$1.914$0.0637362$5.742glm-5.1$2.10$0.680001$6.5999997kimi-k3$4.50$0.90$22.50The trace should be generated before the request is sent, then attached to test fixtures or debug output. That timing matters. If the trace is created after the response, it can quietly inherit whatever the backend actually did. The purpose is to preserve the client-side expectation: this workload was allowed to use this provider family, under this policy name, with this dated price source and this group multiplier.
For SDK maintainers, the test is lightweight. Assert that every example with routing logic has a policy name, allowed provider list, pricing source, checked date, group label, and redaction list. If fallback is enabled, add
fallback_allowed=trueand a bounded list of fallback families. If fallback is disabled, say so explicitly.That small habit prevents a support thread from starting with "the gateway picked the wrong provider." The better first question becomes: did the SDK, the policy, and the backend all agree on the same route decision?
Discussion question: should provider policy decision traces live in SDK debug middleware, or should examples generate them explicitly so developers learn the policy boundary field by field?
All reactions