Context
The examples/sdk/ directory demonstrates most DeepintShield features, but the virtual-keys example (examples/sdk/11_virtual_keys.py) is minimal and does not show how to pass per-request governance headers. Users need a copy-paste example demonstrating x-deepintshield-* headers for per-key model allowlists, budgets, and rate limits.
What to do
- Create
examples/sdk/11b_virtual_key_governance_headers.py that:
- Constructs a DeepintShield client (reuse the setup from
11_virtual_keys.py).
- Sends a request passing at least 3
x-deepintshield-* governance headers via the SDK's headers parameter.
- Includes inline comments explaining what each header controls (model allowlist, budget, rate limit).
- Add a row for the new example to the Core SDK table in
examples/README.md.
- Add a short note on when to use per-request governance headers vs. configuring the virtual key in the UI.
Acceptance criteria
File pointers
- Existing minimal example:
examples/sdk/11_virtual_keys.py
- Examples index/table:
examples/README.md
Context
The
examples/sdk/directory demonstrates most DeepintShield features, but the virtual-keys example (examples/sdk/11_virtual_keys.py) is minimal and does not show how to pass per-request governance headers. Users need a copy-paste example demonstratingx-deepintshield-*headers for per-key model allowlists, budgets, and rate limits.What to do
examples/sdk/11b_virtual_key_governance_headers.pythat:11_virtual_keys.py).x-deepintshield-*governance headers via the SDK'sheadersparameter.examples/README.md.Acceptance criteria
examples/sdk/11b_virtual_key_governance_headers.py, copy-paste ready (runs against an active gateway + virtual key).examples/README.mdupdated to reference the new example.File pointers
examples/sdk/11_virtual_keys.pyexamples/README.md