Skip to content

Conversation

@1bcMax
Copy link
Contributor

@1bcMax 1bcMax commented Jan 14, 2026

Summary

Adds BlockRun as a new AI provider option alongside OpenAI and Grok. BlockRun enables wallet-based pay-per-request AI access via x402 micropayments — no API keys required.

Key Benefits:

  • No API key management: Users bring their own Base chain wallet
  • Cost transparency: Pay exactly what you use with on-chain USDC micropayments
  • Privacy/self-custody: Private keys never leave the user's machine
  • Model variety: Access 20+ models including OpenAI, Anthropic Claude, xAI Grok, Google Gemini, DeepSeek

Changes

File Description
_shared/ai/callBlockRun.ts New BlockRun provider with x402 payment flow
_shared/ai/types.ts BlockRun type definitions
event-analysis-agent/index.ts BlockRun provider support
event-analysis-agent/types.ts paymentCost metadata field
.env.example BLOCKRUN_WALLET_KEY documentation

Usage

  1. Set BLOCKRUN_WALLET_KEY environment variable (Base chain private key, 0x-prefixed)
  2. Fund wallet with USDC on Base mainnet
  3. Use models like blockrun/gpt-4o, blockrun/claude-sonnet-4, blockrun/grok-3
// Example: Use Claude via BlockRun
const response = await fetch(edgeFunctionUrl, {
  method: "POST",
  body: JSON.stringify({
    markets: [...],
    eventIdentifier: "BTC-PRICE",
    pmType: "Polymarket",
    model: "blockrun/claude-sonnet-4", // or blockrun/gpt-4o, blockrun/grok-3
  }),
});

Available BlockRun Models

Model Provider
blockrun/gpt-4o, blockrun/gpt-4o-mini OpenAI
blockrun/claude-sonnet-4, blockrun/claude-opus-4 Anthropic
blockrun/grok-3, blockrun/grok-3-mini xAI
blockrun/gemini-2.5-pro, blockrun/gemini-2.5-flash Google
blockrun/deepseek-chat, blockrun/deepseek-reasoner DeepSeek

Test Plan

  • Type checking passes (deno check)
  • E2E test with GPT-4o-mini via x402 payment
  • E2E test with Grok-3-mini via x402 payment
  • Manual test in PredictOS UI with BlockRun model

Links

Adds BlockRun integration for wallet-based pay-per-request AI access.
No API keys required - users bring their own Base chain wallet.

Key benefits:
- No API key management
- Cost transparency with on-chain micropayments
- Privacy/self-custody (keys never leave user's machine)
- Access to 20+ models (OpenAI, Anthropic, xAI, Google, DeepSeek)

Usage:
- Set BLOCKRUN_WALLET_KEY (Base chain private key)
- Use models like "blockrun/gpt-4o", "blockrun/claude-sonnet-4"

Files changed:
- New: _shared/ai/callBlockRun.ts - BlockRun provider module
- Modified: _shared/ai/types.ts - BlockRun type definitions
- Modified: event-analysis-agent/index.ts - BlockRun provider support
- Modified: event-analysis-agent/types.ts - paymentCost metadata
- Modified: .env.example - BLOCKRUN_WALLET_KEY documentation
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