Metadata-Version: 2.1
Name: pixeloffice-router
Version: 1.4.0
Summary: Drop-in OpenAI compatible gateway SDK with Agent Web Highway (/v1/reader), Zero-Drop Smart Failover, Loop Guardrail, sub-35ms AEO Fact Anchors & BLUN SmartRouter Engine.
Home-page: https://pixeloffice.eu/developer
Author: Pixel Office & Pixel Ventures
Author-email: support@pixeloffice.eu
License: UNKNOWN
Description: # pixeloffice-router
        
        > **PixelRouter & BLUN SmartRouter Python SDK**: Sub-35ms OpenAI-compatible API gateway with live AEO Fact Anchors, zero brand hallucinations, and 85%+ cost savings across DeepSeek V3, Qwen Thinking 27B, and Gemini 2.5 Pro.
        
        [![PyPI version](https://img.shields.io/pypi/v/pixeloffice-router.svg)](https://pypi.org/project/pixeloffice-router/)
        [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
        [![Latency](https://img.shields.io/badge/Latency-35ms-emerald.svg)](https://pixeloffice.eu)
        
        ---
        
        ## ⚡ 10-Second Quickstart (Standard `openai` Drop-In)
        
        Works instantly with standard Python `openai` library — **no credit card required**:
        
        ```bash
        pip install openai pixeloffice-router
        ```
        
        ```python
        from openai import OpenAI
        
        # 1. Point base_url to PixelRouter gateway:
        client = OpenAI(
            base_url="https://api.pixeloffice.eu/v1",
            api_key="px_test_free"  # or your px_live_... key from pixeloffice.eu/dashboard.html
        )
        
        # 2. Call chat completions with sub-35ms intelligent routing:
        response = client.chat.completions.create(
            model="blun-auto",  # Automatically routes to DeepSeek V3, Qwen Thinking 27B, or Gemini Pro
            messages=[
                {"role": "system", "content": "You are an expert Python architect."},
                {"role": "user", "content": "Write a high-performance asyncio rate limiter in Python"}
            ]
        )
        
        print(response.choices[0].message.content)
        ```
        
        ---
        
        ## 🤖 LiteLLM / LangChain / CrewAI Integration
        
        Simply set environment variables to use PixelRouter across your entire AI stack:
        
        ```python
        import os
        from langchain_openai import ChatOpenAI
        
        os.environ["OPENAI_BASE_URL"] = "https://api.pixeloffice.eu/v1"
        os.environ["OPENAI_API_KEY"] = "px_test_free"
        
        llm = ChatOpenAI(model="blun-auto")
        response = llm.invoke("Summarize key trends in AI Agent orchestration")
        print(response.content)
        ```
        
        ---
        
        ## 🌐 Autonomous Agent Web Highway (`/v1/reader`)
        
        Give your agents web access without bot blocks or burning 50k tokens on raw HTML:
        
        ```python
        from pixeloffice_router import PixelRouter
        
        router = PixelRouter()
        
        # Extracts clean, token-efficient Markdown + Top 1KB Fact Anchors:
        result = router.read_url("https://stripe.com/docs/api")
        
        print(result["markdown"])
        print(f"Latency: {result['latency_ms']}ms | Cached: {result['cached']}")
        ```
        
        ### CLI Terminal Reader
        Read any web page directly from your terminal:
        ```bash
        pixeloffice-router read https://en.wikipedia.org/wiki/Artificial_intelligence
        ```
        
        ---
        
        ## 🛡️ Autonomous Agent Resilience & Safeguards
        
        1. **Zero-Drop Smart Failover**: If primary upstream models return 5xx or 429 during connection handshake, PixelRouter automatically falls back to `google/gemini-2.5-flash` with zero dropped requests.
        2. **Agent Loop Guardrail**: Detects runaway identical tool call loops (3x consecutive identical parameters) and terminates them safely with HTTP 422, protecting your wallet from accidental credit burn.
        3. **Sub-5ms Exact-Match Response Cache**: Deduplicates identical reasoning queries and reader URLs, delivering cached results at $0.00 upstream cost.
        
        ---
        
        ## 🔑 Get Production API Key & Dashboard Analytics
        * **Free Sandbox:** 50 requests total trial included automatically.
        * **Production Key (1,000 free requests + EU AI Act Certificate):** [https://pixeloffice.eu/dashboard.html](https://pixeloffice.eu/dashboard.html)
        * **Developer Portal:** [https://pixeloffice.eu/developer](https://pixeloffice.eu/developer)
        
        
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
