What is the API Gateway?
The Omnifact API Gateway provides a unified API to access models from leading AI providers through a single endpoint. It allows your developers and internal applications to route requests to powerful AI models directly, without needing to set up separate accounts with different AI providers. Key benefits include:- One key, multiple providers: Access models from OpenAI, Anthropic, Google, Mistral AI, and more with a single API key.
- Drop-in replacement: Switch between providers and models with minimal code changes using existing OpenAI-compatible SDKs.
- Unified billing & observability: Monitor your spending and usage across all providers in one place. No credit card needed for separate providers.
- Runs on your existing budget: Consumes your organization’s existing AI budget, billed through your existing Omnifact contract.
Getting Started
The API Gateway is exclusively available for customers on the Enterprise Plan. See our Billing page or contact support to upgrade.
- Prerequisites: Ensure that API Gateway access has been enabled for your organization by Omnifact. (Note: If this feature is not enabled for your organization, any requests to the API will return a
403 Forbiddenerror.) - Opt-in: A team administrator must enable the Gateway in the Developer Tools section.
- Authentication: All requests to the API Gateway must include your API key (which can be generated in Team Settings > Developer Tools) in the
x-api-keyheader (or as a Bearer token if using OpenAI SDKs).
Available Models
You can query the available models using the standard OpenAI models endpoint. For detailed specifications of the endpoint parameters and response formats, please refer to the OpenAI API Reference.GET /v1/gateway/models
EU-Hosted Models
The API Gateway supports routing requests specifically to EU-hosted providers.- The
/v1/gateway/modelsendpoint may return both standard model IDs (e.g.,gpt-4o) and EU-specific model IDs (e.g.,eu/gpt-4o). - To enforce routing to an EU backend, prefix the model ID with
eu/in your request. Standard model IDs will route to non-EU backends only.
Chat Completions
The API Gateway provides drop-in compatible APIs that let you switch providers by simply changing your base URL tohttps://connect.omnifact.ai/v1/gateway. No code rewrites are required. You can use the same SDKs and tools you already know.
POST /v1/gateway/chat/completions
This endpoint accepts the standard OpenAI-compatible format and supports streaming, routing, custom temperatures, and more. (Note: Tool calling and structured outputs are not supported in V1).
- Node.js (OpenAI SDK)
- Python (OpenAI SDK)
- cURL
Request and Response Constraints
While the API Gateway is OpenAI-compatible, it enforces the following constraints:- Messages: The last message in the array must have the
userrole. Thesystemordeveloperroles are only permitted at the start of the message array. Thedeveloperrole is supported. - Content: Message content can be a string or an array of
{ type: "text", text: "..." }objects (arrays are flattened). - Limits: A maximum of 1024 messages per request, and up to 200,000 characters per message.
- Parameters: Supported parameters include
temperature(0–2, scaled per provider; some models may reject it),max_completion_tokens(ormax_tokens),stream, andstream_options.include_usage. - Response Model Field: The response returns the canonical model type, which may not necessarily match the requested ID (e.g., if you requested an
eu/...prefixed model or an alias).
Usage & Billing
Using the API Gateway consumes your organization’s monthly AI budget. This means you don’t need to manage separate billing for API usage. Please note that API Gateway usage includes a markup on top of the base model costs. You can monitor your overall usage and credit consumption in the Billing & Usage dashboard.Error Codes
In addition to standard HTTP errors, the API Gateway may return the following status codes:- 401 Unauthorized: Missing or invalid API key.
- 402 Payment Required: No active subscription (
subscription_required) or credits exhausted (insufficient_quota). An active subscription is validated on every chat completion request. - 403 Forbidden: API Gateway access is not enabled for your organization.
- 404 Not Found: The requested model was not found or is disabled.
- 429 Too Many Requests: Upstream provider rate limit reached.
FAQ
Does the API Gateway use the Privacy Filter?
Does the API Gateway use the Privacy Filter?
Not yet. Privacy Filter integration for the API Gateway is planned for a future update.
Which models are available through the API?
Which models are available through the API?
The available models depend on your organization’s specific Omnifact plan and configuration. You can use the
/v1/gateway/models endpoint to see the exact list of models available to you. Base-tier models are available as long as you have credits, but they cannot be used as a fallback when credits are exhausted.Can I create multiple API keys?
Can I create multiple API keys?
Currently, there is only one API key per organization, managed through the Developer Tools section.