Skip to content

Add page on buying credit with MPP - #2659

Merged
kcmartin merged 3 commits into
mainfrom
mpp-credits
Nov 18, 2026
Merged

kcmartin merged 3 commits into
mainfrom
mpp-credits

Conversation

@kcmartin

@kcmartin kcmartin commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

New page on letting an agent buy prepaid credit for an org with MPP and Link CLI: endpoint, the three Link CLI steps, response codes. Linked from the billing page.

Tracking: https://github.com/superfly/docs-tracking/issues/397

@mintlify

mintlify Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
fly-io 🟢 Ready View Preview Nov 18, 2026, 5:52 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@mlr mlr 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.

These steps work, but you can skip the first two. If you leave out --spend-request-id, link-cli mpp pay reads the 402 itself and creates the spend request with the right network ID and amount. So it can be one command:

link-cli mpp pay https://fly.io/api/v1/mpp/credits
--data '{"org_slug": "personal", "amount": "25"}'
--header "Authorization: $FLY_API_TOKEN"
--context "Add $25 of prepaid credit to my Fly.io personal organization. One-time charge of 25 USD."

It comes back with pending_approval, an approval_url and a _next.pay_command. You approve in the Link app, then run the pay command. Agents do that part on their own.

A few smaller things:

  • --data already makes it a POST with a JSON content type, so you don't need --method or a Content-Type header.
  • The 30 minute approval window is the only limit. The pay step gets a new challenge, so the 10 minute challenge expiry doesn't come into it.
  • I'd add link-cli auth login to "Before you start", since you have to connect the CLI to Link once.
  • A 401 also comes back for an expired token, which people will run into with --expiry 1h.
  • In the agent prompt you can drop "create a shared_payment_token spend request, then".
  • You're right about the exit status. It exits 0 whatever Fly returns.

@kcmartin

Copy link
Copy Markdown
Contributor Author

Thanks @mlr, applied in 7f8425f: one link-cli mpp pay command, auth login in Before you start, expired-token 401, simpler prompt. I made the example --context longer, since Link CLI's README says it needs 100 characters.

@kcmartin
kcmartin marked this pull request as ready for review November 17, 2026 22:41
@kcmartin
kcmartin requested a review from a team as a code owner November 17, 2026 22:41
@kcmartin
kcmartin requested a review from mlr November 17, 2026 22:41
@kcmartin
kcmartin merged commit c48c040 into main Nov 18, 2026
2 checks passed
@kcmartin
kcmartin deleted the mpp-credits branch November 18, 2026 17:53

This branch was successfully deployed

1 active deployment
staging — fa6102ac Deployed Nov 18, 2026 by mintlify[bot]
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