What Kind of Data Does OmniRoute Process? A Complete Guide to AI Proxy Data Types
OmniRoute processes chat completions, embeddings, image/audio/video/music generation, search queries, file uploads, and batch operations through OpenAI-compatible API endpoints, while also handling internal data like PII masking, memory context, and compression plans.
OmniRoute is a universal AI proxy built on Next.js that accepts diverse request payloads and returns unified responses. Understanding what kind of data OmniRoute processes is essential for developers integrating with its routing layer, as the platform normalizes inputs from dozens of providers into a consistent OpenAI-style interface. This guide examines the core data types, file formats, and internal processing pipelines implemented in the diegosouzapw/OmniRoute repository.
Core AI Data Types
OmniRoute exposes standard AI workloads through RESTful endpoints in src/app/api/v1/, each validating inputs with Zod schemas before translation.
Chat Completions and Text Generation
The primary data type processed by OmniRoute is chat completion requests, which include a model identifier and a messages array containing role-based content (user, assistant, system). Optional parameters like stream, temperature, and max_tokens control response behavior. When a streaming request arrives at src/app/api/v1/chat/completions/route.ts, the system extracts custom headers such as X-OmniRoute-No-Cache and X-Session-Id before forwarding the payload through the translator pipeline.
Embeddings and Vector Search
Embedding requests accept a model string and an input field containing plain text to be vectorized. As implemented in src/app/api/v1/embeddings/route.ts, these payloads are transformed by open-sse/translator/index.ts to match provider-specific formats, whether processing via Nebius, OpenAI, or other supported backends.
Image, Video, and Audio Generation
Multimedia generation endpoints handle binary and text inputs:
- Image generation:
POST /v1/images/generationsacceptsmodel,prompt, and optionalsize,quality, andstyleparameters (seesrc/app/api/v1/images/generations/route.ts) - Video generation:
POST /v1/videos/generationsprocessesmodel,prompt, and optionalresolutionordurationvalues - Audio transcription:
POST /v1/audio/transcriptionsreceives binary audio files with optionallanguagehints - Text-to-speech:
POST /v1/audio/speechconverts text inputs to audio using voice parameters
These routes reside in src/app/api/v1/videos/generations/route.ts, src/app/api/v1/audio/transcriptions/route.ts, and src/app/api/v1/audio/speech/route.ts respectively.
Utility and Administrative Data
Beyond generative AI, OmniRoute processes operational data types for file management, bulk operations, and information retrieval.
File Uploads and Binary Data
The Files API at src/app/api/v1/files/route.ts handles binary uploads with metadata attachments, supporting POST /v1/files for creation and GET /v1/files/{id} for retrieval. This enables workflows that require document analysis or persistent storage across sessions.
Batch Operations and Bulk Processing
Batch requests allow multiple operations in a single call to POST /v1/batches. The payload contains an array of request objects, each specifying a method, path, and body—enabling mixed workloads like combining chat completions with embeddings in one transaction. This logic is implemented in src/app/api/v1/batches/route.ts.
Search and Reranking
OmniRoute processes search queries via POST /v1/search, accepting model and query parameters with optional filters, and reranking requests at POST /v1/rerank that include model, query, and documents arrays. These endpoints leverage the built-in web-search provider and semantic reranking capabilities as defined in src/app/api/v1/search/route.ts and src/app/api/v1/rerank/route.ts.
Internal System Data
The proxy layer handles specialized data types for security, memory, and protocol compatibility.
Guardrails and PII Masking
Before upstream transmission, requests pass through guardrail modules that examine raw bodies for sensitive data. The src/lib/guardrails/pii‑masker.ts implementation can redact personally identifiable information based on configurable rules, processing the same JSON payloads that eventually reach AI providers.
Memory and Skills Injection
OmniRoute injects structured context snippets via src/lib/memory/ and skill-specific inputs through src/lib/skills/. These data types aren't exposed directly to API clients but are merged into prompts during the execution phase, enabling persistent conversation memory and tool-use capabilities.
A2A and MCP Protocol Data
The system supports Agent-to-Agent (A2A) protocols using JSON-RPC 2.0 request/response objects handled in src/lib/a2a/, and Model Context Protocol (MCP) tool definitions managed in open-sse/mcp-server/. These endpoints process event payloads and tool-specific JSON schemas that enable autonomous agent workflows.
Processing Pipeline: How OmniRoute Handles Data
According to the OmniRoute source code, the request flow transforms incoming data through six distinct stages:
- API Route validation: Next.js routes in
src/app/api/v1/*receive HTTP requests and validate payloads against Zod schemas - Translation:
open-sse/translator/index.tsconverts OpenAI-style requests into provider-specific formats - Execution: Provider-specific executors in
open-sse/executors/construct upstream URLs, headers, and bodies - Combo routing: When active,
open-sse/services/combo.tsdispatches requests to multiple providers sequentially or in parallel - Response transformation: Upstream responses are normalized back to OpenAI-compatible formats with enriched headers
- Guardrails and compression: Optional modules in
src/lib/guardrails/andopen-sse/compression/lite.tsmay redact PII or condense prompts based onX-OmniRoute-Compressionheader values
Code Examples
Streaming Chat Completion
POST /v1/chat/completions
Authorization: Bearer sk-********
Content-Type: application/json
X-OmniRoute-Compression: default
{
"model": "cc/claude-opus-4-6",
"messages": [{ "role": "user", "content": "Explain quantum tunneling." }],
"stream": true
}
Embedding Request
POST /v1/embeddings
Authorization: Bearer sk-********
Content-Type: application/json
{
"model": "nebius/Qwen/Qwen3-Embedding-8B",
"input": "The food was delicious"
}
Image Generation
POST /v1/images/generations
Authorization: Bearer sk-********
Content-Type: application/json
{
"model": "openai/gpt-image-2",
"prompt": "A beautiful sunset over mountains",
"size": "1024x1024"
}
Mixed Batch Request
POST /v1/batches
Authorization: Bearer sk-********
Content-Type: application/json
{
"requests": [
{
"method": "POST",
"path": "/v1/chat/completions",
"body": {
"model": "openai/gpt-4o",
"messages": [{ "role": "user", "content": "Who won the 2024 Olympics?" }]
}
},
{
"method": "POST",
"path": "/v1/embeddings",
"body": {
"model": "openai/text-embedding-3-large",
"input": "Machine learning is evolving."
}
}
]
}
Summary
- OmniRoute processes text, embeddings, multimedia (images, video, audio), and binary files through standardized OpenAI-compatible endpoints
- Utility operations include search queries, reranking, file uploads, and batch processing of mixed request types
- Internal data handling encompasses PII masking via
src/lib/guardrails/pii‑masker.ts, memory injection fromsrc/lib/memory/, and compression plans controlled byX-OmniRoute-Compressionheaders - Protocol support extends to A2A JSON-RPC and MCP tool schemas for agent-based workflows
- Request flow moves from Next.js API routes through translators and executors in
open-sse/, with optional combo routing and guardrail processing
Frequently Asked Questions
What format does OmniRoute expect for chat completion requests?
OmniRoute expects standard OpenAI-compatible JSON payloads with a model field and a messages array containing objects with role and content properties. The system accepts optional parameters like stream, temperature, and max_tokens, validating these inputs in src/app/api/v1/chat/completions/route.ts before translation to provider-specific formats.
Does OmniRoute support batch processing of different data types?
Yes, the POST /v1/batches endpoint accepts an array of request objects, each specifying a method, path, and body. This allows mixing chat completions, embeddings, and other operations in a single request, processed sequentially by the handler in src/app/api/v1/batches/route.ts.
How does OmniRoute handle sensitive data like PII?
Before upstream transmission, requests may pass through guardrail modules in src/lib/guardrails/ that examine raw request and response bodies for sensitive information. The pii‑masker.ts implementation can redact identifiable data based on configurable security rules, ensuring compliant handling of personal information.
Can OmniRoute process binary files like audio and images?
Yes, OmniRoute handles binary data through dedicated endpoints. Audio files are processed via POST /v1/audio/transcriptions in src/app/api/v1/audio/transcriptions/route.ts, while general file uploads use POST /v1/files with binary payloads and metadata attachments, managed by src/app/api/v1/files/route.ts.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →