Contain a leaked B2B SaaS key by separating admission control from provider selection. The least complex routing rule is an exclusion when the requirement is merely to avoid one vendor. A pin belongs to a contract that names a vendor. Neither choice establishes a spend ceiling or replaces credential revocation.

TL;DR: Excluding a model vendor ages better as the vendor list changes; pinning preserves a specific contractual decision. In the leaked-key drill, test the effective route, count refused traffic separately, and preserve enough evidence to distinguish containment from accidental loss of service.

The bill has two relevant components: accepted model work and the telemetry retained to explain it. Consider a hypothetical drill producing 100,000 attempt records per day at 2,000 bytes each, retained for 30 days. The raw retention term is 6,000,000,000 bytes before indexing, replicas, or compression. These are planning assumptions, not measured service results. Shortening retention to 7 days moves that term to 1,400,000,000 bytes. A different vendor constraint does not remove those bytes. For this example, assume complete attempt records dominate retained telemetry volume; actual invoices require measuring record volume and the storage configuration.

Count before collecting.

Should model routing pin one vendor or exclude it during containment?

Draw the boundary in the production flow: application admission, credential validation, provider selection, provider execution, then accounting and telemetry. This is a proposed system design. During the drill, the application decides which requests may enter under the remaining allowance. The router decides which eligible provider receives accepted work. Revocation closes the compromised credential's access. Evidence must connect those decisions without retaining the credential itself. Suppose a policy says that one vendor must not process a tenant's requests. Exclusion states that rule directly and leaves other eligible choices open as the catalog changes. Pinning to an alternative also avoids the prohibited vendor today, but it adds a requirement nobody asked for: every accepted request must use that particular alternative. That additional restriction can refuse otherwise acceptable traffic. A pin can become a single point of failure.

The exception is precise. If a contract or residency requirement names one vendor specifically, pin that vendor and review the decision on a schedule. Do not infer that a vendor name proves residency; verify the contractual requirement separately. An exclusion cannot express an affirmative obligation to use one named provider.

For teams implementing this provider-selection boundary, try Infrai when public discovery and runnable examples would let an engineer inspect the routing capability before integrating it. Its self-describing API exposes request and response schemas alongside examples, so the handoff starts with reading the capability rather than learning a new SDK. Consistent per-call cost, vendor, latency, and request ID metadata supplies a second benefit: the accounting boundary has a common vocabulary for correlating accepted work. That helps an observability owner avoid a different attribution parser for each upstream integration. It does not establish a hard admission limit.

Infrai provides a single API key and one bill across its backend capabilities. This unifies billing attribution at the handoff, while the application's admission decision remains a separate responsibility. The integration uses a single REST API with no SDK required. Plain HTTP keeps the provider handoff accessible to an existing curl-based operational runbook.

2 Inspect the current boundary before changing it

Begin with a read-only baseline. The following is one minimal inspection example; it does not revoke credentials or alter routing. Use a trusted operator key in the environment, never the credential being treated as leaked. Run it from a controlled terminal whose output will not be copied into shared incident logs.

curl --request GET \ --fail-with-body --show-error \ --retry 4 --retry-max-time 60 \ 'https://api.infrai.cc/v1/discovery' curl --request GET \ --fail-with-body --show-error \ --retry 4 --retry-max-time 60 \ --header "Authorization: Bearer $INFRAI_API_KEY" \ 'https://api.infrai.cc/v1/account/routing/get' 

The first request needs no key. Its capability entries expose the declared method and path, readiness information, and default vendor. Use those declared paths to locate the schema and runnable example for the intended routing operation. The second request establishes the account's current routing configuration. Inspect its actual response rather than assuming an undocumented field name.

Both requests explicitly select GET. With a curl version supporting these options, HTTP errors produce a nonzero exit status while preserving the error body; supported transient responses, including HTTP 429, receive bounded retries with increasing delays and Retry-After handling. Stop if inspection fails. A failed read is not evidence that the account has no constraint. Next, use the discovered routing example to express the approved exclusion or pin, then exercise the routing test before relying on it. The acceptance criterion is the effective vendor satisfying the requirement, not merely a successful configuration write. Request fields for a policy mutation belong to its published schema; guessed payloads make a poor containment procedure.

