Skip to content

client.o_auth should be client.oauth — OAuth and SCIM initialisms missed by #561 #587

Description

@rajarshidattapy

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 be client.oauth
  • Scim — the class should be SCIM

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")
True

From 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: true

Before 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.

  • SCIM has exactly that problem and no entry: the class is still Scim while BYOK,
    STT, TTS, and APIKeys are all correct. Adding scim: {initialism: true} should be a
    direct copy of the chore(gen): render BYOK/TTS/STT as initialisms in generated symbols #561 recipe.
  • OAuth is the inverse. Its class name is already correct (class OAuth(BaseSDK)), but the
    tag OAuth is mixed-case, so the snake_case attribute splits on the internal capital and
    becomes o_auth. A plain initialism: true here would presumably target OAUTH and make
    the class name worse. The desired output is the mixed pair — attribute oauth, 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 ScimSCIM 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions