Automatically activated by the Orchestrator, or forced with force_function.
✨ AUTOMATIC PARAMETERS FROM PROMPT
- Video: "vertical/9:16/reel", "horizontal/16:9" + "4/6/8/10 seconds"
- Images: "vertical/portrait", "horizontal/landscape", "square"
- Music: "30 seconds/jingle", "1 minute", "2 minutes", "3 minutes"
⏱️ GENERATION TIMES AND TIMEOUTS
- Image: 5-15 seconds (no timeout)
- Video: up to 90 seconds (504 timeout if exceeded). Use the dedicated endpoint /functions/generateVideo for async polling.
- Music: up to 60 seconds (504 timeout if exceeded)
- Deep Research (seek_large): up to 60 seconds. Reduced to 16K tokens to avoid timeouts.
- PDF Export (generate_pdf): up to 60 seconds (504 timeout if exceeded)
- Attached files: maximum 5 files per request
💡 On 504 error, retry by reducing complexity (shorter video duration, fewer attached files) or use the dedicated endpoint.
🔄 VIDEO RESUME AFTER TIMEOUT
If the video is not ready within the server time limit (~70s), the API responds with error_code: "video_generation_timeout" and video_operation_name. The tokens have already been charged upfront when the generation started (upfront charge: NOT refunded on timeout — the resume is included in the price). Do NOT start a new generation: repeat the same request adding the video_operation_name parameter — the API resumes polling the SAME video generation operation, at no extra cost.
let requestBody = { api_key: "nai_xxx", prompt: "Crea un video di onde su una spiaggia" };
let data = null;
for (let attempt = 0; attempt < 3; attempt++) {
const res = await fetch("https://app.neuralaiweb.com/functions/neuralaiPublicApi", {"Create an image of a sunset over the Alps"
"Create a video of waves on a beach"
"Compose a relaxing jazz melody"
"Deep research: full analysis with sources"
Generate original music using Lyria 3. Automatic duration based on the prompt.
⏱️ AUTOMATIC DURATION
- 30 sec: jingle, loop, short themes
- 60 sec: standard songs
- 120 sec: extended compositions
- 180 sec: suites, soundtracks
const response = await fetch("https://app.neuralaiweb.com/functions/neuralaiPublicApi", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
api_key: "YOUR_API_KEY",In-depth web research (up to 35,000 characters), 8-15 cited sources.
seek_speedQuick response
20 tokenseek_normalStandard search
40 tokenseek_largeDeep research
80 tokenconst response = await fetch("https://app.neuralaiweb.com/functions/neuralaiPublicApi", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
api_key: "YOUR_API_KEY",Generate or modify code in any language.
generated
No attached file — generate from scratch
modified
Attached file — modify the code
const response = await fetch("https://app.neuralaiweb.com/functions/neuralaiPublicApi", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
api_key: "YOUR_API_KEY",Generate professional A4 PDFs from markdown, directly from the unified endpoint. The document includes cover, hierarchical headings, tables, code blocks, cited sources and page numbering, with multilingual fonts (latin, cyrillic, CJK).
Parameters
generate_pdftrue activates PDF export (alternatively force_intent: "pdf")promptmarkdown content of the document to export (headings, tables, lists, code)pdf_titledocument title (default: first 80 chars of prompt)pdf_subtitledocument subtitle (default: NeuralAI API)pdf_languagedocument language (it, en, de, fr, es, pt, ja, zh, ru, ro, bg, sq)pdf_sourcescited sources [{title, url}] listed at the end of the PDFpdf_brandcustom brand in the PDFs (cover, author, footer). Default: the brand configured on the API key (API Console → API Keys), otherwise NeuralAIpdf_format"document" (default: typeset A4 PDF) or "presentation" (16:9 slides: one slide per section, cover and sources slide)📄 RESPONSE, COST AND TIMEOUT
- The response includes result.pdf_url (direct link to the PDF), result.pdf_file_name and result.pdf_pages
- Cost: 5 tokens per A4 document · 16:9 presentation (pdf_format: "presentation" or automatic detection): 90 tokens per every 10 pages — AI deck of up to 20 pages (beyond 10 pages the cost doubles): multiple professional graphic themes (notable ones include aurora, neon3d, lightglass, sunrise, carbon, mint, ink, neobrutalism, editorial, minimaldark) with 3D cards and mixed layouts, no AI images
- You can request an exact number of slides in the prompt (e.g. "presentation of 8 slides"): if the cover and sources slide keep the total within 10 pages, they are added on top of the requested number; if they exceed it, they are included in the requested number. A "brief" presentation produces a more compact deck.
- Presentations also include result.deck: the structured JSON deck (title, summary, theme, slides with bullets and tables) — ideal for custom integrations (PowerPoint, Google Slides, web editors)
- Google Slides export: from the API Playground the "Export to Google Slides" button (10 tokens) recreates the deck as an editable presentation in your Google account, with the theme colors — the cost covers the Google Slides API calls and the Drive file creation
- Timeout: up to 60 seconds for A4 documents, up to 120 seconds for the 16:9 presentation — set an adequate client timeout
- result.pdf_url is public: openable in a new tab or downloadable via fetch + blob
- Branding: PDFs show the name from the request's pdf_brand parameter, otherwise the one configured on the API key (API Console → API Keys), otherwise NeuralAI
- Presentation mode: pdf_format: "presentation" generates 16:9 slides (one per section) with cover and sources slide
🎯 AUTONOMOUS EXPORT TO GOOGLE SLIDES AND POWERPOINT (result.deck)
Presentations include result.deck, the structured JSON deck (title, summary, theme, slides with bullets and tables). If you develop your own application, use it to export the presentation to Google Slides or PowerPoint with your own credentials, directly inside your app: the end user does NOT need to log into NeuralAI or connect Google to their NeuralAI profile.
deckDeck metadata: title, summary, style (graphic theme) and language
slides[]Each slide with title, bullets[] and layout (hero, glass, data, cards, quote, split)
tableIn "data" slides: headers and rows to recreate as a native table
App with its own backend
Request Google OAuth consent with YOUR app's credentials (presentations scope), then create the presentation with the Google Slides API: presentations.create + presentations.batchUpdate (insertText, createTable)
App built on Base44
Register the Google Slides connector as your workspace's app-user connector and replicate the export flow in your backend function: each user of your app connects their own Google account
The built-in "Export to Google Slides" button (10 tokens) is NeuralAI's own shortcut, designed for use from the NeuralAI app (it requires logging into NeuralAI in the same browser): for your app use result.deck and the export happens entirely in your environment, with no NeuralAI export cost.
import requests
# 1) Genera la presentazione (la risposta include result.deck)
resp = requests.post(
"https://app.neuralaiweb.com/functions/neuralaiPublicApi",curl -X POST https://app.neuralaiweb.com/functions/neuralaiPublicApi \
-H "Content-Type: application/json" \
-d '{
"api_key": "LA_TUA_CHIAVE_API",
"generate_pdf": true,Handle PDF pending automatically: if the document is not ready within the first response budget, the API does NOT return an error but result.pdf_pending: true + result.pdf_job_id. Repeat the same request adding the poll_pdf_job_id parameter: polling is free and the PDF arrives with result.pdf_url as soon as the async job completes (up to ~2 minutes for 16:9 presentations). Always implement the loop in the example below: without polling the PDF is never delivered.
const markdownContent = `# Report Vendite Q3 ## Riepilogo Vendite cresciute del 12%.