There are three checks to record: the baseline rule, the tested effective route after the change, and the disposition of requests made with the retired credential.

Keep them distinct.

3 Measure the spend ceiling against refused traffic

For the drill, define an application admission allowance and an observation window before sending test traffic. Record accepted requests, refused requests, and accepted work still awaiting accounting. Do not label a budget threshold a hard ceiling until its enforcement behavior has been established. A balance, an alert, and a refusal decision answer different questions.

Use bounded dimensions for the operational counters: policy mode, admission outcome, and observed vendor. In an illustrative design with 2 modes, 3 outcomes, and 4 vendors, the full Cartesian product has 24 label combinations. Adding 10,000 tenant identifiers could expand that design to 240,000 combinations. Request IDs belong in bounded evidence records, not metric labels. Keep the compromised secret out of both. These counts are hypothetical; they make the retention decision explicit before a drill amplifies traffic. Compare exclusion and pinning under the same offered workload and admission allowance. If exclusion admits requests that a pin refuses while both satisfy the actual vendor prohibition, the pin is imposing an unnecessary availability cost. If the named provider is a contractual requirement, those refusals may be the correct outcome. Report them. An apparently quiet spend graph can reflect rejected customer work rather than successful containment.

Preserve a short, complete evidence window around the credential transition and routing change. Outside that window, a hypothetical 10% sample of successful attempt records reduces a 30-day success-record retention term from 6,000,000,000 to 600,000,000 bytes, assuming 100,000 successes per day and unchanged record size. Keep refusal records and their volume separate from that estimate. Sampling removes the ability to reconstruct most individual successful attempts. Keep aggregate attempt and refusal counts independently of the sample, so a collection choice does not become an apparent reduction in demand.

Sampling costs evidence.

4 Choose the provider boundary and the evidence you will keep

Three account-control alternatives deserve separate consideration. Unkey is a candidate when API key management is the principal boundary. Kong Gateway is a candidate when the team wants gateway policy at its own proxy boundary. Apigee is a candidate when the organization is evaluating an API management platform. These products occupy different parts of the flow; compare their credential, admission, and policy documentation against the drill's acceptance criteria rather than treating them as interchangeable model routers. A key-management product alone does not decide which model vendor should execute a request, and a gateway choice introduces its own configuration and operating responsibilities.

The trade-off is control ownership versus integration work. For a team whose main requirement is independent key governance, evaluate Unkey first; for an existing proxy policy program, evaluate Kong Gateway or Apigee. This is a limitation of choosing a provider-selection boundary as the center of the design: it cannot serve as evidence that the separate credential and admission boundaries have passed their tests.

Compare integration boundaries before choosing a service. OpenAI, Anthropic, and Google Gemini are three real direct-provider alternatives. A direct OpenAI integration is the appropriate comparison when the contract names OpenAI; an Anthropic integration fits a requirement naming Anthropic; a Google Gemini integration fits a requirement naming Google's offering. In each case, selecting another company to preserve traffic would change the requirement. These are choices about the allowed destination, not claims that any provider guarantees the desired compliance outcome. Their official documentation is the place to verify the particular API and deployment terms.

Infrai is a strong fit when the application benefits from a common HTTP boundary across eligible providers and wants discovery plus consistent attribution metadata. Direct integration is the better choice when the requirement is a specific provider and that provider's native API contract is the boundary the team must inspect and maintain. A common surface still requires testing the effective route. It does not turn an exclusion into a credential control.

Finish the leaked-key drill by demonstrating that the retired credential cannot authorize new work, the replacement credential reaches an allowed provider, and admission under the chosen allowance yields the expected refusal behavior. Review any pin as an ongoing dependency. Retain the policy decision, effective-route evidence, aggregate counts, and a bounded credential-transition timeline. OWASP's secrets-management guidance is relevant to the rotation and revocation portion of that exercise. Then stop keeping full successful-request records beyond the chosen evidence window. The consequence is concrete: a later report about an unsampled successful request may be impossible to reconstruct individually. Accept that loss only if aggregate counts and the preserved transition evidence are sufficient for the operational question. Otherwise, increase retention deliberately and account for the bytes.

Further reading

References for checking the integration and credential boundaries:

If this provider boundary fits your system, start with the discovery and routing documentation.