Skip to content

feat: add Prism Network action provider - #1474

Open
akimstacks wants to merge 1 commit into
coinbase:mainfrom
akimstacks:feat/prism-action-provider
Open

feat: add Prism Network action provider#1474
akimstacks wants to merge 1 commit into
coinbase:mainfrom
akimstacks:feat/prism-action-provider

Conversation

@akimstacks

@akimstacks akimstacks commented Sep 1, 2026

Copy link
Copy Markdown

Description

Adds a prism action provider for Prism Network: metered GPU compute an agent pays for per call with USDC on Base over x402. No account and no API key sits between the agent and the machine; the agent reads the price from the 402 response, pays from the wallet it already has, and gets the result in the same request.

Five actions, no new dependencies (the workspace already ships @x402/fetch and @x402/evm):

  • get_models (free): the models available for inference and their prices
  • run_inference (paid): text generation on a rented GPU
  • run_batch (paid): several prompts in one request, one payment, with a per-item audit path
  • run_gpu_command (paid): a shell command on a rented GPU
  • get_gpu_job (free): poll a submitted job

Prism prices inference by the token cap requested, so a large cap on a large batch is the one way an agent can spend more than it meant to. maxPaymentUsdc (default 1) drops any payment option quoted above the cap before the wallet signs anything. When no GPU is warm the paid endpoints answer with a retry notice and take no payment; the provider reports that as charged: false with the wait in seconds, and treats a 429 the same way, so an agent waits instead of reading a cold pool as a failure.

Tests

16 unit tests alongside the provider; the full typescript suite passes. Proven end to end on Base mainnet through the LangChain example:

Chatbot: typescript/examples/langchain-cdp-chatbot (ViemWalletProvider)
Network: base-mainnet
Setup: gpt-4o, wallet funded with USDC, no Prism account or API key

Prompt: What models can you run on Prism, and what do they cost?

The agent called get_models and listed the available models with their
per-call prices in USDC. No payment was made.

Prompt: Run this prompt on a GPU: "Write a haiku about settlement."

The agent called run_inference, paid over x402, and returned the
completion. Settled on chain in
https://basescan.org/tx/0x080b618555b6b217bb59e44badc22e0689c115638b3eb1254cafe194001a6bba

Prompt: Run these three prompts as one batch.

The agent called run_batch: one payment for the three items, answers
returned with a Merkle root and per-item audit paths. Settled in
https://basescan.org/tx/0x4cc961b9dcbdc9396e71d8f22c8a86d65c7d6ec4763c00a6962ed18cfdaae594

Each settlement was submitted by a different Coinbase facilitator address, which is the check that payment went through CDP rather than through Prism itself.

Gives an agent metered GPU compute on Prism Network, paid per call with
USDC on Base over x402. No account and no API key: the agent reads the
price from the 402 response, pays from the wallet it already has, and
gets the result in the same request.

Five actions: get_models and get_gpu_job are free, run_inference and
run_batch generate text on a rented GPU, and run_gpu_command runs a
shell command on one.

Prism prices inference by the token cap requested, so a large cap on a
large batch is the one way an agent can spend more than it meant to.
maxPaymentUsdc bounds that: any payment option quoted above the cap is
dropped before the wallet signs anything. It defaults to 1 USDC.

When no GPU is warm the paid endpoints answer with a retry notice and
take no payment. The provider reports that as charged: false with the
wait in seconds, so an agent waits instead of treating it as a failure.
A 429 reads as a cold pool too.
@cb-heimdall

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/2
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

@github-actions github-actions Bot added documentation Improvements or additions to documentation action provider New action provider typescript labels Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action provider New action provider documentation Improvements or additions to documentation typescript

Development

Successfully merging this pull request may close these issues.

2 participants