Skip to content

fix(auth): handle current billing schema - #11

Open
Fenrur wants to merge 1 commit into
paperfoot:mainfrom
Fenrur:fix/billing-schema-drift-v090
Open

fix(auth): handle current billing schema#11
Fenrur wants to merge 1 commit into
paperfoot:mainfrom
Fenrur:fix/billing-schema-drift-v090

Conversation

@Fenrur

@Fenrur Fenrur commented Aug 16, 2026

Copy link
Copy Markdown

Summary

  • model Suno's current subscription_type and plans billing payload
  • resolve the active plan name without requiring the removed nested plan field
  • keep auth, credits, models, and doctor compatible with the updated schema

Type

fix

Testing

  • cargo test (134 tests passed)
  • verified suno auth --login against the live Suno API

This updates the earlier billing-schema fix from #7 for the current v0.9.0 codebase, including the newer doctor and JSON output paths.

Suno's /api/billing/info/ endpoint no longer returns a nested
`plan: { name, plan_key }` object or a `period` string — both were
required fields on the Rust BillingInfo struct, so every command
touching billing (credits, auth, config check, models) failed to
deserialize the response and errored out.

The live response now exposes `subscription_type` (either `false` for
the free tier, or the active plan's `plan_key` string) plus a `plans`
array describing the full catalog (id, key, name, pricing, features).
Verified against a live authenticated call to the current API.

Replace the required plan/period/renews_on fields with
subscription_type + plans, and add BillingInfo::plan_name() to resolve
a human-readable plan name from that catalog. Update the two call
sites that read info.plan.name and the credits table renderer
accordingly.
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.

2 participants