Repository navigation
Description
Summary
PR #561 ("chore(gen): render BYOK/TTS/STT as initialisms in generated symbols", merged
2026-07-30) normalized three initialisms via customCasings in .speakeasy/gen.yaml. Two
more were left behind, and they fail in two different ways:
client.o_auth— the attribute should beclient.oauthScim— the class should beSCIM
The first is user-facing and the reason for this issue; the second is the same defect #561
was fixing, just missed.
Current behavior
>>> client = OpenRouter(api_key="...")
>>> hasattr(client, "oauth")
False
>>> hasattr(client, "o_auth")
TrueFrom src/openrouter/sdk.py:
57: tts: "TTS"
59: stt: "STT"
61: o_auth: "OAuth" # class right, attribute wrong
65: byok: "BYOK"
86: api_keys: "APIKeys"
102: scim: "Scim" # attribute right, class wrong
Why these two are different
#561 added:
customCasings:
byok:
initialism: true
stt:
initialism: true
tts:
initialism: trueBefore that commit the attributes were already byok / stt / tts; what was wrong were the
class names, Byok / Stt / Tts. The initialism: true entries fixed the classes.
SCIMhas exactly that problem and no entry: the class is stillScimwhileBYOK,
STT,TTS, andAPIKeysare all correct. Addingscim: {initialism: true}should be a
direct copy of the chore(gen): render BYOK/TTS/STT as initialisms in generated symbols #561 recipe.OAuthis the inverse. Its class name is already correct (class OAuth(BaseSDK)), but the
tagOAuthis mixed-case, so thesnake_caseattribute splits on the internal capital and
becomeso_auth. A plaininitialism: truehere would presumably targetOAUTHand make
the class name worse. The desired output is the mixed pair — attributeoauth, class
OAuth— so this needs whichever knob produces that, and whoever runs the generator will
know better than I do which one.
Docs already disagree with the code
The generated docs directory is docs/sdks/oauth/, titled "OAuth", but every snippet inside
it calls the split attribute:
res = open_router.o_auth.exchange_auth_code_for_api_key(...)
res = open_router.o_auth.create_auth_code(...)docs/sdks/scim/README.mdx by contrast uses open_router.scim.…, matching its directory.
Compatibility note
Renaming client.o_auth to client.oauth is a breaking change for anyone already calling it,
and the SDK has been stable since v1.0. Worth considering keeping o_auth as a deprecated
alias for a release or two — the same treatment beta.responses got in 1477485 — rather
than a hard rename. The Scim → SCIM change carries the same caveat if anyone imports the
class directly, though the scim attribute is unaffected.
Environment
- openrouter 1.1.23 (main @ cb401a8)
- Python 3.13.6
Activity