telnyx-ai-assistants-c…
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
Add credit to a Telnyx account through Machine Payment Protocol (MPP) using Stripe Link or Tempo USDC, then verify the transaction and balance.
$ npx -y skills add team-telnyx/ai --skill telnyx-mpp-payment --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/telnyx-mpp-paymentContext preview
The summary Claude sees to decide when to auto-load this skill.
Add credit to a Telnyx account through Machine Payment Protocol (MPP) using Stripe Link or Tempo USDC, then verify the transaction and balance.
name: telnyx-mpp-payment
description: >-
Add credit to a Telnyx account through Machine Payment Protocol (MPP)
using Stripe Link or Tempo USDC, then verify the transaction and balance.
metadata:
author: telnyx
product: payments
requires:
bins:
- curl
- node
- npm
- npx
env:
- TELNYX_API_KEYUse Machine Payment Protocol (MPP) to add USD credit to your Telnyx account. You can pay with a Stripe Link agent wallet backed by an eligible card, or with USDC from a funded Tempo wallet.
Use this skill when you want to add Telnyx account credit through an HTTP `402 Payment Required` flow using Stripe Link or Tempo USDC. It guides you through setup, payment approval, the paid retry, status checks, and safe support handoff.
All Telnyx MPP account-credit payments use this endpoint:
https://api.telnyx.com/v2/machine-payments/account-credit
The first request returns HTTP `402 Payment Required`. This is an expected part of the payment flow. Link CLI or `mppx` reads the challenge, pays it, and retries the request with proof of payment. Telnyx credits the account that owns the API key used for the first request.
You need Node.js, npm, `curl`, and a Telnyx API key. Link payments use `@stripe/link-cli@0.11.0`. Tempo payments use `mppx` and a funded Tempo wallet.
| Variable | Required | Description | |---|---|---| | `TELNYX_API_KEY` | Yes | API key for the Telnyx account that will receive the credit | | `MPP_AMOUNT_USD` | Yes | Positive USD amount with no more than two decimal places | | `MPP_ENDPOINT` | Yes | Telnyx MPP account-credit endpoint shown below | | `LINK_PAYMENT_METHOD_ID` | Link only | Eligible Link card payment-method ID | | `LINK_NETWORK_ID` | Link only | Network ID decoded from the current payment challenge | | `LINK_SPEND_REQUEST_ID` | Link only | Approved, one-time Link spend-request ID | | `TELNYX_TRANSACTION_ID` | Status check only | Transaction ID returned by a completed payment |
Keep the API key in your shell environment rather than putting it directly in a command or file:
export TELNYX_API_KEY='KEYxxxxx' export MPP_AMOUNT_USD='12.00' export MPP_ENDPOINT='https://api.telnyx.com/v2/machine-payments/account-credit'
npx --yes @stripe/link-cli@0.11.0 auth login \ --client-name 'Telnyx MPP payer' \ --timeout 600
Open the URL shown by the CLI, confirm the phrase, and approve access. Check that the sign-in completed:
npx --yes @stripe/link-cli@0.11.0 auth status
npx --yes @stripe/link-cli@0.11.0 payment-methods list --format json
Choose a card marked as eligible for agentic payments. Link accepts eligible cards in supported regions — currently cards issued in the United States or Canada.
export LINK_PAYMENT_METHOD_ID='<csmrpd-id>'
Save the response headers and body in private temporary files:
umask 077
CHALLENGE_HEADERS="$(mktemp /tmp/telnyx-mpp-headers.XXXXXX)"
CHALLENGE_BODY="$(mktemp /tmp/telnyx-mpp-body.XXXXXX)"
curl -sS \
--dump-header "$CHALLENGE_HEADERS" \
--output "$CHALLENGE_BODY" \
--write-out '%{http_code}\n' \
-X POST "$MPP_ENDPOINT" \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H 'Content-Type: application/json' \
--data "{\"amount_usd\":\"$MPP_AMOUNT_USD\"}"The response should be HTTP `402`. Find the Stripe `WWW-Authenticate: Payment ...` header and decode it:
npx --yes @stripe/link-cli@0.11.0 mpp decode \ --challenge '<complete Stripe Payment challenge header value>'
Copy `methodDetails.networkId` from the decoded challenge:
export LINK_NETWORK_ID='<networkId-from-current-challenge>'
Always use the value from the current challenge. Save the `X-Request-Id` response header as well; Telnyx Support can use it to trace this request. Keep the full challenge private because it contains the account and amount for the payment.
Link expects the amount in cents. Convert `MPP_AMOUNT_USD` to cents and use that integer for `--amount`.
npx --yes @stripe/link-cli@0.11.0 spend-request create \ --payment-method-id "$LINK_PAYMENT_METHOD_ID" \ --credential-type shared_payment_token \ --network-id "$LINK_NETWORK_ID" \ --amount '<amount-in-cents>' \ --currency usd \ --context 'Authorize one card payment to add the specified USD credit to my Telnyx account through Machine Payment Protocol using Stripe Link.' \ --request-approval
Open the approval URL and check the card and amount before clicking **Approve**. Save the spend-request ID and retrieve it until its status is `approved`:
export LINK_SPEND_REQUEST_ID='<lsrq-id>' npx --yes @stripe/link-cli@0.11.0 spend-request retrieve "$LINK_SPEND_REQUEST_ID"
Each spend request can be used once. Create and a
This repo is the one-stop shop for AI Agents and AI-first developers building with Telnyx — everything an agent needs to build production-grade applications and manage its account, from signup to funding.
Repo: team-telnyx/ai
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.