Skip to content

Check X credit balance before telling users to buy - #265

Open
vaulpannx wants to merge 4 commits into
cursor:mainfrom
vaulpannx:pvann/check-credits-before-buy
Open

Check X credit balance before telling users to buy#265
vaulpannx wants to merge 4 commits into
cursor:mainfrom
vaulpannx:pvann/check-credits-before-buy

Conversation

@vaulpannx

Copy link
Copy Markdown

Summary

  • Follow-up to Document X credits endpoint in the MCP guide #254: agents must call get_usage_credits before any user-facing X text on connect.
  • Ban the legacy “you’ll need to purchase credits at https://console.x.com” line unless the check returned ~$0 or the planned job would exceed the balance.
  • On-connect copy now states the dollar balance and ideas; console.x.com is mentioned only when they actually need to add credits.

Test plan

  • Connect X with a non-zero balance: capabilities message includes the amount and does not tell the user to buy credits or visit console.x.com.
  • Connect X with ~$0: after the credits fetch, then point them to https://console.x.com.
  • Confirm the agent never greets / lists capabilities / mentions purchasing until get_usage_credits has returned.

Made with Cursor

vaulpannx and others added 2 commits August 24, 2026 13:44
Agents now fetch GET /2/usage/credits on connect and suggest work that fits the user's dollar balance.

Co-authored-by: Cursor <cursoragent@cursor.com>
Fetch get_usage_credits before any on-connect copy, and only mention console.x.com when the balance is ~$0 or a job would not fit.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread third_party/x/skills/x-api-mcp-guide/SKILL.md Outdated
Error 3 no longer fights the "nothing else" rule or the paid By budget rows. Cache {credits} as $0 and re-fetch after a top-up.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 79ca810. Configure here.

Comment thread third_party/x/skills/x-api-mcp-guide/SKILL.md Outdated
Error 3 is only for blocked billed requests. A successful get_usage_credits of ~$0 keeps capabilities, states $0.00, and offers free lookups.

Co-authored-by: Cursor <cursoragent@cursor.com>
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