Integration Flow
The diagram below shows how a completions request flows from your application through the Michi Gateway.API Keys and Scopes
To isolate analytics and enforce strict budget splits across different systems, Michi supports three distinct API Key classifications:Developer Keys
Assigned to human developers for building and local testing. Ideal for dev environments.
Application Keys
Bound to backend microservices and production environments. Optimized for high-throughput pipelines.
AI Agent Keys
Assigned to autonomous systems, background tasks, or AI agents that perform loops.
Language Integrations
Michi fits directly into your existing OpenAI SDK setup. Simply change thebaseURL (or base_url) to https://api.michiai.co and provide your Michi API Key.
💻 Javascript / Node.js
🐍 Python
🐹 Go
🛠️ CLI / Curl
Dynamic Fallbacks
When you configure a Routing Policy in the dashboard, you specify a primary model and a sequence of fallback models. If the primary provider experiences rate limits (HTTP 429), timeouts, or service outages, the gateway automatically failovers and routes the request to the next backup model in your allowed chain. The client application receives a single, uninterrupted response.Budgets and Rate Limits
To prevent runaway costs from looping scripts or unauthorized key usage, policies let you enforce strict guards at the key level:- Daily and Monthly Budgets: Set spending thresholds in USD. Once a key reaches its limit, the gateway rejects subsequent requests with an HTTP 403 Forbidden error.
- TPM (Tokens-Per-Minute): Throttle maximum token throughput per minute to stay within provider limits.
- RPM (Requests-Per-Minute): Throttle request frequency to protect backend models from congestion.
