Current collected state Current
Observed since 21 Oct, 11:15 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
SSE/WS streaming + per-chunk billing with micro-receipts
| Document | Description |
|---|---|
| User guide | Install, configure, verify plugin is loaded |
| User cases | Personas and cross-plugin workflows |
| SDK integration | Code examples and hook behavior |
SSE/WS streaming + per-chunk billing with micro-receipts. Capability streams tokens. Every N tokens → signed micro-receipt. Consumer can cancel mid-stream — pays only for what was received. Channel balance debited incrementally.
pip install aimarket-streaming
from aimarket_hub.signing import Signer
from aimarket_streaming.streaming import StreamingBiller
signer = Signer()
biller = StreamingBiller(signer)
session = biller.open_session(
capability_id="text.generate@v1", product_id="prod-gpt",
channel_id="ch_abc123", price_per_token_usd=0.001,
tokens_per_chunk=10
)
async def token_stream():
for word in ["The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog", ".", "..."]:
yield word # In production: yield actual LLM tokens
import asyncio
async def main():
async for chunk in biller.stream_tokens(session, token_stream()):
print(f"Chunk {chunk['chunk_receipt']['chunk_index']}: "
f"${chunk['cumulative_price_usd']:.6f} "
f"({chunk['cumulative_tokens']} tokens)")
asyncio.run(main())
# Cancel mid-stream — pays only for received
result = biller.cancel_session(session.session_id)
print(f"Cancelled. Total paid: ${result['total_price_usd']:.6f}")
price_per_token_usd: 0.001 (0.1 cent per token)tokens_per_chunk: 10 (micro-receipt every 10 tokens)MIT · Maintained by AI-Factory
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 2.0.1 | 16 Oct 2026 | 2 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 11:15 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:3849933364f1f38317159ed8698605329f11bfa5cbfd95942194f00cacc37a4a