Current collected state Current
Observed since 21 Oct, 11:15 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
aimarket-streaming
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.
| Package / target | Requirement | Relationship |
|---|---|---|
aimarket-hubEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.11",
"evaluation": "NOT_EVALUATED"
} | aimarket-hub>=2.0.0 | runtime |
pytestEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.11",
"evaluation": "NOT_EVALUATED"
} | pytest>=8; extra == "dev" | runtime |
bdist_wheel · 4.55 KB · Python py3
sdist · 4.14 KB · Python source
Observed since 21 Oct, 11:15 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:4a2c6f87bcddcf41fbc2c288e4e19f0251e4cd38366a55b0aeea833e427adb92