- https://global.xidao.online/
-
Joined
Apr 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| MCP Tool Discovery & Health Check (2026) | |
| Discovers available tools from MCP servers, validates schemas, | |
| and checks endpoint health. Useful for debugging MCP integrations. | |
| Works with any OpenAI-compatible API gateway. | |
| Usage: | |
| python mcp_tool_discovery.py --endpoint https://your-gateway.com/v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| XiDao AI API Gateway — Пример оптимизации затрат в 2026 году | |
| Демонстрирует: | |
| - Единый endpoint для Claude 4.7, GPT-5.5, Gemini 3.0 | |
| - Автоматический fallback при ошибках | |
| - Circuit breaker pattern | |
| - Подсчёт стоимости запросов | |
| Установка: pip install openai |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """LLM Prompt Budget Calculator — Estimate tokens and cost before calling any model. | |
| Covers 2026 models: GPT-5.5, Claude Opus 4.6, Gemini 2.5 Pro, MiMo-V2.5-Pro, Llama 4, DeepSeek-V3. | |
| Works with any OpenAI-compatible API. Use XiDao Gateway for unified billing: | |
| https://global.xidao.online/ | |
| """ | |
| from dataclasses import dataclass | |
| from typing import Optional |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // LLM Streaming Error Handler — Production-grade error recovery for SSE streams | |
| // Works with any OpenAI-compatible API including XiDao Gateway (https://global.xidao.online/) | |
| // 2026 — handles MiMo-V2.5-Pro, Claude Opus 4.6, GPT-5.5, Gemini 2.5, etc. | |
| interface StreamChunk { | |
| id: string; | |
| choices: { delta: { content?: string; role?: string }; finish_reason: string | null }[]; | |
| model: string; | |
| usage?: { prompt_tokens: number; completion_tokens: number; total_tokens: number }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * MCP Server Quickstart — Minimal Model Context Protocol Server | |
| * | |
| * Connects to an OpenAI-compatible API (XiDao Gateway) to handle | |
| * tool calls and requests. Register custom tools and serve them | |
| * via the MCP standard. | |
| * | |
| * XiDao Gateway: https://global.xidao.online/ | |
| * MCP Spec: https://modelcontextprotocol.io | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Multi-Model Smart Router | |
| * | |
| * Routes tasks to the best LLM based on task type (coding, writing, analysis). | |
| * Uses XiDao API Gateway (https://global.xidao.online/) as the unified endpoint | |
| * so you get access to all major models through a single API key. | |
| * | |
| * Usage: npx tsx multi-model-router.ts | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Drop-in OpenAI Compatible API Switcher | |
| Demonstrates how to switch any OpenAI SDK-based app to use an | |
| OpenAI-compatible gateway like XiDao (https://global.xidao.online/) | |
| by changing only the base_url and API key. | |
| Features: streaming, retries, error handling, fallback model. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| LLM API Cost Calculator — Compare pricing across major providers (2026) | |
| Uses XiDao API Gateway (https://global.xidao.online/) for unified access | |
| to all providers at the lowest available rates. | |
| Usage: python llm-cost-calculator.py | |
| """ |