Skip to main content

Drop-in Anthropic & OpenAI Python SDK clients for BlockRun — genuine native passthrough (real signatures, system_fingerprint, native structure) with x402 USDC micropayments on Base. No model substitution, no response reshaping.

Project description

blockrun-llm-vip

Genuine native passthrough for Anthropic and OpenAI through the BlockRun gateway — pay per call in USDC (x402) on Base, with zero model substitution and zero response reshaping.

Unlike a normal aggregator, these clients subclass the official anthropic and openai Python SDKs and only swap the transport (to add x402 payment) and the base URL. The gateway returns the upstream provider's response verbatim, so the official SDK parses the real signals:

  • Claude: real thinking-block signature, native content[] (text / thinking / tool_use), usage.cache_creation_input_tokens / cache_read_input_tokens, native signature_delta streaming — routed to Anthropic's native /v1/messages.
  • GPT: native id (chatcmpl-*), system_fingerprint, usage.*_tokens_details, honest response_format (JSON mode) + stop + nested errors. gpt-4o / gpt-4o-mini are served OpenAI-direct.

A Claude / OpenAI relay detector (e.g. cctest.ai) sees a direct upstream call.

Install

pip install blockrun-llm-vip

Use — it's a drop-in

from blockrun_llm_vip import Anthropic, OpenAI

# Claude — exactly the official anthropic SDK API
claude = Anthropic()                      # wallet auto-loaded from ~/.blockrun/.session
r = claude.messages.create(
    model="claude-sonnet-4.6",
    max_tokens=2048,
    thinking={"type": "enabled", "budget_tokens": 1024},
    messages=[{"role": "user", "content": "What is 23*47?"}],
)
for block in r.content:
    if block.type == "thinking":
        print("signature:", block.signature)   # real Anthropic signature

# GPT — exactly the official openai SDK API
gpt = OpenAI()
r = gpt.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "hi"}],
)
print(r.system_fingerprint, r.model)        # genuine OpenAI direct

Async: from blockrun_llm_vip import AsyncAnthropic, AsyncOpenAI.

Video — Seedance, incl. real-person (RealFace)

Generate short videos through the gateway with ByteDance Seedance. Video.generate() runs the async submit→poll loop for you (x402-paid both legs by the same wallet) and returns the gateway's verbatim completed-job JSON — data[0].url is a permanent BlockRun-hosted MP4. Defaults to bytedance/seedance-2.0-fast.

from blockrun_llm_vip import Video

video = Video()
job = video.generate(
    "a neon-lit cyberpunk street, slow dolly forward",
    duration_seconds=5,
    aspect_ratio="16:9",
)
print(job["data"][0]["url"])          # permanent MP4 URL

Real person — enroll a face once via RealFace (one-time $0.01, ~1-min on-phone liveness, no KYC), then pass its ta_xxxx as real_face_asset_id on Seedance 2.0 / 2.0-fast to keep the same person across clips:

from blockrun_llm_vip import Video, RealFace

rf = RealFace()
started = rf.init("Spokesperson — Q3 campaign")
print("Open on the rights-holder's phone:", started["h5_link"])   # QR / mobile link
rf.wait_until_active(started["group_id"])                         # after they nod + blink
asset = rf.enroll(
    name="Spokesperson — Q3 campaign",
    image_url="https://example.com/person.jpg",
    group_id=started["group_id"],
)

video = Video()
job = video.generate(
    "she smiles warmly and waves at the camera in soft studio light",
    model="bytedance/seedance-2.0",
    real_face_asset_id=asset["asset_id"],   # ta_xxxx
)
print(job["data"][0]["url"], job["payment"]["tx_hash"])

real_face_asset_id is mutually exclusive with image_url and only works on Seedance 2.0 / 2.0-fast. Other generate() options: resolution, generate_audio, seed, watermark, return_last_frame, plus timeout / poll_interval for the poll loop.

AI character (mascot / avatar, no liveness) — enroll a Virtual Portrait instead of a RealFace; same ta_xxxxreal_face_asset_id flow:

from blockrun_llm_vip import VirtualPortrait

vp = VirtualPortrait()
asset = vp.enroll(name="Mascot", image_url="https://example.com/character.jpg")  # $0.01
# pass asset["asset_id"] as real_face_asset_id on Seedance 2.0 / 2.0-fast

List what a wallet has enrolled: RealFace().list() / VirtualPortrait().list() (free). Async: AsyncVideo, AsyncRealFace, AsyncVirtualPortrait.

Wallet

The private key is used only for local EIP-712 signing and never leaves your machine. Resolution: private_key= arg → BLOCKRUN_WALLET_KEY env → BASE_CHAIN_WALLET_KEY env → ~/.blockrun/.session.

Access

Give BlockRun your wallet address to enable VIP, then pay per call from that wallet.

Contact: vicky@blockrun.ai

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blockrun_llm_vip-0.2.1.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blockrun_llm_vip-0.2.1-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file blockrun_llm_vip-0.2.1.tar.gz.

File metadata

  • Download URL: blockrun_llm_vip-0.2.1.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for blockrun_llm_vip-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a4315d04d5c7779d097ebc7dd0b6bb9ded5c8d522a54790f40f254e3550502d8
MD5 f6b2ee3972a576557aafb1cbdc31c6cb
BLAKE2b-256 0e03464bd3259c6f7309d5fbe894b53a54e68140234692f3f43f538a093d90d9

See more details on using hashes here.

File details

Details for the file blockrun_llm_vip-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for blockrun_llm_vip-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 96b9b299b19a0c911c634128141f00b0b60534f6ddf21526942d2adb14279eff
MD5 dc3c0dfd4731ac855a3842a2c6371956
BLAKE2b-256 7a11223bb22e62a912f7d981a0e62044e1e1c185430417022f6bcee20f1d288d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page