Skip to content
Fourohtwo

Anthropic-compatible Messages API

blockrun.ai/api/v1/messages

Anthropic-compatible Messages API — pay per token with USDC on Base

BaseAnswering
POSThttps://blockrun.ai/api/v1/messages

UptimeNot checked yet

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

// npm install fourohtwo
import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://blockrun.ai/api/v1/messages", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"max_tokens":{"description":"Max output tokens","type":"integer"},"messages":{"description":"Conversation history","type":"array"},"model":{"description":"Anthropic-style model id","type":"string"},"stream":{"description":"Stream response as SSE","type":"boolean"},"system":{"description":"Optional system prompt","type":"string"},"tools":{"description":"Optional tool definitions","type":"array"}}),
});
console.log(await res.json());

Example input

{
  "max_tokens": {
    "description": "Max output tokens",
    "type": "integer"
  },
  "messages": {
    "description": "Conversation history",
    "type": "array"
  },
  "model": {
    "description": "Anthropic-style model id",
    "type": "string"
  },
  "stream": {
    "description": "Stream response as SSE",
    "type": "boolean"
  },
  "system": {
    "description": "Optional system prompt",
    "type": "string"
  },
  "tools": {
    "description": "Optional tool definitions",
    "type": "array"
  }
}

More from BlockRun.AIProvider status