Skip to content
Centriu
Centriu Synapse

BYO LLM Key Single-Call Billing Integrity Automation: One Logical Call, One Bill, No Silent Repeats

When a customer connects their own OpenAI key to Centriu Synapse, every request against that key is billed directly to them — which makes an invisible retry a real, unauthorized cost, not just wasted compute. A production measurement found exactly that: with no retry limit declared, the OpenAI SDK's own default of 2 meant a single provoked server error silently became 2 real billed requests, and the run still reported success with nothing in the logs showing a retry happened. The fix applies to BOTH of Synapse's independent bring-your-own-key call paths — the simple single-message path and the tool-calling agentic loop — setting the SDK's retry limit to zero on each, so one logical request can produce at most one billed request. The proof is behavioral: a test intercepts the actual network transport the SDK uses, deliberately without mocking the SDK library itself, and confirms exactly one outbound request even when the simulated provider fails every time.
SDK auto-retry disabled on both paths
Proven against the real transport
Person working on a laptop with notifications on screen
One logical call, one bill, no silent repeats.

Why a "bring your own API key" architecture turns an SDK default into a billing decision

Most software retrying a failed network call is a reasonable, invisible convenience — the caller pays nothing extra for a request that eventually succeeds on infrastructure they don't see the bill for. That entire assumption inverts the moment the credential belongs to the customer: every single request against their own OpenAI key lands directly on their own invoice, so a retry a customer never asked for and never sees a record of is not a convenience — it's an unauthorized charge, however small, hidden inside SDK behavior nobody explicitly chose.

How the underlying problem shows up before you fix it

A transient provider hiccup on a customer's own billed API key silently turns one request into two or three, with nothing in any log distinguishing the retry from a fresh call.

A monitoring or canary check reports a clean, successful run even though the provider actually failed and had to be retried behind the scenes.

Two independent code paths that call the same underlying SDK each assume the OTHER layer handles retry behavior — and neither actually does.

A file's own header comment describes a safety property ("retries are handled elsewhere") that is not actually true for one of the paths that comment is supposed to cover.

A test suite mocks an entire third-party SDK to verify behavior that actually lives inside that same SDK's own internal decision-making — hiding the exact thing under test.

Why "the SDK probably handles this reasonably" is the wrong default for a billed credential

An SDK's default retry behavior is designed for the common case: a managed, provider-billed API key where an occasional extra request is invisible overhead, not a customer-facing cost. Two independent adapter functions built against the same SDK, each assuming retry orchestration happens in a DIFFERENT layer than itself, is exactly how a default like this survives unnoticed — every layer's own code looks locally correct, and the actual behavior only becomes visible when someone measures the real number of requests reaching the provider during an actual failure, not just checks whether the final call eventually succeeded.

How Centriu Synapse closed the gap on both BYO call paths, and proved it behaviorally

The defect was found by direct production measurement, not code review: a canary run deliberately provoked a 500 error from the (test) provider on the first attempt, and the measurement showed 2 real requests reached the provider — not 1 — while the run's own final status still reported success. The doc recording this states the consequence plainly: "without the exit counter, that run would have passed as a clean canary." In a bring-your-own-key architecture, that silent multiplication lands as an unexplained line on the customer's own provider invoice.

The root cause was a default nobody had turned off: constructing an OpenAI SDK client without declaring `maxRetries` leaves the SDK's own built-in default of 2 in effect, so any transient server error on the first attempt triggers the SDK's own automatic retries, invisibly, before the calling code ever sees a result. Synapse's bring-your-own-key layer has exactly two independent client construction points using this SDK — one for a single-message call used by the platform's simple provider path, and a separate one for the tool-calling agentic loop used by its multi-step reasoning path — and both had the identical gap. Fixing only one would have left the agentic path, arguably the more expensive one per call, with the exact same hole open.

Compounding the defect, the file's own header comment asserted a specific, wrong safety claim: that retry orchestration was handled by a different, existing client layer elsewhere in the system. Checked directly against that other layer's own documentation, the opposite was true for this specific bring-your-own-key path — that layer explicitly declares it does NOT retry internally for this path, expecting the caller to already handle it. Two layers had each assumed the other one was responsible; neither actually was. The fix corrects both the behavior (`maxRetries: 0` set explicitly on both client construction points) and the comment that had been asserting a false safety property.

The verification is deliberately behavioral rather than superficial. A new test intercepts the actual global fetch function — the exact point where the SDK's own transport layer resolves its outbound connection for every new client instance — specifically WITHOUT mocking the SDK package itself, because mocking the whole SDK would hide precisely the internal retry decision the test needs to observe. Against a simulated provider that fails every single time, the test confirms exactly one outbound request reaches the transport layer, not the SDK's default of three. A manual mutation proof recorded alongside the fix confirms the test actually catches a regression: commenting out either `maxRetries: 0` declaration made the corresponding "provider always fails" test fail with 3 fetch calls recorded instead of 1, restoring it returned the suite to green. The fix deliberately left the platform's own separately-billed, managed-key clients untouched — those already declare their own deliberate, intentional retry policy and are not customer-billed bring-your-own paths, so extending this specific fix to them would have been out of scope.

What is actually built today

`maxRetries: 0` declared explicitly on both of Synapse's independent bring-your-own-key OpenAI client construction points — the single-message path and the tool-calling agentic-loop path.

A corrected file-level comment removing a previously false claim that a different layer already handled retry orchestration for this path.

A behavioral test that intercepts the real transport layer (`fetch`) rather than mocking the SDK, confirming exactly one outbound request per logical call even when the simulated provider fails every time.

