AI Gateway

The Orq AI Gateway is a powerful tool that enables you to access models from OpenAI, Anthropic, Google, AWS, and third-party inference providers using an Unified API.

What is the AI Gateway?

Orq.ai AI Gateway is a unified gateway that provides seamless access to 15+ AI providers through a single, standardized API. The AI Gateway eliminates vendor lock-in and simplifies AI integration across your applications.

It is built for companies delivering AI-powered applications who need reliable, scalable access to multiple AI providers.

👍

Key Benefits

  • Unified Interface: One API for OpenAI, Anthropic, Google AI, AWS Bedrock, and 10+ more providers
  • Intelligent Routing: Automatic provider selection based on model availability and performance
  • Built-in Reliability: Automatic retries, fallbacks, and error handling with provider-specific optimizations
  • Cost Optimization: Smart routing to minimize costs while maximizing performance
  • Real-time Monitoring: Complete observability with metrics, tracing, and analytics

Supported Model Types

TypeDescriptionStreamingProviders
Chat CompletionsConversational AI with message historyAll text providers
Text CompletionsSingle-turn text generationOpenAI, compatible providers
EmbeddingsVector representations for RAGOpenAI, Jina, Cohere
Image GenerationAI-powered image creationFal, LeonardoAI, OpenAI
Image EditingModify existing imagesOpenAI, LeonardoAI
VisionAnalyze images and answer questionsOpenAI, Anthropic, Google
Speech-to-TextTranscription and translationOpenAI, AWS
Text-to-SpeechHigh-quality audio generationElevenLabs, OpenAI
ModerationContent safety and complianceOpenAI
RerankingOptimize search resultsJina, Cohere
📘

To learn more about supported models, see Supported Models.

Quick Start

Basic Chat Completion

curl -X POST https://api.orq.ai/v2/proxy/chat/completions \
  -H "Authorization: Bearer $ORQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4",
    "messages": [{"role": "user", "content": "Hello, world!"}]
  }'

Streaming Response

curl -X POST https://api.orq.ai/v2/proxy/chat/completions \
  -H "Authorization: Bearer $ORQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4",
    "messages": [{"role": "user", "content": "Tell me a story"}],
    "stream": true
  }'

Multi-Provider Fallback

curl -X POST https://api.orq.ai/v2/proxy/chat/completions \
  -H "Authorization: Bearer $ORQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": ["gpt-4", "claude-3-5-sonnet-20241022", "gemini-1.5-pro"],
    "messages": [{"role": "user", "content": "Analyze this data"}]
  }'

Getting Started

Essential information for integrating with the AI Gateway:

Advanced Features

Explore the AI Gateway's comprehensive feature set designed for production AI applications:

Streaming

Real-time streaming responses for chat completions and text generation across all providers.

Tool Calling

Enable AI models to call external functions with structured parameters and automatic validation.

Fallbacks

Automatic provider fallback strategies for improved reliability and availability.

Retries & Error Handling

Advanced retry strategies with exponential backoff and provider-specific error handling.

Structured Outputs

Generate JSON and structured data with guaranteed schema compliance.

Vision & Multimodal

Analyze images alongside text for multimodal AI interactions with support for multiple formats and streaming.

Caching

Intelligent response caching system for reduced latency and cost optimization.

Load Balancing

Intelligent load distribution across multiple providers for optimal performance.

Timeouts

Intelligent timeout management with automatic handling and graceful degradation.

Using Prompts

Leverage pre-created prompts from Orq.ai for consistent, version-controlled prompt management.

Thread Management

Organize and track multi-turn conversations with comprehensive conversation analysis.

Reasoning Models

Advanced reasoning capabilities with chain-of-thought and transparent thinking processes.

App Tracking

Track and identify AI requests from specific applications for better monitoring.

Contact Tracking

Associate requests with contact identifiers for user-level observability and analytics.

Dynamic Inputs

Replace variables in prompts using dynamic inputs for personalized responses.

PDF Input

Process PDF documents for text extraction and analysis across multiple providers.