Metadata-Version: 2.1
Name: pixeloffice-router
Version: 1.6.0
Summary: Drop-in OpenAI & Anthropic compatible gateway SDK with OpenAI GPT-6 Astra (1.05M Context & Computer-Use), Failover Schema Assurance, Agent Web Highway (/v1/reader), Zero-Drop Smart Failover & 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 OpenAI GPT-6 Astra (1.05M Context & Computer-Use), Claude Fable 5.1, DeepSeek V4 Pro, and DeepSeek V4 Flash.
        
        [![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 optimal model, or use "gpt-6-astra" ($5/$25 flex)
            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)
        ```
        
        ### 🟣 Ultra-Frontier Foundation (Paid Key / $10 Top-Up)
        * **`gpt-6-astra`** (`openai/gpt-6-astra:flex`): OpenAI GPT-6 Astra with 1.05M Context, Computer-Use & -50% Cost Savings ($5.00 / $25.00 per 1M, cache read $0.50).
        * **`claude-fable-5.1`**: Anthropic #1 SOTA Multi-Day Autonomous Agent Model (1M Context).
        * **`deepseek-v4-pro`**: 1.6T Parameter MoE Deep Reasoning (1M Context).
        * 🛡️ **272k Surcharge Protection**: Transparent tracking via `X-PixelRouter-Context-Surcharge` header.
        * 👉 Top up balance: [https://pixeloffice.eu/router.html?action=topup](https://pixeloffice.eu/router.html?action=topup)
        
        ---
        
        ## 🤖 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