A recorded manual mutation proof: removing either fix makes its corresponding test fail with 3 recorded requests instead of 1, confirming the test would actually catch a regression.

No new custom retry system built — the fix is a single explicit configuration value on each of the two existing client constructions, not new orchestration logic to maintain.

The platform's own separately-billed, managed-key clients (with their own deliberate, already-declared retry policy) deliberately left untouched, since they are not customer-billed bring-your-own paths.

A transient provider hiccup that used to cost double (illustrative scenario, not a real client)

A customer's connected OpenAI key hits a brief server-side hiccup on the provider's end during a single agent response. Before this fix, the SDK's own default retry would have silently sent a second request on that same customer's key the moment the first one failed — a second charge for what looks, from the outside, like one normal response. With `maxRetries: 0` in place, that one logical call either succeeds once or fails once and reports the failure — it never quietly becomes two billed attempts on the customer's own account.

What changes operationally

A customer's own connected API key is billed for exactly what they actually asked for — one logical request producing at most one billed request, with no invisible multiplication hiding inside a third-party SDK's own defaults. And because the proof is a behavioral test watching the real transport layer rather than a comment or a mock, a future change that accidentally reintroduces the same gap would be caught by the test suite rather than by a customer noticing an unexplained charge.

When this is not the right fit

This fix is scoped specifically to Synapse's bring-your-own-key OpenAI paths — it does not add or change retry behavior for Centriu's own separately-billed, managed-key model clients, which keep their own already-declared, deliberate retry policy since a retry there does not carry the same customer-billing consequence. A team wanting Synapse to automatically retry a failed BYO call on the customer's behalf will find the opposite by design: a failure is reported once, honestly, rather than silently retried at the customer's own expense.

Trusting an SDK's reasonable default vs. declaring the billing-safe value explicitly

Leaving a third-party SDK's retry behavior at its own default treats "reasonable for the common case" as good enough everywhere it's used — which quietly breaks the moment the credential behind the call belongs to a customer who sees every request on their own bill. Centriu Synapse instead makes the billing-safe value an explicit, declared setting on every bring-your-own-key call path, verified by a test that watches the real network boundary rather than trusting a comment or a mock to describe what the SDK actually does.

Related systems

Main system: Centriu Synapse.

What it does NOT do

  • Does not let a transient provider failure silently multiply into more than one billed request on a customer's own bring-your-own API key — the SDK's own default retry is explicitly disabled on both BYO call paths.
  • Does not build a custom retry system to replace the disabled SDK default — a failed call is reported as a failure once, honestly, rather than retried automatically at the customer's expense.
  • Does not change retry behavior for Centriu's own separately-billed, managed-key model clients — those already declare their own deliberate retry policy and are out of scope for this specific fix.
  • Does not verify this behavior by mocking the SDK package itself — the test intercepts the actual transport layer specifically because mocking the SDK would hide the exact internal decision being tested.
  • Does not report a run as a clean success when a retry actually occurred behind the scenes — the fix removes the SDK behavior that made a retried run indistinguishable from a clean one.
  • Does not leave the correction unproven — a recorded manual mutation test confirms removing either `maxRetries: 0` declaration causes its corresponding test to fail with the extra requests actually counted.

Security and governance

A customer's own connected API key is used only for that customer's own requests and is never shared across the SDK client instances of another organization. The single-call billing guarantee applies specifically to the two audited bring-your-own-key paths. Any personal data referenced in a request payload remains subject to Brazil's LGPD (Law No. 13,709/2018). Full detail on access control lives at /governanca and /iso.

Pricing and contracting

Available by monthly subscription, with tiered plans. Values and terms come from the official pricing table at /precos (Centriu's central source — never restated here).

Frequently asked questions

What was the actual measured defect?

With no retry limit declared, the OpenAI SDK's own default of 2 meant a single provoked provider error resulted in 2 real requests to the provider, while the run still reported success — nothing distinguished the retry from a clean call.

How was the fix applied to both call paths, not just one?

Synapse has two independent bring-your-own-key OpenAI client construction points — a single-message path and a tool-calling agentic-loop path — and `maxRetries: 0` was set explicitly on both, since fixing only one would have left the other with the same gap.

How is the fix actually proven, rather than just claimed?

A test intercepts the real network transport the SDK uses (not a mock of the SDK itself) and confirms exactly one outbound request per logical call even when the simulated provider fails every time — with a recorded manual mutation proof showing the test fails as expected if the fix is removed.

Does this change how Centriu's own managed AI model access is billed?

No — this fix is scoped specifically to bring-your-own-key paths. Centriu's own separately-billed, managed-key clients keep their own already-declared, deliberate retry policy, since a retry there does not carry the same customer-billing consequence.

Does Synapse now retry a failed call automatically on the customer's behalf?

No — a failed call is reported as a failure once. No custom retry system was built to replace the disabled SDK default.

What does Centriu Synapse cost?

It is sold by subscription with a published starting price — exact current values are on the central pricing page.

See how Centriu Synapse protects bring-your-own API key billing integrity

Reach our commercial team directly, or leave your details below — we'll follow up with guidance for your case.

Sources

  1. Centriu Synapse — public product page — Centriu, 2026-07-20 · link(primária)
  2. Centriu Synapse — public factsheet (API, JSON) — Centriu, 2026-07-21 · link
  3. Law No. 13,709/2018 — Brazil’s General Data Protection Law (LGPD) — Presidência da República (Brazil), 2018-08-14 · link

Last material update on .

By · AI-assisted production, with human review