Skip to content

CONV-308: Add credits balance endpoint#268

Merged
menvil merged 1 commit into
developfrom
feature/CONV-308-add-credits-balance-endpoint
Jun 3, 2026
Merged

CONV-308: Add credits balance endpoint#268
menvil merged 1 commit into
developfrom
feature/CONV-308-add-credits-balance-endpoint

Conversation

@menvil

@menvil menvil commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds GET /api/v1/credits/balance returning {data: {balance: N, unit: 'credits'}}
  • Uses CreditLedger::balance() — no transaction history exposed
  • Protected by api.key + api.access middleware

Test plan

  • Returns correct balance for Pro user
  • Missing API key → 401
  • Free user → 403 api_not_available
  • composer test passes (584 tests)
  • composer lint passes

🤖 Generated with Claude Code


Summary by cubic

Adds GET /api/v1/credits/balance to let Pro users fetch their current credits balance via API. Addresses CONV-308.

  • New Features
    • Response: { data: { balance: N, unit: 'credits' } }.
    • Uses CreditLedger::balance() only; no transaction history.
    • Access control: api.key + api.access required; missing key → 401, Free plan → 403 api_not_available.

Written for commit 01eaca3. Summary will update on new commits.

Review in cubic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • release

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 366e7da5-123f-45e7-b1e3-fa4e0c918d04

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/CONV-308-add-credits-balance-endpoint

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@menvil menvil merged commit e3ddcfe into develop Jun 3, 2026
2 checks passed
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