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(core): expose premium usage charges in usage and logs (#4651)
## Summary Expose the premium usage charge returned by the platform's usage summary and tool log APIs in the TypeScript and Python SDKs. Related platform changes: [usage summary](https://github.com/ComposioHQ/hermes/pull/13195) and [tool logs](https://github.com/ComposioHQ/hermes/pull/13299). ## Changes - Map the exact USD `premium_usage_charge` from the project usage summary to TypeScript `premiumUsageCharge` and Python `premium_usage_charge`. - Type and validate the optional charge in TypeScript tool log metadata; verify Python log search and detail preserve the metadata key. - Document both fields in the production readiness and log streaming guides, and add a core changeset. ## Type of change - [ ] Bug fix - [x] New feature - [ ] Refactor/Chore - [x] Documentation - [ ] Breaking change ## How Has This Been Tested? - `pnpm --filter @composio/core exec vitest run test/models/usage.test.ts test/models/logs.test.ts` — 14 passed. - `pnpm --filter @composio/core typecheck` and `pnpm --filter @composio/core build` — passed. - `uv run --package composio --no-dev --with pytest pytest python/tests/test_experimental_usage.py python/tests/test_logs.py -q` — 10 passed. - Ruff, Oxlint, Prettier, and the repository pre-commit hooks — passed. - `pnpm validate:changesets` — passed. - Docs `bun run test` — 606 passed; `bun run lint`, `bun run lint:links`, `bun run types:check`, and `bun run check:kb-semantic --allow-stale` — passed. The semantic check reported the expected stale artifact warning. - Docs `bun run build` failed while compiling the unrelated `content/docs/tools-direct/executing-tools.mdx`: the Twoslash filesystem cache returned `SyntaxError: Unexpected end of JSON input`. ## Screenshots (if applicable) Not applicable. ## Checklist - [x] I have read the Code of Conduct and this PR adheres to it - [x] I have read and understand every line of this diff, including any LLM-generated code - [x] Any third-party docs links or promotional content follow the third-party links policy - [x] I ran linters/tests locally and recorded the docs build failure above - [x] I updated documentation as needed - [x] I added focused tests - [x] I added a changeset for the published TypeScript package ## Additional context The pinned generated clients (`@composio/client@2.0.0-rc.8` and `composio-client==2.0.0rc8`) predate these server fields and are the latest published prereleases. Their runtime responses retain the fields, so the SDK exposes them without editing generated code or changing client pins.