You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8c38fb3
Browse filesBrowse the repository at this point in the historyBrowse files
1bcMax
committed
docs: add streaming section, update intro and FAQ for v1.6.1
Copy file name to clipboardExpand all lines: README.md
+82-1Lines changed: 82 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# @blockrun/llm (TypeScript SDK)
2
2
3
-
> **@blockrun/llm** is a TypeScript/Node.js SDK for accessing 40+ large language models (GPT-5, Claude, Gemini, Grok, DeepSeek, Kimi, and more) with automatic pay-per-request USDC micropayments via the x402 protocol. No API keys required — your wallet signature is your authentication. Supports Base and Solana chains.
3
+
> **@blockrun/llm** is a TypeScript/Node.js SDK for accessing 41+ large language models (GPT-5, Claude, Gemini, Grok, DeepSeek, Kimi, and more) with automatic pay-per-request USDC micropayments via the x402 protocol. No API keys required — your wallet signature is your authentication. Supports**streaming**, smart routing, Base and Solana chains.
@@ -462,6 +462,74 @@ const result = await client.chatCompletion('openai/gpt-4o', messages);
462
462
console.log(result.choices[0].message.content);
463
463
```
464
464
465
+
### Streaming
466
+
467
+
Stream responses token-by-token with automatic x402 payment. Uses a **pre-auth cache** to skip the 402 round-trip on repeat calls to the same model (~200ms saved per request after the first).
@@ -862,6 +940,9 @@ When you make an API call, the SDK automatically handles x402 payment. It signs
862
940
### What is smart routing / ClawRouter?
863
941
ClawRouter is a built-in smart routing engine that analyzes your request across 14 dimensions and automatically picks the cheapest model capable of handling it. Routing happens locally in under 1ms. It can save up to 78% on LLM costs compared to using premium models for every request.
864
942
943
+
### Does it support streaming?
944
+
Yes — as of v1.6.1. Use `client.chatCompletionStream()` for native streaming or `stream: true` in the OpenAI-compatible client. Payment is handled automatically: the SDK signs USDC payment before streaming begins, and caches payment requirements per model so subsequent calls skip the 402 round-trip (~200ms faster).
945
+
865
946
### How much does it cost?
866
947
Pay only for what you use. Prices start at $0.0002 per request (GPT-5 Nano). There are no minimums, subscriptions, or monthly fees. $5 in USDC gets you thousands of requests.
0 commit comments