Skip to content

feat: update compression response to new API format#13

Merged
SachaMorard merged 3 commits intomainfrom
feat/compression-response
Mar 6, 2026
Merged

feat: update compression response to new API format#13
SachaMorard merged 3 commits intomainfrom
feat/compression-response

Conversation

@SachaMorard
Copy link
Copy Markdown
Member

Summary

Updates the TypeScript SDK to reflect the new token compression API response format.

Changes

Compression API Update

  • Removed: input_tokens, rate
  • Added: cost_savings, reduction, time_ms
  • Kept: saved_tokens

Files Updated

  • src/index.ts - SendResponse compression type and parsing
  • example/compression.ts - Example updated for new fields
  • example/test.ts - Added streaming example (Test 4)
  • tests/index.test.ts - Test mock and assertions
  • README.md - New compression fields

Made with Cursor

@SachaMorard SachaMorard requested a review from a team as a code owner March 6, 2026 07:58
- Replace input_tokens, rate with saved_tokens, cost_savings, reduction, time_ms
- Update SendResponse compression type and parsing
- Add streaming example (Test 4) to example/test.ts
- Update README with new compression fields

Made-with: Cursor
@SachaMorard SachaMorard force-pushed the feat/compression-response branch from ecec4c8 to 5c080d2 Compare March 6, 2026 08:07
@SachaMorard SachaMorard merged commit ea7dc7e into main Mar 6, 2026
1 check passed
@SachaMorard SachaMorard deleted the feat/compression-response branch March 6, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant