⚡ 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
| Function | Purpose | When to use |
|---|---|---|
| generateGoogleImage | Generate images with Imagen 4 | Only if you want to control all parameters |
| generateVideo | Generate videos with Gemini Omni | To customize duration/aspect ratio |
| generateMusic | Generate music with Lyria 3 | For control over duration and genre |
| neuralaiSeek | Web search with Google | For forcing mode (speed/normal/large) |
| deepResearchOptimized | Deep research | For detailed reports (35k chars) |
| publicTextToSpeech | Text-to-Speech Google Neural2 | For specific voice selection |
| extractDocumentText | OCR/text extraction from files | For document preprocessing |
| analyzeVideoRAG | Video analysis with Gemini | For 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)