⚡ Direct Calls to Backend Functions

⚠️ ONLY FOR EXPERIENCED DEVELOPERS

The orchestrator is the recommended approach. Direct calls to backend functions are only useful for specific use cases (e.g. legacy integrations, testing, or when you need total control over parameters).

📋 Available backend functions

FunctionPurposeWhen to use
generateGoogleImageGenerate images with Imagen 4Only if you want to control all parameters
generateVideoGenerate videos with Gemini OmniTo customize duration/aspect ratio
generateMusicGenerate music with Lyria 3For control over duration and genre
neuralaiSeekWeb search with GoogleFor forcing mode (speed/normal/large)
deepResearchOptimizedDeep researchFor detailed reports (35k chars)
publicTextToSpeechText-to-Speech Google Neural2For specific voice selection
extractDocumentTextOCR/text extraction from filesFor document preprocessing
analyzeVideoRAGVideo analysis with GeminiFor RAG on long videos

🔧 How to call functions directly

Backend functions are accessible via HTTP POST. Each function has its specific request and response format.

1. generateGoogleImage

javascript
// Endpoint: https://app.neuralaiweb.com/functions/generateGoogleImage
const response = await fetch("https://app.neuralaiweb.com/functions/generateGoogleImage", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({

2. generateVideo

javascript
// Endpoint: https://app.neuralaiweb.com/functions/generateVideo
const response = await fetch("https://app.neuralaiweb.com/functions/generateVideo", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({

3. neuralaiSeek

javascript
// Endpoint: https://app.neuralaiweb.com/functions/neuralaiSeek
const response = await fetch("https://app.neuralaiweb.com/functions/neuralaiSeek", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({

4. publicTextToSpeech

javascript
// Endpoint: https://app.neuralaiweb.com/functions/publicTextToSpeech
const response = await fetch("https://app.neuralaiweb.com/functions/publicTextToSpeech", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({

⚠️ Disadvantages of direct calls:

  • 10+ different endpoints to manage in code
  • Different request/response formats for each function
  • No automatic intent detection — you must choose the function
  • More complex maintenance — if APIs change, you must update everything
  • Fragmented token tracking — you must sum consumption manually

✅ When it makes sense to use direct calls:

  • Testing and debugging — you want to isolate a specific function
  • Legacy integrations — you already have code using separate endpoints
  • Total control — you need to customize advanced parameters not exposed by the orchestrator
  • Extreme optimization — you want to avoid the overhead of intent detection (1-2 tokens)