Tenzro Cortex

Universal AI inference API providing access to a library of models from all major providers. Deploy custom models, optimize costs automatically, and scale infinitely.

Capabilities

Text Generation

Generate high-quality text with a library of models from all major providers

  • Code generation
  • Creative writing
  • Documentation
  • Translations

Multimodal AI

Analyze images, videos, and documents with advanced vision models

  • Image analysis
  • Document OCR
  • Visual Q&A
  • Chart extraction

Image Generation

Create stunning images with Imagen 3, GPT Image 1, and Stable Diffusion

  • Photorealistic images
  • Art generation
  • Logo design
  • Product shots

Video Generation

Generate high-quality videos with Veo 2 and other top models

  • Short clips
  • Animations
  • Product demos
  • Social content

Audio Generation

Create music, sound effects, and speech with Lyria and advanced audio models

  • Music composition
  • Voice synthesis
  • Sound effects
  • Podcasts

Live API

Real-time conversational AI with streaming responses

  • Voice conversations
  • Real-time chat
  • Live assistance
  • Interactive AI

Text Generation

Generate high-quality text content with access to a library language models from all major providers. Perfect for code generation, creative writing, documentation, and translations.

Supported Models

  • • Gemini 2.5 Pro with Deep Think (Google)
  • • Gemini 2.5 Flash (Google)
  • • Gemini 2.0 Flash (Google)
  • • Claude 4 Sonnet (Anthropic)
  • • Llama 3.1 405B (Meta)
  • • Custom fine-tuned models

Key Features

  • • Streaming responses for real-time UX
  • • Function calling capabilities
  • • Intelligent model routing
  • • Built-in prompt optimization
  • • Cost tracking and analytics
  • • Rate limiting and caching
Basic Text Generationjavascript
// Generate text with Gemini 2.5 Pro
const response = await fetch('https://api.tenzro.com/cortex/generate', {
  method: 'POST',
  headers: {
    'X-API-Key': 'sk_your_key_here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    prompt: "Write a Python function to calculate fibonacci numbers",
    model: "gemini-2.5-pro",
    max_tokens: 2048,
    temperature: 0.7,
    thinking_budget: 1000,
    show_thinking: true,
    system_prompt: "You are a helpful coding assistant",
    stream: true // Enable streaming
  })
});

// Handle streaming response
const reader = response.body.getReader();
while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  
  const chunk = new TextDecoder().decode(value);
  const lines = chunk.split('\n').filter(line => line.trim());
  
  for (const line of lines) {
    if (line.startsWith('data: ')) {
      const data = JSON.parse(line.slice(6));
      if (data.content) {
        console.log(data.content); // Stream content to UI
      }
    }
  }
}

Multimodal AI

Analyze images, videos, and documents with advanced vision models. Extract text, understand content, and answer questions about visual data with enterprise-grade accuracy.

Image Analysis

Understand and describe images

Document OCR

Extract text from documents

Visual Q&A

Ask questions about images

Image Analysisjavascript
// Analyze an image with Gemini 2.5 Pro
const formData = new FormData();
formData.append('image', imageFile);
formData.append('prompt', 'Describe this image in detail and identify all objects');
formData.append('model', 'gemini-2.5-pro');
formData.append('max_tokens', '1000');

const response = await fetch('https://api.tenzro.com/cortex/analyze/image', {
  method: 'POST',
  headers: {
    'X-API-Key': 'sk_your_key_here'
  },
  body: formData
});

const result = await response.json();
console.log(result.description);

// Document OCR with Gemini 2.0 Flash
const ocrResponse = await fetch('https://api.tenzro.com/cortex/analyze/document', {
  method: 'POST',
  headers: {
    'X-API-Key': 'sk_your_key_here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    image_url: "https://example.com/document.pdf",
    model: "gemini-2.0-flash",
    extract_text: true,
    extract_tables: true
  })
});

const ocrData = await ocrResponse.json();
console.log(ocrData.extracted_text);

Live API

Build real-time conversational AI applications with WebSocket connections. Support for voice input/output, streaming responses, and interactive AI assistants.

Voice Conversations

Real-time voice input and speech synthesis for natural conversations

Interactive Chat

Low-latency text conversations with streaming responses

Live WebSocket Connectionjavascript
// Initialize a live session with Gemini 2.0 Flash
const session = await fetch('https://api.tenzro.com/cortex/live/session', {
  method: 'POST',
  headers: {
    'X-API-Key': 'sk_your_key_here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    model: "gemini-2.0-flash",
    response_modalities: ["TEXT", "AUDIO"],
    voice: "alloy",
    instructions: "You are a helpful AI assistant."
  })
});

const sessionData = await session.json();

// Connect to WebSocket
const ws = new WebSocket(
  `wss://api.tenzro.com/cortex/live/ws/${sessionData.id}?api_key=sk_your_key_here`
);

ws.onopen = () => {
  console.log('Connected to live session');
  
  // Send a message
  ws.send(JSON.stringify({
    type: 'conversation.item.create',
    item: {
      type: 'message',
      role: 'user',
      content: [{ type: 'input_text', text: 'Hello, how can you help me?' }]
    }
  }));
  
  // Generate response
  ws.send(JSON.stringify({ type: 'response.create' }));
};

ws.onmessage = (event) => {
  const message = JSON.parse(event.data);
  
  switch (message.type) {
    case 'response.text.delta':
      // Handle streaming text
      console.log('Text chunk:', message.delta);
      break;
    case 'response.audio.delta':
      // Handle streaming audio
      playAudioChunk(message.delta);
      break;
    case 'response.done':
      console.log('Response complete');
      break;
  }
};

Quick Examples

Text Generationjavascript
// Generate text with Gemini 2.5 Pro
const response = await fetch('https://api.tenzro.com/cortex/generate', {
  method: 'POST',
  headers: {
    'X-API-Key': 'sk_your_key_here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    prompt: "Write a Python function to calculate fibonacci numbers",
    model: "gemini-2.5-pro",
    max_tokens: 2048,
    temperature: 0.7,
    thinking_budget: 1000,
    show_thinking: true,
    system_prompt: "You are a helpful coding assistant"
  })
});

const data = await response.json();
console.log(data.content);
console.log('Thinking trace:', data.thinking_trace);

Key Features

Multi-Provider Access

  • Unified API for Google, Anthropic, Meta, and more
  • Intelligent model selection based on your requirements
  • Automatic failover when providers are unavailable
  • Cost optimization across different providers

Enterprise Features

  • Built-in rate limiting and caching for better performance
  • Function calling for complex AI workflows
  • Real-time streaming for interactive applications
  • Advanced security and compliance features