AI Gateway
Overview
Use Azure AI Inference SDK to route all model calls through Orq.ai’s AI Gateway. PointChatCompletionsClient at Orq’s endpoint to access 300+ models from 20+ providers OpenAI, Anthropic, Google, and more without changing any agent logic.
Key Benefits
Complete Observability
Track every agent step, tool use, and LLM call with detailed traces and analytics
Built-in Reliability
Automatic fallbacks, retries, and load balancing for production resilience
Cost Optimization
Real-time cost tracking and spend management across all AI operations
Multi-Provider Access
Access 300+ LLMs and 20+ providers through a single, unified integration
Prerequisites
- An Orq.ai account and API Key
- Python 3.9 or higher
To set up an API key, see API keys & Endpoints.
Installation
Configuration
ConfigureChatCompletionsClient to point at Orq.ai’s AI Gateway:
Python
endpoint: https://api.orq.ai/v3/router
Basic Example
Python
Agent with Function Tools
ChatCompletionsClient supports multi-turn tool calling. The agent loop runs until no more tool calls are returned:
Python
Model Selection
Switch models by changing themodel parameter. All 300+ models are available through the same client:
Python