Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
feat(sdk): experimental premium usage policy for Sessions (#4599)
## What this does Adds minimal, experimental SDK support for the existing Session `premium_usage` API policy. Developers can pass `premiumUsage` in TypeScript or `premium_usage` in Python when creating a Tool Router Session, and update that policy on an existing Session. This is the Session-level premium usage policy for Instant Tools backed by hosted accounts. It is **not** a new toolkit-availability switch or a change to account selection. The project must separately allow premium usage; that setting is not self-service yet. ## Contract and defaults - Omit the field: send no new SDK field. The backend applies its existing Session default, subject to the project setting. - `false`: disable premium usage for that Session. - Object: restrict eligible toolkits or tools using `enable`/`disable`; `returnPremiumCharge` (`return_premium_charge` in Python) opts into actual charge visibility. It does not grant spend permission on its own. - Existing connected-account pins, toolkit filters, `enable_multi_execute`, and other Session settings remain unchanged. No direct-execution API changes. Both SDKs pass `premium_usage` through the pinned generated clients' typed create/patch fields (`@composio/client` 2.0.0-rc.8, `composio-client` 2.0.0rc8). No generated client files are changed. ## Scope - TypeScript: create/update schemas, wire-name conversion, and preservation of the optional `premium_charge` execution response as `premiumCharge`, with focused tests and a changeset. - Python: create/update keyword arguments and focused tests. - No pricing/catalog response modeling or new public SDK API for project settings in this PR. ## Verification - TypeScript: 188 focused tests passed; `@composio/core` typecheck passed. - Python: 129 Tool Router tests passed. - The full TypeScript suite was attempted but includes unrelated local-network tests that cannot bind to `127.0.0.1` in this environment. Focused changed-area tests pass. Companion developer documentation: #4604 (merged), with a follow-up in #4606. This PR contains only SDK code and tests. --------- Co-authored-by: jkomyno <alberto@composio.dev>