Repository navigation
Add page on buying credit with MPP - #2659
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
mlr
left a comment
There was a problem hiding this comment.
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.
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