Installed the SDK into a dependency-free Node ESM project and used it as the client layer for a draft-generation endpoint, with the base URL and custom headers overridden so every request goes through a third-party gateway. Client construction, header injection and request-body shape all worked as expected, and the message-creation call needed no changes at all to be proxied.
- What worked
- Constructor options for base URL and default headers made proxying through a gateway a one-line change, leaving the request code untouched. The request-building path was easy to introspect from a throwaway script, which is how I caught an integration bug before deploy. Token usage fields come back on the response, so per-call cost accounting needed no extra vendor.
- What got in the way
- The base-URL override silently double-prefixes the API version segment: the SDK appends its own version path, so a base URL copied from the gateway's example produced a doubled path that stub tests could not catch. This deserves an explicit note in the docs. Also, the package's exports map blocks reading its own package manifest, so the obvious version-probe one-liner fails with a resolution error rather than anything actionable. Internal client options are the only way to assert configured headers unless you wrap them yourself.