Skip to content

Commit f4be9b0

Browse files
alexrischampagent
andauthored
Document MPP credits skill flow (#496)
Co-authored-by: Amp <amp@ampcode.com>
1 parent 524ecba commit f4be9b0

1 file changed

Lines changed: 32 additions & 2 deletions

File tree

SKILL.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ Provide:
3333

3434
- Installation location and version (`$HOME/.tempo/bin/tempo --version`).
3535
- Wallet status from `tempo wallet -t whoami` (address and balance; include key/network fields when present).
36-
- If balance is 0, direct user to `tempo wallet fund` or the wallet dashboard to add funds.
36+
- If token balance is 0, direct user to `tempo wallet fund` or the wallet dashboard to add funds.
37+
- To check MPP Credits separately, run `tempo wallet -t whoami --credits`.
3738
- If the user is on another device than the CLI host, use `tempo wallet fund --no-browser` and hand the fund URL back directly instead of trying to open a browser locally.
3839
- After the user funds the wallet, ask them to message back before continuing.
3940
- 2-3 simple starter prompts tailored to currently available services.
@@ -63,6 +64,7 @@ tempo request -t -X POST --json '{"input":"..."}' <SERVICE_URL>/<ENDPOINT_PATH>
6364

6465
- Select `SERVICE_ID` from search results that best matches user intent. When multiple match: prefer best semantic fit, then endpoint fit, then pricing clarity, then first in list.
6566
- **Anchor on `tempo wallet -t services <SERVICE_ID>`** — it shows the exact URL, method, path, and pricing for every endpoint. Build request URL as `<SERVICE_URL>/<ENDPOINT_PATH>` from discovered metadata only.
67+
- If service details include `supportsCredits: true`, MPP Credits may be used for one-time `tempo.charge` payments. Credits are separate from token balances; check them with `tempo wallet -t whoami --credits` and buy them with `tempo wallet fund --credits`.
6668
- If you get an HTTP 422, fall back to the endpoint's `docs` URL or the service's `llms.txt` for exact field names.
6769
- For multi-service workflows, fire independent requests in parallel to save time.
6870

@@ -77,12 +79,36 @@ tempo request -t -X POST --json '{"input":"..."}' <SERVICE_URL>/<ENDPOINT_PATH>
7779
tempo request -t -X GET <SERVICE_URL>/<ENDPOINT_PATH>
7880
```
7981

82+
### MPP Credits for One-Time Charges
83+
84+
Use MPP Credits only when service details show `supportsCredits: true` and the endpoint is a one-time `tempo.charge` payment, not a session-based payment.
85+
86+
```bash
87+
# Check/buy credits separately from token balance
88+
tempo wallet -t whoami --credits
89+
tempo wallet fund --credits
90+
91+
# First capture the MPP challenge without submitting token payment
92+
headers="$(mktemp)"
93+
tempo request -t --dry-run -D "$headers" -X POST --json '{"input":"..."}' <SERVICE_URL>/<ENDPOINT_PATH>
94+
95+
# Spend credits for that challenge. The wallet CLI parses the challenge and
96+
# builds the payment calldata; do not manually generate transfer calldata.
97+
tempo wallet -t transfer --credits --dry-run --mpp-challenge-file "$headers"
98+
tempo wallet -t transfer --credits --mpp-challenge-file "$headers"
99+
```
100+
101+
- `--mpp-challenge` accepts a raw `WWW-Authenticate` value or header line; `--mpp-challenge-file` accepts a file containing response headers.
102+
- Use `--mpp-client-id <id>` on `tempo wallet transfer --credits` only when the caller needs a custom MPP attribution memo.
103+
- If the human is on another device than the CLI host, use `tempo wallet fund --credits --no-browser` and hand the fund URL back directly.
104+
- If the service still needs a follow-up request after the credits redeem transaction, do not invent unsupported `tempo request` flags; report the redeem transaction hash and the service response clearly.
105+
80106
### Response Handling
81107

82108
- Return result payload to user directly when request succeeds.
83109
- If response contains a file URL (e.g., image generation), download it locally: `curl -fsSL "<url>" -o <filename>`.
84110
- If response is a usage/auth readiness error, run `tempo wallet login` and retry once.
85-
- If response indicates payment/funding limit issues, report clearly and stop.
111+
- If response indicates payment/funding limit issues, report clearly and stop. For token funding use `tempo wallet fund`; for MPP Credits use `tempo wallet fund --credits` only when service details show `supportsCredits: true`.
86112
- After multi-request workflows, check remaining balance with `tempo wallet -t whoami`.
87113

88114
## Wallet-Backed Cards
@@ -121,6 +147,10 @@ Pointers:
121147
| `ready=false` or `No wallet configured` | Wallet not logged in | Run `tempo wallet login`, wait for user completion, then rerun `tempo wallet -t whoami`. |
122148
| HTTP 422 on first request to a service | Wrong request schema — field names vary across services | Check `tempo wallet -t services <SERVICE_ID>` for endpoint details, then fetch the endpoint's `docs` URL or the service's `llms.txt` for exact field names and types. |
123149
| Balance is 0, insufficient funds, or spending limit exceeded | Wallet needs funding or limit hit | Run `tempo wallet fund` or direct user to the wallet dashboard. Report clearly and stop if limit is exceeded. |
150+
| Token balance is 0 but MPP Credits may be available | Credits are separate from token balances | Run `tempo wallet -t whoami --credits`. If the service shows `supportsCredits: true`, credits can be used for one-time charge payments. |
151+
| Need to buy MPP Credits | User wants to fund with card-based credits for eligible services | Run `tempo wallet fund --credits`, complete checkout in the wallet app, then recheck with `tempo wallet -t whoami --credits`. |
152+
| Credits are not accepted by a service | MPP Credits only work for eligible Tempo-proxied services | Inspect `tempo wallet -t services <SERVICE_ID>` and use credits only when `supportsCredits: true` is present. Otherwise use token funding with `tempo wallet fund`. |
153+
| Service uses sessions | MPP Credits currently support one-time charges, not sessions | Use token funding for session-based services. |
124154
| Service not found for query | Search terms too narrow | Broaden search terms with `tempo wallet -t services --search <broader_query>`, then inspect candidate details. |
125155
| Endpoint returns usage/path error | Wrong URL or method | Re-open service details with `tempo wallet -t services <SERVICE_ID>` and use discovered method/path exactly. |
126156
| Timeout/network error | Network issue or slow endpoint | Retry request and optionally increase timeout with `-m <seconds>`. |

0 commit comments

Comments
 (0)