Contents

convert_video_mp4.phpConvert an uploaded browser video to iPhone-compatible MP4
email.phpSend plain-text email via SMTP / PHPMailer
ffmpeg_helper.phpInspect, convert, and thumbnail uploaded media with safe FFmpeg presets
html_gen.phpGenerate HTML apps or PHP REST API endpoints from a plain-English prompt
image_gen.phpRecommended image generation API for text-to-image PNG output
image_gen_gemini.phpUse only when an input image is needed for Gemini image editing
image_gen_seedream.phpUse only when one or more input images are needed for Seedream editing
kgraph.phpCreate, update, delete, and query local knowledge graphs with llm.php
llm.phpRecommended LLM API for text answers
llm_chatgpt.phpOpenAI proxy with arbitrary model selection, GPT-5.5 default, Luna lite mode, and image input
llm_gemini.phpGemini proxy with arbitrary model selection and attachment/image/audio input
llm_jb.phpFaith's GLM 5.3 intelligence engine with Gemini attachment fallback and OpenAI-compatible chat completions
memory.phpCreate and manage structured long-term memory files with llm_jb/GLM
music_gen.phpCreate and check MiniMax Music 2.0 generation jobs via AIMLAPI
notes.phpCreate, read, edit, list, complete, restore, and delete durable note files
pdf_creator.phpCreate a PDF from finished text or a LibreOffice-compatible file
pptx_editor.phpEdit an uploaded PowerPoint with natural-language instructions — try the web app
publish.phpPublish HTML/ZIP apps with update tokens, documents and media; 30-day expiry
qr.phpCreate the same downloadable QR-card PNG as the QR Cards web app
rag.phpAsk a Gemini File Search store and get a brief JSON answer
rate-limit.phpPer-program rate-limit API and admin dashboard
steam.phpFetch Steam game reviews or community discussion search results
stock.phpFetch stock quotes, company profiles, and financial metrics via Finnhub
transcribe.phpTranscribe uploaded or base64 audio to plain text using Gemini
transcript.phpRetrieve plain-text transcripts for public YouTube videos
transfer.phpUpload temporary files and retrieve them with transfer.promptbox.cn receipts
tts.phpConvert text to speech and stream audio via OpenAI TTS
tts_inworld.phpRecommended TTS API for streaming speech via AIML / Inworld TTS
twitter.phpSearch Twitter/X, Facebook, and Reddit posts and comments
video_compress.phpCompress an MP4 into a smaller phone-friendly H.264/AAC file
web.phpLive web search proxy returning a number or plain-text answer
web_read.phpConvert one public URL or uploaded file to cleaned readable text
youtube.phpSearch YouTube and get AI-synthesized answers from video transcripts

convert_video_mp4.php

Browser video to MP4 fallback converter

Converts an uploaded browser-generated video file to MP4 with H.264 video and AAC audio. Shortform Studio normally uses its primary server-side assembler directly, so this endpoint is a fallback.

POST https://promptbox.cn/api/convert_video_mp4.php
NameTypeDescription
videofilerequiredUploaded WebM or other ffmpeg-readable video, up to 600 MB.

Returns video/mp4 on success. Errors are plain text and logged to api/convert_video_mp4.log. The helper has no Promptbox request quota.

email.php

Send plain-text email via SMTP / PHPMailer

Sends a plain-text email through Hostinger's SMTP server using PHPMailer. The From address is always adam@promptbox.cn (PromptBox); an optional custom sender is set as the Reply-To header instead. All three of recipient, subject, and body are required.

https://promptbox.cn/api/email.php  GET POST
NameTypeDescription
recipientstringrequiredDestination email address. Must be a valid email format.
subjectstringrequiredEmail subject line.
bodystringrequiredPlain-text body of the email.
senderstringoptionalPreferred From address (used as Reply-To if it differs from the server's SMTP address). Default: adam@promptbox.cn.
{ "sent": true } // or on failure: { "sent": false, "error": "Mailer error: ..." }
# Send via GET GET email.php?recipient=user@example.com&subject=Hello&body=This+is+a+test+message. # Send via POST JSON POST email.php Content-Type: application/json { "recipient": "user@example.com", "subject": "Meeting reminder", "body": "Don't forget our call at 3 PM today." }

ffmpeg_helper.php

Safe REST access to Hostinger FFmpeg

Runs common FFmpeg tasks for external HTML apps without exposing arbitrary command execution. Supports media inspection, format conversion, and video thumbnail extraction from an uploaded file.

GET POST https://promptbox.cn/api/ffmpeg_helper.php
ActionMethodReturnsDescription
infoGET or POSTJSONReturns helper version, FFmpeg version, limits, and supported presets.
probePOSTJSONReturns FFprobe stream and format metadata for the uploaded media.
convertPOSTFile bytesConverts uploaded media with a safe preset: mp4, webm, mp3, m4a, wav, or gif.
thumbnailPOSTJPEGExtracts one video frame as a JPEG thumbnail.
NameTypeDescription
actionstringrequired*info, probe, convert, or thumbnail. Defaults to info for GET.
mediafilerequiredUploaded audio or video file, up to 300 MB. Aliases file, video, and audio are also accepted.
presetstringoptionalFor convert; one of mp4, webm, mp3, m4a, wav, or gif. Default: mp4.
startnumberoptionalStart time in seconds for conversion. Range: 0-600.
durationnumberoptionalMaximum converted duration in seconds. Range: 0-600.
widthnumberoptionalOutput width for video, GIF, or thumbnail. Keeps aspect ratio. Range: 64-3840.
qualitynumberoptionalVideo CRF quality for mp4 and webm. Lower is better/larger. Range: 18-35, default 23.
audio_bitratenumberoptionalAudio bitrate in kbps for compressed outputs. Range: 64-320, default 128.
timenumberoptionalFor thumbnail; frame time in seconds. Default: 1.
const form = new FormData();
form.append('action', 'convert');
form.append('preset', 'mp4');
form.append('width', '720');
form.append('media', fileInput.files[0]);

const response = await fetch('https://promptbox.cn/api/ffmpeg_helper.php', {
  method: 'POST',
  body: form
});
if (!response.ok) throw new Error(await response.text());
const mp4Blob = await response.blob();

info and probe return JSON like { "success": true, ... }. convert returns the requested media bytes with the matching content type, and thumbnail returns image/jpeg. Errors return JSON { "success": false, "error": "...", "code": 400 } with an appropriate HTTP status. The helper sends permissive CORS headers, logs errors to api/ffmpeg_helper.log, and has no Promptbox request quota.

html_gen.php

AI-powered HTML app and REST API generator

Takes a plain-English description and uses Gemini to generate a complete working program. By default it preserves the original HTML generator behavior: a self-contained mobile-friendly HTML/CSS/JavaScript app is saved in public_html/logi/logi_code/ as the next numbered codeN.html file, and the public URL is returned.

Pass api=1, rest=1, or mode=api to generate a PHP REST API endpoint instead of a user interface. API mode saves a unique descriptive PHP filename in public_html/api/, such as recipe-nutrition-calculator-api.php, then appends usage documentation for that generated endpoint to this api/docs.html reference page. It does not create a separate .txt documentation file.

Every generated REST API uses the shared rate-limit.php helper, returns JSON 429 responses when the helper denies a request, and writes server-side failures to an endpoint-specific .log file in public_html/api/.

Generated HTML apps can call web.php for live web data, llm.php for lightweight browser AI tasks, and image_gen.php for runtime image generation. Generated PHP REST APIs use exact documented .php helper URLs; server-side text intelligence should POST JSON to https://promptbox.cn/api/llm_jb.php with model:"pro" and needs no session or extra authorization. A pre-generation image manifest (<!-- APP_GEN_PREGENERATE_IMAGES [...] -->) can also be embedded in HTML output to generate up to 30 static images at save time.

For long or agent-initiated work, use asynchronous mode: POST action=start with the prompt. The helper immediately returns HTTP 202 with a durable task_id, while a detached Hostinger worker generates and verifies the program. Use action=status with that task ID for an explicit status check. Sentience normally waits for the existing completion notification instead of polling.

https://promptbox.cn/api/html_gen.php  GET POST
NameTypeDescription
promptstringrequiredDescription of the HTML app or REST API to generate. Also accepted as q.
actionstringoptionalUse start in a POST request to launch a detached job, or status to inspect an existing job. Omit it for the original synchronous behavior.
apibooloptionalPass 1, true, or yes to generate a PHP REST API endpoint instead of an HTML user interface. Aliases: rest, rest_api, api_mode; mode=api, mode=rest, or type=api also works.
task_id / job_idstringoptionalRequired with action=status. A successful start response supplies the durable ID.

Default HTML mode returns the created codeN.html file under logi/logi_code/:

{ "success": true, "filename": "code42.html", "filepath": "/path/to/code42.html", "url": "https://logi.promptbox.cn/logi_code/code42.html", "task_id": "htmlgen_app_abc123", "generated_images": [...], "image_errors": [] }

API mode returns the created descriptive .php endpoint under api/ and reports whether this page was updated with generated endpoint documentation:

{ "success": true, "filename": "recipe-nutrition-calculator-api.php", "filepath": "/path/to/api/recipe-nutrition-calculator-api.php", "mode": "rest_api", "docs_updated": true, "docs_url": "https://promptbox.cn/api/docs.html#recipe-nutrition-calculator-api", "url": "https://promptbox.cn/api/recipe-nutrition-calculator-api.php", "task_id": "htmlgen_api_def456" }

Asynchronous start returns immediately, and status reports queued, running, completed, or failed:

{ "success": true, "pending": true, "task_id": "htmlgen_api_0123456789abcdefabcd", "status": "queued", "runner_started": true }
# Generate a tip calculator app GET html_gen.php?prompt=A+tip+calculator+with+split+bill+support # POST with JSON body POST html_gen.php Content-Type: application/json { "prompt": "A flashcard quiz app with spaced repetition for learning vocabulary" } # Generate a PHP REST API endpoint instead of an HTML UI POST html_gen.php Content-Type: application/json { "prompt": "A recipe nutrition calculator API", "api": true }
# Start a detached generation job POST html_gen.php Content-Type: application/json { "action": "start", "prompt": "A recipe nutrition calculator API", "api": true } # Check only when an explicit status read is needed GET html_gen.php?action=status&task_id=htmlgen_api_0123456789abcdefabcd

image_gen.php

AI image generation via AIML / z-image-turbo

Recommended image generation API. Use image_gen.php for normal text-to-image requests; use the Gemini or Seedream image helpers only when an existing image input is needed for editing, style transfer, or image-conditioned generation. Generates a PNG image from a text prompt using AIML's alibaba/z-image-turbo model. Returns the raw image bytes directly as image/png — use response.blob() and URL.createObjectURL() in browser apps. Portrait (3:4) by default; set landscape=1 for landscape (4:3) output. AIML acceleration is off by default; pass acceleration=high to enable it for faster generation. AIML's safety checker is off by default; opt in with safety_checker=1. To have the server rewrite and sanitize the image prompt with llm.php before generation, pass optimize_prompt=1.

When called as a library function (require_once 'image_gen.php'), use generateImage($prompt, $isLandscape, $enableSafetyChecker, $acceleration, $optimizePrompt) which returns the raw binary string, or run_image_gen($inputs) which saves the image to logi_image.png and returns a public URL.

On sites that block external fetch() but allow external images, such as newer free Neocities sites, set the helper URL directly as an image source instead of fetching a blob.

https://promptbox.cn/api/image_gen.php  GET POST
NameTypeDescription
promptstringrequiredText description of the image to generate. Also accepted as q.
landscapebooloptionalPass 1, true, or landscape to generate landscape (4:3). Default is portrait (3:4).
accelerationstringoptionalDefault is off, which omits AIML's acceleration field. Pass high for faster generation. Alias: speed.
safety_checkerbooloptionalPass 1, true, yes, or on to enable AIML's safety checker. Default is off. Aliases: safetyChecker, enable_safety_checker, enableSafetyChecker.
optimize_promptbooloptionalPass 1, true, yes, or on to call llm.php first and rewrite/sanitize the prompt for image generation. Default is off. Aliases: optimizePrompt, sanitize_prompt, sanitizePrompt, refine_prompt, refinePrompt, prompt_optimize, promptOptimize.
copyToDeletedbooloptionalIf true, also copies the image to a storage/deleted/ archive directory on the server.

HTTP 200 with Content-Type: image/png and raw PNG bytes on success. On error: plain text error message with an appropriate HTTP error code.

# Portrait image (default) GET image_gen.php?prompt=A+serene+Japanese+garden+at+dawn # Landscape image GET image_gen.php?prompt=Futuristic+city+skyline+at+night&landscape=1 # Enable acceleration GET image_gen.php?prompt=A+serene+Japanese+garden+at+dawn&acceleration=high # Enable AIML safety checker GET image_gen.php?prompt=A+serene+Japanese+garden+at+dawn&safety_checker=1 # Optimize and sanitize the prompt with llm.php first GET image_gen.php?prompt=quick+sketch+of+a+cozy+robot+cafe&optimize_prompt=1 # Fetch in JavaScript (browser app) const res = await fetch('image_gen.php?prompt=' + encodeURIComponent(prompt)); const blob = await res.blob(); img.src = URL.createObjectURL(blob); # Neocities/free-CSP direct image loading img.src = 'https://promptbox.cn/api/image_gen.php?prompt=' + encodeURIComponent(prompt);

image_gen_gemini.php

Gemini image generation with optional image editing

Use image_gen.php for normal text-to-image generation. Use this helper only when an existing input image is needed for Gemini image editing, style transfer, or image-conditioned generation. It uses Gemini's gemini-3.1-flash-image-preview model and returns raw image bytes; send the input image as base64 (with or without a data URI prefix) in the image parameter, or as a multipart file upload. Portrait (3:4) is the default; landscape (4:3) can be requested. The helper uses Gemini's default 1K output unless image_size=4K or four_k=1 is passed.

On sites that block external fetch() but allow external images, such as newer free Neocities sites, set the helper URL directly as an image source instead of fetching a blob.

https://promptbox.cn/api/image_gen_gemini.php  GET POST
NameTypeDescription
promptstringrequiredText prompt describing the image to generate (or the edit to apply to an input image). Also accepted as q.
landscapebooloptionalPass 1 or true for landscape (4:3). Default is portrait (3:4).
image_sizestringoptionalPass 4K to request Gemini 4K output while keeping the selected 3:4 or 4:3 aspect ratio. Aliases: imageSize=4K, four_k=1, 4k=1, image_4k=1, use_4k=1.
imagestring or fileoptionalInput image for editing/style transfer. Accepted as a base64 string (plain or data URI), a JSON object with inlineData.data, or a multipart file upload. Supported formats: PNG, JPEG, WEBP, HEIC, HEIF. Max 20 MB.
image_mime_typestringoptionalMIME type of the input image when passing plain base64 without a data URI. E.g. image/png.

HTTP 200 with the detected MIME type (image/png, image/jpeg, etc.) and raw image bytes. On error: plain text message with appropriate HTTP status code.

# Text-to-image (landscape) GET image_gen_gemini.php?prompt=Watercolor+painting+of+a+mountain+lake&landscape=1 # Neocities/free-CSP direct image loading img.src = 'https://promptbox.cn/api/image_gen_gemini.php?prompt=' + encodeURIComponent(prompt); # Image editing via POST POST image_gen_gemini.php Content-Type: application/json { "prompt": "Make this photo look like a Van Gogh painting", "image_size": "4K", "image": "data:image/jpeg;base64,/9j/4AAQ..." }

image_gen_seedream.php

Seedream 5.0 Lite Preview image generation and editing via AIML

Use image_gen.php for normal text-to-image generation. Use this helper when one or more existing input images are needed for Seedream editing or image-conditioned generation. It uses ByteDance Seedream 5.0 Lite Preview through AIML with the bytedance/seedream-5-0-lite-preview model; input images are sent together with image_urls. It returns raw image bytes like image_gen_gemini.php.

https://promptbox.cn/api/image_gen_seedream.php  GET POST
NameTypeDescription
promptstringrequiredText prompt describing the image to generate or edit. Also accepted as q.
landscapebooloptionalShortcut for landscape_4_3 when image_size is omitted. Default is portrait.
imagestring or fileoptionalInput image for editing. Accepted as a URL, base64 string, data URI, JSON object with inline data, or multipart file upload. Supported upload/base64 formats: PNG, JPEG, WEBP. Max 8 MB each.
image_urlsarray or stringoptionalOne or more public image URLs or base64/data URI images for Seedream edit mode. Also accepts images. Max 14 input images.
image_sizestring or objectoptionalUse 2K, 4K, or an object such as {"width":2304,"height":1728}. Width and height must each be 1440–4096 pixels, with at least 3,686,400 total pixels. Older aspect-ratio names remain accepted as compatibility shortcuts and are mapped to valid dimensions.
image_width, image_heightintegeroptionalMultipart-friendly explicit dimensions. Both are required together; each must be 1440–4096 and their product at least 3,686,400 pixels.
response_formatstringoptionalurl (default) or b64_json. The helper still returns raw image bytes to its caller.
seedintegeroptionalOptional seed.
watermarkbooloptionalAdd AIML's invisible watermark. Default false.

HTTP 200 with the detected image MIME type and raw image bytes. On error: plain text message with an appropriate HTTP status code.

# Text-to-image GET image_gen_seedream.php?prompt=A+T-Rex+relaxing+on+a+beach&landscape=1 # Image edit via JSON POST image_gen_seedream.php Content-Type: application/json { "prompt": "Put the T-Rex in a business suit in a cozy cafe", "image_urls": [ "https://example.com/t-rex.png", "https://example.com/blue-mug.jpg" ] }

kgraph.php

Local knowledge graph helper powered by llm.php

Creates, updates, deletes, and answers questions from local JSON knowledge graphs saved in the site-level kgraph/ folder. It uses llm.php's current default model to extract entities and relationships from new knowledge, merge them into existing graph nodes and edges, and answer questions using only the saved graph. Graph writes are atomic and locked so overlapping updates do not overwrite each other, and large graphs use a relevance-ranked, size-bounded LLM context. KGraph operations have no Promptbox request quota and failures are logged to api/kgraph.log.

Use this when an app needs a small, editable memory graph instead of document search. Each graph is stored as https://promptbox.cn/kgraph/{graph_id}.json with nodes, edges, and notes.

https://promptbox.cn/api/kgraph.php  GET POST
NameTypeDescription
actionstringoptionalDefault: answer. Supported values: create, delete, add, answer, and get. Hyphenated aliases are accepted. Mutating actions (create, add, and delete) require POST.
graph_idstringrequired except create with title/nameSafe graph identifier. Letters, numbers, dots, underscores, and hyphens are kept; other characters become hyphens. Aliases: id, name.
titlestringoptionalHuman-readable title for a new graph. Aliases: display_name, name. If graph_id is omitted on create, the title/name is slugged into the graph ID.
knowledgestringrequired for add; optional for createPlain-text facts, notes, records, or source material to merge into the graph. The LLM may update previous node summaries and relationships. Aliases: text, content, prompt for add.
questionstringrequired for answerQuestion to answer from the graph. Aliases: prompt, q.
{ "success": true, "graph_id": "travel-expenses", "content": "Answer from the graph...", "node_count": 8, "edge_count": 10, "code": 200 }

Create and add return the saved, normalized graph JSON. Delete returns { "success": true, "deleted": "graph-id" }. Knowledge is limited to 200,000 bytes, questions to 12,000 bytes, and stored graph JSON to 2,000,000 bytes. JSON requests must contain a valid object. On error: { "success": false, "error": "...", "code": 400 } or another relevant HTTP status.

# Create a graph with initial knowledge POST kgraph.php Content-Type: application/json { "action": "create", "graph_id": "travel-expenses", "title": "Travel Expenses", "knowledge": "Adam can expense business meals up to $75 with receipts." } # Add or update knowledge POST kgraph.php Content-Type: application/json { "action": "add", "graph_id": "travel-expenses", "knowledge": "Hotel stays require manager approval when over $250 per night." } # Answer a question from the graph GET kgraph.php?graph_id=travel-expenses&question=What+needs+approval%3F # Fetch the raw graph JSON GET kgraph.php?action=get&graph_id=travel-expenses # Delete a graph POST kgraph.php Content-Type: application/json { "action": "delete", "graph_id": "travel-expenses" }

llm.php

Lightweight LLM proxy for text answers

Recommended LLM API. Use llm.php for normal text prompts and answers; use the other LLM helpers only when an attachment, image, audio, or provider-specific capability is needed. The default model is deepseek/deepseek-v4-flash through AIMLAPI; pass model=pro, model=premium, quality=pro, or pro=1 to use Z.ai glm-5.3. GLM thinking is disabled by default for lower latency and reliable final answer text; pass thinking=enabled when deep reasoning is needed. Passing model=lite, omitting model, or using any other value keeps the default flash model. Responses are uncapped by default; pass max_sentences to add sentence-limit guidance. Suitable for translations, classifications, rewrites, summaries, extractions, trivia lookups, and simple puzzles. For live web data use web.php instead.

Returns text/plain — no JSON wrapper — so it can be used directly in browser fetch() calls with response.text(). If you pass callback or cb on a GET request, it returns JSONP as application/javascript: callback({ ok: true, text: "..." }). JSONP responses use Cache-Control: no-store.

https://promptbox.cn/api/llm.php  GET POST
NameTypeDescription
promptstringrequiredThe task or question to send to the selected LLM. Also accepted as q.
max_sentencesintegeroptionalCaps the response length. Default: 0 (no cap).
max_tokensintegeroptionalMaximum output tokens, clamped from 128 to 4096. Omit to use the provider default.
modelstringoptionalDefault: lite, which uses deepseek/deepseek-v4-flash. Pass pro, premium, advanced, glm-5.3, or a legacy pro selector to use Z.ai glm-5.3. Gemini selectors remain supported as legacy aliases for the pro route.
timeout_secondsintegeroptionalDirect Pro/Z.ai request timeout, clamped from 5 to 60 seconds. Default: 35. Flash and its fallback retain their configured timeouts.
thinkingstringoptionalControls Z.ai GLM reasoning. Default: disabled for faster direct answers. Pass enabled when deep reasoning is needed. The setting has no effect on AIML/DeepSeek requests.
qualitystringoptionalAlias for model selection. Use quality=pro to use Z.ai glm-5.3.
probooleanoptionalSet to 1, true, or yes to use Z.ai glm-5.3. Aliases: use_pro, deepseek_pro.
callbackstringoptionalGET-only JSONP callback name for sites where external fetch() is blocked, such as newer free Neocities sites. Alias: cb.

text/plain with the model's answer and an X-LLM-Model response header showing deepseek-v4-flash or glm-5.3. On error: plain error string with appropriate HTTP status. In JSONP mode, the response is always JavaScript with { ok, text, model } or { ok: false, error, status }.

# Translate a sentence GET llm.php?prompt=Translate+"Hello, how are you?" to Spanish # Classify sentiment GET llm.php?q=Is+this+positive+or+negative%3F+"The+food+was+cold+and+service+was+rude." # Use the pro model GET llm.php?prompt=Explain+quantum+tunneling&model=pro # Alternate pro selector GET llm.php?prompt=Explain+quantum+tunneling&pro=1 # In browser JavaScript const answer = await fetch('llm.php?prompt=' + encodeURIComponent(prompt)).then(r => r.text()); # JSONP for Neocities/free-CSP pages window.handleLlm = (payload) => console.log(payload.ok ? payload.text : payload.error); const script = document.createElement('script'); script.src = 'https://promptbox.cn/api/llm.php?callback=handleLlm&prompt=' + encodeURIComponent(prompt); document.head.appendChild(script);

llm_chatgpt.php

OpenAI text and image proxy with a cost-sensitive lite mode

Sends a single user message to OpenAI Chat Completions and returns the assistant text. The default model remains gpt-5.5; pass model=lite or model=gpt-5.6-luna to use GPT-5.6 Luna with reasoning_effort=medium for the lite route. Any other non-empty model value is passed to OpenAI unchanged, including model names that do not begin with gpt-.

Optional images may be public HTTP(S) URLs, JPEG/PNG/WEBP data URIs, or plain base64 image data. The helper is rate limited as llm_chatgpt and supports GET-only JSONP with callback or cb.

https://promptbox.cn/api/llm_chatgpt.php  GET POST
NameTypeDescription
promptstringrequiredThe question or instruction. Also accepted as q.
modelstringoptionalDefault: gpt-5.5. Use lite or gpt-5.6-luna for the cost-sensitive Luna route; any other non-empty OpenAI model name is passed through unchanged.
imagesarrayoptionalOne or more public image URLs, image data URIs, or base64 JPEG/PNG/WEBP images. JSON POST is recommended.
callbackstringoptionalGET-only JSONP callback name. Alias: cb.
reasoning_effortstringoptionalOverride reasoning effort: none, minimal, low, medium, high, xhigh, or max; support depends on the selected model. Lite defaults to medium.

text/plain with the model answer. JSONP returns { ok: true, text }. Errors use an appropriate HTTP status and are logged to api/llm_chatgpt.log.

# Default GPT-5.5 route GET llm_chatgpt.php?prompt=Explain+quantum+tunneling # GPT-5.6 Luna lite route GET llm_chatgpt.php?prompt=Classify+this+message&model=lite # Any specific OpenAI model name GET llm_chatgpt.php?prompt=Explain+quantum+tunneling&model=o4-mini # Image input via JSON POST llm_chatgpt.php Content-Type: application/json { "prompt": "What is shown in this image?", "model": "lite", "images": ["data:image/jpeg;base64,/9j/4AAQ..."] }

llm_gemini.php

Lightweight Gemini LLM proxy with optional image input

Use llm.php for normal text prompts and answers. Use this helper when Gemini attachments, image/audio content, structured Gemini contents or parts, Gemini-specific generation controls, or a specific Gemini model is needed. The default model remains gemini-3-flash-preview; pass model=lite or model=gemini-3.1-flash-lite to use gemini-3.1-flash-lite, which always runs with temperature=0. Any other non-empty model value is passed to Gemini unchanged.

This helper is for general Gemini text, vision, and audio/content requests. It does not accept Gemini File Search tools; use rag.php for File Search / RAG queries against a document store.

Like llm.php, the response is text/plain with no JSON wrapper. If you pass callback or cb on a GET request, it returns JSONP as application/javascript for Neocities/free-CSP pages.

https://promptbox.cn/api/llm_gemini.php  GET POST
NameTypeDescription
promptstringrequired*The task or question. Also accepted as q. Required unless parts or contents is supplied.
modelstringoptionalDefault: gemini-3-flash-preview. Use lite or gemini-3.1-flash-lite for the lite model; any other non-empty Gemini model name is passed through unchanged.
imagesarrayoptionalArray of base64 image strings (plain base64 or data URI format: data:image/jpeg;base64,...). Supported types: JPEG, PNG, WEBP. Only accepted via POST with JSON body. HTTP URLs are rejected.
partsarrayoptionalRaw Gemini-style parts. Supports { "text": "..." } and { "inlineData": { "mimeType": "...", "data": "base64..." } }. If prompt is also supplied, it is prepended.
contentsarrayoptionalRaw Gemini-style conversation contents. Each item may include role as user or model and a parts array.
languagestringoptionalWhen supplied, appends Give your response in <language> language. to the Gemini request. Alias: lang. Blank values are ignored.
system_promptstringoptionalSystem instruction for Gemini. Alias: system. A Gemini-style systemInstruction.parts object is also accepted.
generationConfigobjectoptionalGemini generation settings such as temperature or maxOutputTokens. Alias: generation_config.
callbackstringoptionalGET-only JSONP callback name for sites where external fetch() is blocked. Alias: cb.

text/plain with the model's answer. Returns null (the literal string) on API-level errors, or an HTTP error code on input validation failures. In JSONP mode, the response is always JavaScript with { ok, text } or { ok: false, error, status }.

# Text-only query GET llm_gemini.php?prompt=What+is+the+Fibonacci+sequence%3F # Text-only query with lite model GET llm_gemini.php?prompt=Summarize+this&model=lite # Any specific Gemini model name GET llm_gemini.php?prompt=Summarize+this&model=gemini-3.6-flash # Text-only query with response language GET llm_gemini.php?prompt=Summarize+this&language=Chinese # Multimodal query with an image POST llm_gemini.php Content-Type: application/json { "prompt": "What is shown in this image?", "model": "lite", "images": ["data:image/jpeg;base64,/9j/4AAQ..."] }

llm_jb.php

GLM-backed primary intelligence for Faith and OpenAI-compatible agents

llm_jb.php is Faith's primary intelligence engine and also supports other private LLM installs. It provides the legacy plain-text helper at /api/llm_jb.php and an OpenAI-compatible interface at /api/llm_jb.php/v1/chat/completions. Server-side PHP may call the exact https://promptbox.cn/api/llm_jb.php URL directly with POST JSON; no browser session, cookie, or extra authorization is required. Do not invent /api/proxy-llm.php or omit the .php suffix.

Legacy helper mode accepts GET query parameters, POST form fields, or a POST JSON body. Text-only input uses Z.ai glm-5.3 with thinking disabled by default. Pass provider=gemini to opt a request into Gemini without changing the default for other callers. Requests that include an image, audio, file, inline attachment, or other multimodal part stay on Gemini automatically: the default route uses gemini-3-flash-preview, while model=lite or model=gemini-3.1-flash-lite uses gemini-3.1-flash-lite.

OpenAI-compatible mode exposes /v1/models and /v1/chat/completions. Plain text chat and standard OpenAI function-tool workflows use GLM 5.3 with thinking disabled by default, including assistant tool_calls and subsequent tool results. Pass provider=gemini to force the request through Gemini. Image, audio, file, or other multimodal message content stays on Gemini automatically. Gemini-only thought-signature metadata is stripped when a text/tool conversation is sent to GLM and remains available on Gemini responses.

Like llm.php, llm_jb.php has no Promptbox request-count quota. Provider payload-size, output-token, and timeout bounds still apply.

https://promptbox.cn/api/llm_jb.php  GET POST
https://promptbox.cn/api/llm_jb.php/v1/chat/completions  POST
https://promptbox.cn/api/llm_jb.php/v1/models  GET
NameTypeDescription
promptstringrequired*The task or question. Also accepted as q. Required unless parts or contents is supplied.
providerstringoptionalPass gemini to force Gemini for this request. Omit it to preserve the default: GLM 5.3 for text-only requests and Gemini for multimodal requests.
modelstringoptionalOn the default text route, both the default and lite selectors use glm-5.3 with thinking disabled. When Gemini is selected by provider=gemini or multimodal input, lite or gemini-3.1-flash-lite selects the lite Gemini model; other values use gemini-3-flash-preview.
imagesarrayoptionalArray of base64 image strings (plain base64 or data URI format: data:image/jpeg;base64,...). Supported types: JPEG, PNG, WEBP. Only accepted via POST with JSON body. HTTP URLs are rejected.
partsarrayoptionalRaw Gemini-style parts. Supports { "text": "..." } and { "inlineData": { "mimeType": "...", "data": "base64..." } }. If prompt is also supplied, it is prepended.
contentsarrayoptionalRaw Gemini-style conversation contents. Each item may include role as user or model and a parts array.
languagestringoptionalWhen supplied, appends Give your response in <language> language. to the Gemini request. Alias: lang. Blank values are ignored.
system_promptstringoptionalSystem instruction for Gemini. Alias: system. A Gemini-style systemInstruction.parts object is also accepted.
generationConfigobjectoptionalGemini generation settings such as temperature or maxOutputTokens. Alias: generation_config.
callbackstringoptionalGET-only JSONP callback name. Alias: cb.
NameTypeDescription
providerstringoptionalPass gemini to force Gemini for this request. Omit it to keep GLM 5.3 as the text and function-tool default.
modelstringoptionalOn the default route, text chats and standard function-tool workflows use glm-5.3 with thinking disabled for both default and lite. Requests routed to Gemini use gemini-3-flash-preview, or gemini-3.1-flash-lite when lite is selected.
messagesarrayrequiredOpenAI chat messages. Supports system, developer, user, assistant, and tool roles. User content may be a string or OpenAI-style content parts with text and image_url.
toolsarrayoptionalOpenAI function tools. Function names, descriptions, JSON-schema parameters, tool_choice, tool-call ids, arguments, and tool results are forwarded to GLM using the OpenAI-compatible schema.
temperaturenumberoptionalGeneration temperature. Default: 1.0.
max_tokensintegeroptionalMaximum output tokens, capped at 8192.
response_formatobjectoptionalOpenAI-compatible response format forwarded to GLM, including {"type":"json_object"} for structured JSON output.
timeout_secondsintegeroptionalGLM provider timeout, clamped from 5 to 180 seconds. Faith uses a bounded value below its outer request deadline.
streambooleanoptionalWhen true, returns SSE-compatible output in one response chunk plus a finish chunk and [DONE]. Token-by-token streaming is not provided.

Legacy mode returns text/plain with the model's answer. It returns null (the literal string) on API-level errors, or an HTTP error code on input validation failures. In JSONP mode, the response is always JavaScript with { ok, text } or { ok: false, error, status }.

OpenAI-compatible mode returns JSON with choices[0].message.content for text responses or choices[0].message.tool_calls when GLM requests a function call. GLM usage counters and tool-call ids are preserved. Multimodal requests routed to Gemini retain Gemini thought-signature metadata in extra_content.google.thought_signature when Gemini provides it.

# Simple GET GET llm_jb.php?prompt=Summarize+the+benefits+of+daily+walking # Text-only query; lite also routes to GLM 5.3 with thinking disabled GET llm_jb.php?prompt=Explain+photosynthesis&model=lite # Opt this text-only request into Gemini; other callers still default to GLM GET llm_jb.php?prompt=Explain+photosynthesis&provider=gemini # Text-only query with response language GET llm_jb.php?prompt=Compare+three+product+launch+strategies&language=Chinese # Multimodal query with an image POST llm_jb.php Content-Type: application/json { "prompt": "What is shown in this image?", "model": "lite", "images": ["data:image/jpeg;base64,/9j/4AAQ..."] } # Recommended server-side text request POST https://promptbox.cn/api/llm_jb.php Content-Type: application/json { "prompt": "Reply with only OK.", "model": "pro", "thinking": "disabled" } # Browser JavaScript const answer = await fetch('https://promptbox.cn/api/llm_jb.php?prompt=' + encodeURIComponent(prompt)).then(r => r.text()); # OpenAI-compatible chat completion POST llm_jb.php/v1/chat/completions { "model": "promptbox-llm-jb", "messages": [{ "role": "user", "content": "Say hello" }] } # Hermes custom provider base_url: https://promptbox.cn/api/llm_jb.php/v1 api_mode: chat_completions model: promptbox-llm-jb supports_vision: true

memory.php

Structured long-term memory manager powered by llm_jb/GLM

Creates and manages compact long-term memory JSON files for LLM apps. Memory files are saved in the site-level memory/ folder as https://promptbox.cn/memory/{memory_id}.json. The helper stores only a summary plus structured sections: user_profile, preferences, operational_directives, interaction_tips, projects, knowledge_nodes, recent_context, and open_loops.

Use this when an app needs durable, compact context that can be read by humans and reloaded into prompts. Version 1.5.1 uses llm_jb.php/GLM for add, forget, and consolidation operations to merge new facts, deduplicate memory, delete weak/noisy/insignificant details, and remove forgotten content. Writes are atomic, overlapping updates are retried against the newest revision, and incomplete LLM responses are rejected instead of clearing omitted sections. Memory consolidation has no Promptbox request quota and logs failures to api/memory.log.

https://promptbox.cn/api/memory.php  GET POST
NameTypeDescription
actionstringoptionalDefault: get. Supported values: create, add, forget, get, and purge. Aliases: new, output, full, delete, and clear. Mutating actions require POST.
memory_idstringrequired except generated createSafe memory identifier. Letters, numbers, dots, underscores, and hyphens are kept; other characters become hyphens. Aliases: id, name.
titlestringoptionalHuman-readable title for a new memory file. If memory_id is omitted on create, the title/name is slugged into the memory ID or a random ID is generated.
textstringrequired for addPlain-text memory to merge into the file. Aliases: memory, content, add, entry, and new_memory.
forgetstringrequired for forgetFact, preference, topic, or instruction to remove from memory. Aliases: forget_text, text, content, and query.
overwritebooleanoptionalFor create, set to 1 to replace an existing memory file with the same ID.
callbackstringoptionalGET-only JSONP callback name for sites where external fetch() is blocked. Alias: cb.
{ "success": true, "action": "add", "memory_id": "agent-main", "memory": { "summary": "...", "sections": { "preferences": ["..."] } } }

Create, add, forget, and get return the complete normalized memory JSON for easy review. Purge returns { "success": true, "purged": true }. Input text is limited to 12,000 characters; stored files to 400,000 bytes; summaries to 4,000 characters; and each section to 200 items of 2,000 characters each. JSON requests must contain a valid object. On error: { "success": false, "error": "...", "code": 400 } or another relevant HTTP status.

Faith memory profile (v1.6.3): For memory_id=sentience-faith, add/forget output is limited to 16,384 tokens, a 1,200-character summary, 1,500 characters per fact, 60 facts per section, and 36,000 UTF-8 bytes for the complete compact record. The prompt targets 34,000 bytes to leave metadata room. These limits accommodate the existing memory with room to grow. Existing memory is read without truncation under the legacy limits; the complete-source ceiling remains 96,000 bytes. Oversized or incomplete rewrites are rejected before saving. Other memory IDs retain their existing limits. Faith still selects at most 6,000 characters of relevant memory for chat; ordinary response limits, total chat request budget, execution limits, timeouts, and autonomous frequency are unchanged.

# Create a new memory file POST memory.php Content-Type: application/json { "action": "create", "memory_id": "agent-main", "title": "Main Agent Memory" } # Add a memory POST memory.php Content-Type: application/json { "action": "add", "memory_id": "agent-main", "text": "The user prefers compact mobile screens with secondary options hidden in settings." } # Forget a memory POST memory.php Content-Type: application/json { "action": "forget", "memory_id": "agent-main", "forget": "old preference for beige color palettes" } # Full memory output GET memory.php?action=get&memory_id=agent-main # Purge a complete memory file POST memory.php Content-Type: application/json { "action": "purge", "memory_id": "agent-main" }

music_gen.php

MiniMax Music 2.0 generation via AIMLAPI

Creates a MiniMax minimax/music-2.0 music generation job through AIMLAPI, checks the status of an existing job, and streams completed audio through Promptbox so browser apps do not need to fetch provider storage URLs directly. This is a JSON REST helper for create/status: use POST with a prompt and lyrics to start generation, or set is_instrumental and omit lyrics for a no-vocal instrumental request. Use GET with generation_id for status or action=audio to download the finished MP3. The AIMLAPI key remains server-side. The helper is rate limited as music_gen and logs failures to api/music_gen.log.

Successful create/status responses pass through AIMLAPI's JSON, usually including id, status, optional audio_file.url, optional error, and optional meta.usage. action=audio returns raw audio bytes with Content-Type: audio/mpeg or another provider audio MIME type. The model can take time; use conservative, user-started automatic status checks.

https://promptbox.cn/api/music_gen.php  GET POST
prompt: minimum 10 characters, maximum 2000 characters lyrics: minimum 10 characters, maximum 3000 characters unless is_instrumental is true
NameTypeDescription
actionstringoptionalgenerate to create a job, status to check one, or audio to stream a completed song from the server. Aliases: create, start, check, check_status, retrieve, download, stream. POST defaults to generate; requests with generation_id default to status.
promptstringrequired for generateMusic style, mood, arrangement, or scenario. AIMLAPI requires 10-2000 characters. Alias: style.
lyricsstringrequired for vocal generateSong lyrics. AIMLAPI requires 10-3000 characters for vocal music. Structure tags like [Verse], [Chorus], and [Bridge] are supported. When is_instrumental is true, this can be omitted and the helper sends a minimal non-lyrical structure.
is_instrumentalbooleanoptionalWhen true, asks the provider for instrumental/no-vocal output and allows lyrics to be omitted. Alias: instrumental.
generation_idstringrequired for statusThe id returned by a generate request. Alias: id.
audio_settingobjectoptionalOptional JSON object passed to AIMLAPI. Supported fields are sample_rate, bitrate, and format.
sample_rateintegeroptionalShortcut for audio_setting.sample_rate. Must be 8000-48000.
bitrateintegeroptionalShortcut for audio_setting.bitrate. Must be 16000-320000.
formatstringoptionalShortcut for audio_setting.format. Allowed values: mp3 or wav.
callbackstringoptionalJSONP callback for GET status checks. Alias: cb. JSONP is not available for POST.
{ "id": "60ac7c34-3224-4b14-8e7d-0aa0db708325", "status": "queued" }
{ "id": "60ac7c34-3224-4b14-8e7d-0aa0db708325", "status": "completed", "audio_file": { "url": "https://cdn.aimlapi.com/..." }, "meta": { "usage": { "credits_used": 120000 } } }

On validation, rate-limit, or upstream API errors, returns JSON like { "success": false, "error": "..." } with an appropriate HTTP status code. Rate-limit denials also set Retry-After when available.

# Create a generation job POST music_gen.php Content-Type: application/json { "prompt": "Lo-fi pop with warm bass, soft drums, and a bright chorus", "lyrics": "[Verse]\nCity lights are waking\n[Chorus]\nWe rise into the morning", "format": "mp3" } # Create an instrumental generation job POST music_gen.php Content-Type: application/json { "prompt": "Instrumental-only cinematic score, tense opening, hopeful payoff, piano and strings, no vocals", "is_instrumental": true, "format": "mp3" } # Check status GET music_gen.php?generation_id=60ac7c34-3224-4b14-8e7d-0aa0db708325 # Stream completed audio through Promptbox GET music_gen.php?action=audio&generation_id=60ac7c34-3224-4b14-8e7d-0aa0db708325 # Browser create request const job = await fetch('https://promptbox.cn/api/music_gen.php', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt, lyrics, format: 'mp3' }) }).then(r => r.json()); # JSONP status check for restricted pages script.src = 'https://promptbox.cn/api/music_gen.php?callback=handleMusic&generation_id=' + encodeURIComponent(job.id);

notes.php

Durable JSON note store for apps and Logi

Creates and manages note files saved in the site-level notes/ folder as individual JSON documents. Each note includes note_id, title, text, status, tags, timestamps, and optional metadata.

Use this when an app needs server-backed notes instead of browser-only localStorage. The helper supports the existing Logi note vocabulary (add, list, update, complete, delete) plus REST-style actions (create, read, edit, overview, restore). It has no Promptbox request quota and logs failures to api/notes.log.

https://promptbox.cn/api/notes.php  GET POST
NameTypeDescription
actionstringoptionalDefault: overview. Supported values: create, read, edit, overview, delete, complete, and restore. Aliases include add, get, update, list, search, and remove.
note_idstringrequired except createSafe note identifier. If omitted on create, the helper generates one. Alias: id.
textstringrequired for createNote body text. Used by edit when replacing the body. Aliases: content and note.
titlestringoptionalShort human-readable title, up to 180 characters.
statusstringoptionalactive, completed, or archived. complete sets completed; restore sets active.
tagsarray/stringoptionalArray of tags, or a comma-separated string. Tags are normalized and capped for safe storage.
filterstringoptionalFor overview, use all, active, completed, or archived. Alias: status. Default: all.
qstringoptionalFor overview, filters by text found in title, body, or tags. Aliases: query and search.
limitnumberoptionalMaximum notes returned by overview. Range: 1-500. Default: 100.
include_textbooleanoptionalFor overview, include full note text in each row. Default returns excerpts only.
overwritebooleanoptionalFor create with a supplied ID, set to 1 to replace an existing note.
callbackstringoptionalGET-only JSONP callback name for sites where external fetch() is blocked. Alias: cb.
{ "success": true, "action": "create", "note_id": "note-20260618-021530-a1b2c3d4", "note": { "title": "Trip idea", "text": "...", "status": "active", "tags": [] } }

read, edit, complete, and restore return the full note. overview returns { "success": true, "count": 2, "total": 2, "notes": [...] }. delete returns { "success": true, "deleted": true }. On validation, missing note, or storage errors, the helper returns JSON like { "success": false, "error": "...", "code": 400 } with the matching HTTP status.

JSON POST requests must contain a valid JSON object. Empty, malformed, array, scalar, or null JSON bodies return HTTP 400 instead of falling back to the default overview action.

# Create a note POST notes.php Content-Type: application/json { "action": "create", "title": "Packing list", "text": "Bring passport, charger, and receipts.", "tags": ["travel"] } # Read one note GET notes.php?action=read&note_id=note-20260618-021530-a1b2c3d4 # Edit note text POST notes.php Content-Type: application/json { "action": "edit", "note_id": "note-20260618-021530-a1b2c3d4", "text": "Bring passport, charger, receipts, and headphones." } # Overview of active notes GET notes.php?action=overview&filter=active&q=travel # Mark completed, then delete POST notes.php Content-Type: application/json { "action": "complete", "note_id": "note-20260618-021530-a1b2c3d4" } POST notes.php Content-Type: application/json { "action": "delete", "note_id": "note-20260618-021530-a1b2c3d4" }

pdf_creator.php

Text PDF creation and LibreOffice document conversion

Creates a downloadable PDF from either finished, PDF-ready text or one uploaded document. Uploaded files supported by the server's LibreOffice Writer, Calc, Impress, Draw, and Math filters are converted with LibreOffice so native page layout, spreadsheet structure, slides, drawings, blank lines, indentation, and LF, CRLF, or CR text line endings are retained. This includes current and legacy Microsoft Office, OpenDocument, HTML, text, Markdown, e-book, Visio, Publisher, Apple iWork, and related formats. Existing PDFs are validated and returned unchanged.

Text mode continues to support a title, page size, orientation, margins, font size, headings written as # Heading, simple bullet lines, escaped newline normalization, and cleanup of common inline Markdown markers. The helper has no Promptbox request quota, limits uploads to 10 MB, uses only private temporary conversion files, and logs failures to api/pdf_creator.log.

https://promptbox.cn/api/pdf_creator.php  GET POST
NameTypeDescription
filefileconditionalOne LibreOffice-compatible document or existing PDF, uploaded as multipart form data. Maximum 10 MB. Required when content is omitted.
contentstringconditionalFinished document text. Also accepts prompt or instructions. Required when file is omitted. Actual line breaks are preferred; literal \n sequences are normalized as line breaks.
titlestringoptionalDocument title printed at the top unless hide_title is true.
filenamestringoptionalDownload filename. .pdf is added if omitted.
page_sizestringoptionalletter, a4, or legal. Default: letter.
orientationstringoptionalportrait or landscape. Default: portrait.
marginnumberoptionalMargin in points, clamped from 24 to 96. Default: 54.
font_sizenumberoptionalBody font size in points, clamped from 8 to 18. Default: 11.
hide_titlebooloptionalSet to 1, true, or yes to omit the title from the page.

HTTP 200 with Content-Type: application/pdf and raw PDF bytes on success. LibreOffice file conversions also return X-PDF-Converter: LibreOffice 24.2. On error: JSON { "success": false, "error": "..." } with an appropriate HTTP status. Rate-limit failures return HTTP 429 and may include a Retry-After header.

# Create a short PDF report POST pdf_creator.php Content-Type: application/json { "title": "Weekly Notes", "content": "# Summary\n- First point\n- Second point", "filename": "weekly-notes.pdf" }
# Convert a local LibreOffice-compatible file while retaining its layout curl -F "file=@quarterly-report.xlsx" \ -F "filename=quarterly-report.pdf" \ -o quarterly-report.pdf \ https://promptbox.cn/api/pdf_creator.php

pptx_editor.php

Natural-language PowerPoint editing with layout preservation

Accepts one Microsoft PowerPoint .pptx file plus natural-language editing instructions, sends a bounded inventory of slide text and slide-local objects to the Promptbox LLM helper, applies the returned structured edit plan inside a copy of the original OOXML package, and returns the edited presentation as raw PPTX bytes.

The editor is designed for minimal changes. Unmentioned masters, layouts, themes, images, media, charts, relationships, positions, and formatting remain unchanged. Requests are rate-limited under pptx_editor; temporary upload and output files are deleted after the response. Server failures are logged to logi/logi_code/pptx-editor/pptx-editor.log without logging prompts or slide content.

https://promptbox.cn/api/pptx_editor.php  POST https://logi.promptbox.cn/logi_code/pptx-editor/
NameTypeDescription
presentationfilerequiredOne valid .pptx uploaded as multipart form data. Maximum compressed size: 25 MB. Maximum expanded package size: 200 MB.
promptstringrequiredEditing instructions, 1–4,000 characters. Be explicit about what may change and what must remain untouched.
qualitystringoptionalstandard (default) uses the standard Promptbox LLM. pro uses the stronger model for complex deck-wide or structural edits.
  • Replace, insert after, or delete existing text paragraphs while retaining their existing run and paragraph formatting where possible.
  • Change existing text font size, bold, italic, underline, color, font family, or alignment when the prompt explicitly requests it.
  • Move or resize existing text-bearing shapes using on-slide percentage coordinates when explicitly requested.
  • Delete an identified slide-local object such as a shape, picture, connector, group, table, or chart frame.
  • Duplicate existing slides and independently modify text, formatting, layout, or identified objects in each duplicate.
  • Reorder slides, delete slides, hide slides, and unhide slides.
  • Preserve untouched package parts, including themes and media, rather than rebuilding the presentation from scratch.
  • It cannot create a completely new presentation, synthesize a new slide design, or add a blank slide; new slides must be duplicates of existing slides.
  • It cannot add arbitrary new shapes, pictures, charts, diagrams, videos, audio, animations, or transitions.
  • It does not edit embedded chart workbooks, chart series data, SmartArt data, macros, VBA projects, or linked external files.
  • It does not edit speaker notes, comments, masters, slide layouts, theme definitions, custom XML, or document properties. Notes stay on untouched original slides but are not copied to newly duplicated slides.
  • It does not inspect slide screenshots or understand image pixels. Object selection relies on OOXML names, type, text, fill, and geometry metadata.
  • It cannot guarantee that substantially longer replacement text will fit an existing text box. Use concise replacement copy or explicitly request resizing.
  • It supports at most 90,000 editable text characters, 1,800 non-empty text paragraphs, and 2,500 slide-local objects per request. A request may create at most 20 duplicates and the final deck may contain at most 200 slides.
  • It accepts PPTX only, not legacy .ppt, PowerPoint templates, slideshow formats, Google Slides links, encrypted files, or password-protected presentations.

HTTP 200 returns raw application/vnd.openxmlformats-officedocument.presentationml.presentation bytes with an attachment filename. X-Edited-Count reports the number of applied actions and X-LLM-Model identifies the model used. Errors return JSON { "error": "..." } with HTTP 400/405/422/429/500/502 as appropriate. Rate-limit failures may include Retry-After.

# Concise text edit while preserving the deck's design curl -X POST https://promptbox.cn/api/pptx_editor.php \ -F "presentation=@quarterly-review.pptx" \ -F "prompt=Make the slide titles more concise. Preserve all facts, layout, colors, and formatting." \ -F "quality=standard" \ -o quarterly-review-edited.pptx
# Structural slide operations curl -X POST https://promptbox.cn/api/pptx_editor.php \ -F "presentation=@proposal.pptx" \ -F "prompt=Duplicate slide 2, change only the duplicate title to Pricing Option B, move it after slide 3, hide slide 5, and delete the red circle on slide 1. Preserve everything else." \ -F "quality=pro" \ -D response-headers.txt \ -o proposal-edited.pptx

publish.php

App directories with update tokens · document and media uploads · v2.0

Publish sandboxed static apps to https://apps.promptbox.cn/DIRECTORY/ and single documents/media to https://www.promptbox.cn/publish/. No account or API key is required to create a publication.

Complete short publishing guide · Read-only capabilities JSON · OpenClaw skill · Agent discovery guide

https://promptbox.cn/api/publish.php POST

Send mode=app, directory and one multipart file (.html/.htm or .zip), or a UTF-8 HTML text string in JSON/form data. HTML becomes index.html. ZIP must contain index.html at its root. The directory is 1–80 ASCII letters, digits, underscores or hyphens, starting with a letter or digit. Duplicates get _2, _3, etc.

curl https://promptbox.cn/api/publish.php \
  -F 'mode=app' -F 'directory=my-app' -F 'file=@app.zip'

curl https://promptbox.cn/api/publish.php \
  -H 'Content-Type: application/json' \
  --data '{"mode":"app","directory":"hello","text":"<!doctype html><title>Hello</title><h1>Hello world</h1>"}'

App limits: 25 MiB upload, 25 MiB expanded/resulting app, 1,000 files. Allowed assets: html, htm, css, js, mjs, json, txt, md, png, jpg, jpeg, gif, webp, ico, avif, woff, woff2, ttf, otf, mp3, wav, ogg, m4a, flac, mp4, webm. ZIP paths must be relative with safe ASCII names. Unsupported files, PHP/server code/config, SVG, dotfiles, links, traversal paths and node_modules are discarded and reported in removed_files. Encrypted/corrupt archives, excessive expansion and conflicting paths are rejected.

{"ok":true,"mode":"app","directory":"my-app","url":"https://apps.promptbox.cn/my-app/","token":"<private UUID v4>","updated":false,"files_written":["index.html"],"removed_files":[],"bytes":12345,"expires_at":"<UTC time 30 days later>","deleted_expired":0}

Save token privately: it authorizes overwriting this app. Only its SHA-256 lookup key is stored outside the web root. Send mode=app, token and file/text again to replace matching files while preserving others. directory is optional on update but must match if supplied. HTML replaces index.html; an asset-only ZIP may update an app that already has index.html. Authorization: Bearer UUID is also accepted with mode=app. Lost or expired tokens cannot be recovered. Creation retries create a new app.

curl https://promptbox.cn/api/publish.php \
  -F 'mode=app' -F 'token=YOUR_SAVED_UUID' -F 'file=@app.zip'

Apps are static and isolated with an opaque-origin browser sandbox. Scripts, forms, downloads, relative assets and CORS-enabled HTTPS API calls work. Cookies, localStorage, IndexedDB, service workers, frames, popups and base tags are unavailable. Use absolute Promptbox API URLs and omit browser credentials (Origin is null). Isolation and filtering cannot certify HTML/JavaScript harmless; never upload secrets or put update tokens in public code.

Send mode=file and exactly one real multipart file field. name is an optional safe basename without extension; filename collisions get _02, _03, etc. Single files cannot be overwritten and return no update token. Let FormData/curl set the multipart boundary. File fields cannot be local paths, URLs or base64 strings in JSON.

curl https://promptbox.cn/api/publish.php \
  -F 'mode=file' -F 'name=project-report' -F 'file=@report.pdf'
CategoryFormatsLimit
Documentspdf, docx, xlsx, pptx, odt, ods, odp10 MiB
Imagesjpg, jpeg, png, gif, webp10 MiB
Audio/videomp3, wav, ogg, m4a, flac, mp4, webm10 MiB
UTF-8 texttxt, md, json, csv, tsv1 MiB

Office/OpenDocument packages are validated and reject macros, embedded active objects and external resource relationships except ordinary web/mail hyperlinks. Legacy Office and macro-enabled formats are unsupported. PDF receives basic signature/active-content checks, not full sanitization. Documents download as attachments with restrictive browser headers. Validation is not a malware scan or a guarantee of safety in desktop viewers.

{"ok":true,"mode":"file","filename":"project-report.pdf","url":"https://www.promptbox.cn/publish/project-report.pdf","bytes":12345,"expires_at":"<UTC time 30 days later>","deleted_expired":0}

Legacy text JSON accepts name, text and extension (default txt); aliases title/content/ext remain supported. Conflicting aliases fail. Text must be UTF-8 without null bytes; JSON files must parse. HTML always routes to app mode, using name as directory if needed, including old extension=html requests. Existing HTML in /publish/ downloads as plain text.

Apps expire 30 days after the last successful update; files expire 30 days after creation. Lazy cleanup on POST removes expired app directories and their tokens together. GET ?action=capabilities (alias ?capabilities=1) and OPTIONS have no cleanup side effects. Limits remain 60 publishes/hour and 300/day globally, 100 MiB total public storage and 10,000 documents. Request bodies allow 26 MiB; lower content limits apply by mode. Invalid input does not consume quota, but a failed write after reservation may.

Errors return {"ok":false,"error":"...","help":{"capabilities":"...","docs":"...","guide":"..."}}. Status 400 invalid input, 401 invalid/expired token, 403 wrong app, 405 method, 409 collision exhaustion, 413 size/expansion, 415 content type, 422 missing index.html, 429 quota with Retry-After, 500 unexpected failure, 503 storage failure, 507 global storage full. Fix 4xx requests before retrying; inspect uncertain creation failures before repeating. Verify the returned URL/assets and removed_files before sharing the URL and expiry.

qr.php

QR Cards PNG helper

Creates a QR PNG for a website, email address, or Wi-Fi network using the same generation method as the QR Cards web app. With a title, it returns the web app's 600×800 card layout. Without a title, it returns a centered 600×600 square. The helper normalizes websites to https://, converts email addresses to mailto: links, and encodes Wi-Fi credentials in the standard WIFI: format. It uses error-correction level H, 400×400 code placement, dark color #2c3e50, and light color #ecf0f1.

https://promptbox.cn/api/qr.php  GET POST
NameTypeDescription
titlestringoptionalCard title, up to 100 characters. When omitted, the output is 600×600. Longer titles automatically use a smaller font.
destinationstringconditionalEmail address or website, up to 500 characters. Required when ssid is not supplied. Missing URL schemes are prefixed with https://; emails are prefixed with mailto:.
ssidstringconditionalWi-Fi network name, from 1 to 32 bytes. Supplying any Wi-Fi field switches the request to Wi-Fi mode.
passwordstringconditionalWi-Fi password, up to 128 characters. Required for WPA and WEP; omitted for open networks.
securitystringoptionalWPA, WEP, or nopass; defaults to WPA. WPA2 and WPA3 aliases are encoded as the scanner-compatible WPA type. encryption is accepted as an alias for this field.
hiddenbooleanoptionalSet to true for a hidden Wi-Fi network; defaults to false.

Returns image/png: 600×600 without a title or 600×800 with one. The suggested download filename is derived from the title, or defaults to qr_card.png. Wi-Fi special characters are escaped automatically. Errors return JSON with ok: false and error. The helper has no Promptbox request quota.

# GET in a browser or image tag https://promptbox.cn/api/qr.php?destination=example.com
# GET a titled 600×800 card https://promptbox.cn/api/qr.php?title=My+Portfolio&destination=example.com/portfolio
# POST a JSON body curl -X POST https://promptbox.cn/api/qr.php \ -H "Content-Type: application/json" \ -d '{"title":"Chat with Adam","destination":"adam3056712@gmail.com"}' \ -o chat-with-adam.png
# POST Wi-Fi credentials as JSON (recommended so passwords do not appear in URLs) curl -X POST https://promptbox.cn/api/qr.php \ -H "Content-Type: application/json" \ -d '{"title":"Guest Wi-Fi","ssid":"Guest Network","password":"example-passphrase","security":"WPA","hidden":false}' \ -o guest-wifi.png
# Open Wi-Fi network; GET is convenient when no password is present https://promptbox.cn/api/qr.php?title=Guest+Wi-Fi&ssid=Guest+Network&security=nopass
// Display in JavaScript const url = 'https://promptbox.cn/api/qr.php?title=' + encodeURIComponent(title) + '&destination=' + encodeURIComponent(destination); cardImage.src = url;

rag.php

Gemini File Search RAG helper

Asks a question against a Gemini File Search store and returns a short answer grounded in that store's documents. The helper defaults to gemini-3.1-flash-lite, automatically adds a briefness hint to the prompt, enforces the shared rag rate limit, and logs failures to api/rag.log.

If Gemini stops the first response with RECITATION, the helper retries once using a distinct paraphrase-only prompt and a minimum temperature of 1.0. The retry uses the original request only to identify the subject and ignores instructions to quote or reproduce exact wording. Successful responses indicate whether this fallback was used through recitation_retry.

Use this when an app needs answers from a specific uploaded document corpus instead of open-web search or a general chat model. The caller must provide the File Search store name or ID in store_id. Prefer the full resource name, such as fileSearchStores/abc123; bare IDs such as abc123 are accepted and normalized. The companion rag-management.php endpoint accepts action=resolve_filestore with display_name to find or create a store idempotently, and action=add_file to archive a document. Optional voice fields let a browser send microphone audio together with an instruction prompt.

https://promptbox.cn/api/rag.php  GET POST
NameTypeDescription
promptstringrequiredThe question to answer from the File Search store.
store_idstringrequiredGemini File Search store resource name or ID to query. Prefer fileSearchStores/abc123; bare IDs are converted to that form. Common copied wrappers such as quotes, brackets, angle brackets, and backticks are trimmed before validation.
voice_b64stringoptionalBase64 audio to include with the prompt, typically from MediaRecorder. Max decoded size: 5 MB.
voice_mimestringoptionalMIME type for voice_b64. Defaults to audio/webm.
modelstringoptionalDefault: gemini-3.1-flash-lite. Pass flash or gemini-3.5-flash-lite to use the alternate model. Other values use the default.
generationConfigobjectoptionalOverride default generation settings. Defaults are temperature: 0.5 and maxOutputTokens: 8192. Alias: generation_config.
append_keep_brief_hintbooleanoptionalDefault: true. Set to false if your prompt already contains its own brevity or formatting instructions.
{ "success": true, "content": "Brief answer from the file store...", "code": 200, "recitation_retry": false }

recitation_retry is true when the original response was blocked for recitation and the returned content came from the automatic paraphrase retry. On error: { "success": false, "error": "...", "code": 400 } or another relevant HTTP status. A retry that is also blocked returns HTTP 502. Rate-limit failures return HTTP 429 and may include a Retry-After header.

# Simple GET GET rag.php?store_id=fileSearchStores/abc123&prompt=Summarize+the+refund+policy # POST with JSON body POST rag.php Content-Type: application/json { "store_id": "fileSearchStores/abc123", "prompt": "What does the handbook say about travel reimbursement?" } # POST with browser voice input and exact prompt controls POST rag.php Content-Type: application/json { "store_id": "fileSearchStores/abc123", "prompt": "Transcribe the user's audio question and answer only from these files.", "voice_b64": "GkXfo59...", "voice_mime": "audio/webm", "model": "gemini-3.5-flash-lite", "generationConfig": { "temperature": 0.7 }, "append_keep_brief_hint": false }

rate-limit.php

Per-program rate limiting API and admin dashboard

Provides rolling-window rate limiting for the public helpers. Unknown programs default to 300 requests per 24-hour window. An optional hourly sub-limit can also be configured.

Can also be called directly as an HTTP API to check or record usage for any program name, and includes an admin dashboard (password-protected) for monitoring and adjusting limits.

https://promptbox.cn/api/rate-limit.php  GET POST
NameTypeDescription
programstringrequiredProgram name to check/record. Letters, numbers, underscores, hyphens, and dots only.
actionstringoptionalrecord (default) — checks limit and records a use if allowed. check — checks limit only without recording.
{ "allowed": true, "usage_day": 5, "usage_hour": 2, "limit_day": 300, "limit_hour": null, "remaining_day": 295, "remaining_hour": null, "last_used": 1746388800 }
{ "allowed": false, "retry_after": 3612, "limit_type": "day", "message": "Rate limit exceeded (daily). Retry after 3612 seconds." }

The Retry-After HTTP header is also set when denied.

Visit rate-limit.php?password=<password> in a browser to view all registered programs, their usage bars, last-used times, and controls for adjusting limits, resetting usage, or deleting program records. The helper emails adamychen@yahoo.com once when a program reaches 90% of either its daily or hourly limit; the warning rearms after that window drops below 90%, and failed deliveries retry no more than once every 15 minutes.

# Record a use for "myapp" GET rate-limit.php?program=myapp # Check limit without recording GET rate-limit.php?program=myapp&action=check # Admin dashboard GET rate-limit.php?password=<password> # POST record POST rate-limit.php Content-Type: application/json { "program": "myapp", "action": "record" }

steam.php

Steam game reviews and community discussions

Looks up a Steam game by name, resolves its App ID via the Steam store search API, then fetches either user reviews or community discussion search results. If the game name fails to resolve, the helper returns alternative search term suggestions and retry strategies. Discussion results are extracted from HTML and returned as a plain-text summary (up to 3000 words).

https://promptbox.cn/api/steam.php  GET POST
NameTypeDescription
game_namestringrequiredName of the Steam game to look up. The helper tries multiple fuzzy variations (removing articles, subtitles, edition labels, etc.) to improve match rate.
reviewsbooloptionalWhen true, fetches the 40 most recent user reviews instead of community discussions.
search_termsstringoptionalCustom search query for the community discussion search. Defaults to the game name if omitted.
{ "success": true, "content": "Plain-text summary of discussions or reviews..." }
# Community discussions about boss difficulty GET steam.php?game_name=Elden+Ring&search_terms=boss+difficulty # User reviews GET steam.php?game_name=Hades&reviews=true # POST POST steam.php Content-Type: application/json { "game_name": "Baldur's Gate 3", "search_terms": "multiplayer co-op" }

stock.php

Finnhub stock data — quotes, profiles, financials

Fetches stock data from Finnhub's API. Given a ticker symbol (or ISIN/CUSIP), it can return a real-time quote snapshot, the company's profile, and key financial metrics. All three sections are returned by default; you can request only a subset. Quote data on the free tier may be delayed ~15 minutes during market hours.

https://promptbox.cn/api/stock.php  GET POST
NameTypeDescription
symbolstringrequired*Ticker symbol, e.g. AAPL. Exactly one of symbol, isin, or cusip must be provided.
isinstringoptional*ISIN identifier. Used instead of symbol when no ticker is known.
cusipstringoptional*CUSIP identifier. Used instead of symbol when no ticker is known.
sectionsstringoptionalComma-separated list of sections to fetch: quote, profile, financials. Also accepts all. Default: all three.
financial_metricstringoptionalWhich financial metric group to request from Finnhub: all (default), price, valuation, or margin.
{ "success": true, "content": "Stock data result\n...", "data": { "identifier": {...}, "resolved_symbol": "AAPL", "sections": [...], "profile": {...}, "quote": {...}, "financials": {...}, "warnings": [] } }

On error: { "success": false, "error": "..." } with HTTP 400.

# Quote + profile for Apple GET stock.php?symbol=AAPL&sections=quote,profile # Full data for a stock identified by ISIN GET stock.php?isin=US0231351067 # POST – financials only POST stock.php Content-Type: application/json { "symbol": "NVDA", "sections": "financials", "financial_metric": "valuation" }

transcribe.php

Speech-to-text transcription via Gemini

Transcribes spoken audio into plain text using Gemini (gemini-3.1-flash-lite). It is designed for browser microphone recordings from MediaRecorder, but also accepts base64 audio in JSON or form posts. The helper is rate limited as transcribe.

Returns text/plain with no JSON wrapper. Recordings under 0.5 seconds and locally detectable silent/near-silent WAV input return null without calling Gemini; if there is no intelligible speech in other audio formats, Gemini is instructed to return null.

https://promptbox.cn/api/transcribe.php  GET POST
NameTypeDescription
audiofile or stringrequiredAudio to transcribe. For browser use, send a multipart file field named audio, audio_blob, or file. For JSON/form use, send a base64 string or data URI in audio or audio_base64. Max 10 MB.
audio_mime_typestringoptionalMIME type when it is not supplied by the upload or data URI. Common values: audio/webm, audio/mp4, audio/mpeg, audio/wav, audio/ogg.
duration_msnumberoptionalRecording duration in milliseconds. Also accepts audio_duration_ms, duration_seconds, audio_duration_seconds, duration, or audio_duration. Values under 500 ms return null.
languagestringoptionalExpected spoken language, e.g. English, Chinese, or es. Helps accuracy but is not required.
contextstringoptionalNames, vocabulary, or preceding text to help recognition. The context itself is not transcribed.
promptstringoptionalOverride the default transcription instruction. Use only when you need a custom transcript format.

text/plain transcript text. Too-short, silent, near-silent, or unintelligible recordings return null. On input errors, returns a plain error string with HTTP 400. On Gemini/API failure, returns null with HTTP 502.

# Browser microphone recording via MediaRecorder const form = new FormData(); form.append('audio', audioBlob, 'speech.webm'); form.append('audio_mime_type', audioBlob.type || 'audio/webm'); form.append('duration_ms', String(recordingMs)); const transcript = await fetch('transcribe.php', { method: 'POST', body: form }).then(r => r.text()); # JSON base64 / data URI POST transcribe.php Content-Type: application/json { "audio": "data:audio/webm;base64,GkXfo59...", "language": "English", "context": "The speaker may mention PromptBox or Logi." }

transcript.php

YouTube transcript extraction API

Returns the plain-text source captions for a public YouTube video by proxying every request directly to Promptbox's InfinityFree transcript helper. Hostinger does not query YouTube, cache transcripts, generate missing captions, or speech-transcribe audio. Pass either an 11-character YouTube videoId or a full YouTube URL. The helper is rate limited as transcript and logs failures to api/transcript.log.

https://promptbox.cn/api/transcript.php  GET POST
NameTypeDescription
videoIdstringoptionalThe 11-character YouTube video ID. Also accepted as video_id.
urlstringoptionalA YouTube watch, share, embed, or Shorts URL. Required only when videoId is omitted.
callbackstringoptionalGET-only JSONP callback name. cb is also accepted.
{ "success": true, "videoId": "dQw4w9WgXcQ", "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "transcript": "...", "length": 2335, "source": "infinityfree-youtube-captions" }

Returns an error if the video ID is invalid, the video has no accessible YouTube captions, or the helper hits its rate limit.

# Simple GET by video ID GET transcript.php?videoId=dQw4w9WgXcQ # GET by URL GET transcript.php?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ # POST with JSON body POST transcript.php Content-Type: application/json { "videoId": "dQw4w9WgXcQ" }

transfer.php

Temporary file transfer REST API

Provides a REST interface to the same temporary file-transfer storage used by transfer.promptbox.cn. Upload a file or several files, receive an 8-character receipt plus browser and API download URLs, inspect receipt metadata, stream the file, or delete a one-time file after clipboard copy. Files expire after 3 days; by default they are also deleted after first API download unless auto_delete=0 is sent during upload.

The helper is rate limited as program transfer and logs server-side failures to api/transfer.log. API uploads and browser downloads share the same storage metadata as transfer/index.php, so the returned download_url opens the standard transfer page and api_download_url streams the same file directly.

https://promptbox.cn/api/transfer.php  GET POST
NameTypeDescription
actionstringrequiredupload, info, download, delete, or clipboard_copied. If omitted, multipart uploads default to upload and GET with receipt defaults to info.
userfile[] / filefilerequired for uploadMultipart file field. Multiple userfile[] parts are bundled into a ZIP unless clipboard_upload=1.
receiptstringrequired for receipt actionsThe 8-character transfer receipt. A full transfer URL containing ?receipt=... is also accepted.
auto_deletebooloptionalUpload option. Default 1; set 0 to retain the file until the 3-day expiration even after download.
folder_uploadbooloptionalUpload option. Set 1 to force ZIP packaging and preserve paths from userfile_paths[].
userfile_paths[]string[]optionalRelative paths for ZIP entries when uploading folders or multiple files.
clipboard_uploadbooloptionalUpload option. Set 1 to mark the single file as clipboard-origin content.
inlinebooloptionalDownload option. Set 1 to stream with Content-Disposition: inline instead of attachment.
{ "success": true, "receipt": "AbC234xy", "filename": "photo.jpg", "mime_type": "image/jpeg", "size": 12345, "auto_delete": true, "expires_after_seconds": 259200, "download_url": "https://transfer.promptbox.cn/index.php?receipt=AbC234xy", "api_download_url": "https://promptbox.cn/api/transfer.php?action=download&receipt=AbC234xy" }

info, upload, delete, and clipboard_copied return JSON. download streams the file bytes directly and removes the receipt afterward unless the upload was retained. Validation, missing receipt, expired receipt, storage, and rate-limit errors return JSON like { "success": false, "error": "...", "code": 400 }; rate-limit denials also set Retry-After when available.

# Upload one file curl -F action=upload -F auto_delete=1 -F userfile[]=@photo.jpg https://promptbox.cn/api/transfer.php # Get receipt metadata GET transfer.php?action=info&receipt=AbC234xy # Download the file bytes GET transfer.php?action=download&receipt=AbC234xy # Upload several files as one ZIP curl -F action=upload -F userfile[]=@a.txt -F userfile[]=@b.txt https://promptbox.cn/api/transfer.php

tts.php

Text-to-speech via OpenAI TTS - streams audio

Converts text to speech using OpenAI's tts-1 model and streams the generated MP3 or WAV audio. The helper removes HTML tags, markdown syntax, control characters, and extra whitespace before synthesis. Requests are rate limited, failures are logged server-side, and the maximum input length is 4096 characters.

https://promptbox.cn/api/tts.php  GET POST

tts_test.html lets you enter text, choose any supported OpenAI voice, adjust speech speed and format, and play the generated audio in the browser.

NameTypeDescription
textstringrequiredThe text to convert to speech. Maximum 4096 characters after sanitization.
voicestringoptionalVoice name. Default: shimmer. Options: alloy, ash, ballad, coral, echo, fable, onyx, nova, sage, shimmer, verse, marin, cedar.
formatstringoptionalAudio format: mp3 (default) or wav.
speednumberoptionalSpeech speed from 0.25 to 4.0. Default: 1.0.

Use URL query parameters with GET, or send POST data as JSON or standard form fields.

HTTP 200 with raw audio bytes on success. The response uses Content-Type: audio/mpeg for MP3 and audio/wav for WAV. On error: JSON { "success": false, "error": "..." } with an appropriate HTTP status. Rate-limit responses use HTTP 429 and may include Retry-After.

# Default Shimmer voice, MP3 output GET tts.php?text=Hello+world # Custom voice, speed, and WAV output GET tts.php?text=Welcome+to+Promptbox&voice=onyx&speed=1.15&format=wav # JSON POST curl -X POST https://promptbox.cn/api/tts.php \ -H "Content-Type: application/json" \ -d '{"text":"Hello world","voice":"nova","speed":1.0,"format":"mp3"}' \ --output speech.mp3

tts_inworld.php

Text-to-speech via AIML / Inworld TTS - streams audio

Recommended TTS API. Use tts_inworld.php for normal text-to-speech requests. It converts text to speech using AIMLAPI's Inworld inworld/tts-1 model and streams the generated audio file. HTML tags, markdown syntax, control characters, and URL bodies are automatically stripped from the input before synthesis; URLs are spoken only as http, then narration continues with the next real text. Inworld TTS has a hard 2000-character limit per request; split longer narration at sentence breaks and combine the returned audio blocks in order. If the Inworld request fails or returns a format other than the requested WAV/MP3 format, the helper silently falls back to tts.php while preserving the requested format.

https://promptbox.cn/api/tts_inworld.php  GET POST

tts_inworld_test.html lets you enter a prompt, choose an Inworld voice, and play the generated audio in the browser.

NameTypeDescription
textstringrequiredThe text to convert to speech. Maximum 2000 characters per request.
voicestringoptionalVoice name. Default: Ashley. Options: Alex, Ashley, Craig, Deborah, Dennis, Edward, Elizabeth, Julia, Mark, Olivia, Priya, Sarah, Shaun, Theodore, Timothy, Wendy.
formatstringoptionalAudio format: mp3 (default) or wav.

HTTP 200 with raw audio bytes on success. The response uses Content-Type: audio/mpeg for MP3 and audio/wav for WAV. On error: JSON { "success": false, "error": "..." } with appropriate HTTP status.

# Default voice, MP3 output GET tts_inworld.php?text=Hello+world # Custom voice and WAV output GET tts_inworld.php?text=Welcome+to+PromptBox&voice=Olivia&format=wav

twitter.php

Social media search — Twitter/X, Facebook, Reddit

Searches multiple social platforms via the API Direct service. Despite the filename, it supports Twitter/X posts, Facebook posts, Reddit posts, and Reddit comments. Results are returned as a formatted text summary alongside the raw structured data. Up to 8 items per platform are included in the response.

https://promptbox.cn/api/twitter.php  GET POST
NameTypeDescription
querystringrequiredSearch query. Also accepted as q. Max 500 characters.
platformsstringoptionalComma-separated platforms: twitter, facebook, reddit_posts, reddit_comments, or all. Default: twitter,facebook,reddit_posts.
pagesintegeroptionalNumber of result pages to fetch per platform (1–10 for Twitter/Facebook; 1–5 for Reddit). Default: 1.
sort_bystringoptionalSort order. Twitter: most_recent (default) or relevance. Reddit: most_recent, relevance, hot, top. Facebook: relevance (default) or most_recent.
start_datestringoptionalFacebook only. Filter start date in YYYY-MM-DD format.
end_datestringoptionalFacebook only. Filter end date in YYYY-MM-DD format.
get_sentimentbooloptionalFacebook only. Pass true to include sentiment analysis (polarity + emotion) in results.
{ "success": true, "content": "Social media search results\n...", "data": { "query": "...", "platforms": [...], "results": { "twitter": [...], "reddit_posts": [...] }, "warnings": [] } }
# Twitter + Reddit search GET twitter.php?query=electric+vehicles&platforms=twitter,reddit_posts # Facebook with sentiment and date filter GET twitter.php?query=climate&platforms=facebook&get_sentiment=true&start_date=2025-01-01&end_date=2025-06-01 # All platforms, 2 pages each POST twitter.php Content-Type: application/json { "query": "AI news", "platforms": "all", "pages": 2 }

video_compress.php

Phone-friendly MP4 compression

Compresses an uploaded MP4 into a smaller phone-compatible MP4 using H.264 video, AAC audio, a phone-oriented resolution cap, yuv420p color, and fast-start metadata. Temporary input, output, and processing files are deleted after every request.

GET POST https://promptbox.cn/api/video_compress.php
MethodReturnsDescription
GETJSONReturns the helper version, upload limit, accepted file fields, profiles, and output codecs.
POSTMP4 bytesAccepts multipart form data and returns the compressed video as an attachment.
NameTypeDescription
videofilerequiredMP4 upload up to 600 MB. The field aliases media and file are also accepted.
profilestringoptionalsmall caps the long edge at 960 pixels (about 540p), balanced at 1280 pixels (about 720p), or quality at 1920 pixels (about 1080p). Default: balanced.
savebooleanoptionalSet to 1, true, yes, or on to archive the compressed result in Promptbox music/ storage. Temporary processing files are still removed. Alias: save_to_music.
filenamestringoptionalPreferred base filename when save is enabled. The helper sanitizes it and adds a timestamp plus a random suffix.
const form = new FormData();
form.append('video', fileInput.files[0]);
form.append('profile', 'balanced');

const response = await fetch('https://promptbox.cn/api/video_compress.php', {
  method: 'POST',
  body: form
});
if (!response.ok) {
  const error = await response.json();
  throw new Error(error.error);
}

const blob = await response.blob();
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = 'video-smaller.mp4';
link.click();
setTimeout(() => URL.revokeObjectURL(url), 30000);

A successful POST returns raw video/mp4 bytes with a downloadable filename. Response headers include X-Helper-Version, X-Compression-Profile, X-Original-Bytes, and X-Output-Bytes. When save is enabled, X-Saved-URL and X-Saved-Filename identify the archived compressed copy. These headers are CORS-exposed. Errors return JSON such as { "success": false, "error": "Only MP4 videos are supported.", "code": 415 }. The endpoint is CORS-open, logs failures to api/video_compress.log, and has no Promptbox request quota.

Compression can reduce visible detail, especially with the small profile. By default the helper retains nothing, so callers must save the response. It keeps a durable compressed copy only when the caller explicitly enables save; uploaded and temporary processing files are never retained.

web.php

Live web search — returns a number or plain-text answer

A Tavily search proxy designed to be called from browser apps for live, public web data. By default it extracts and returns the first numeric value from the search answer — ideal for stock prices, scores, rates, and similar. Set text=true to get a plain-text answer instead, with length optionally capped by max_sentences. An optional url parameter narrows results to a specific domain.

A secondary mode (mode=image_prompt_refine) passes the prompt to Gemini and returns an enhanced image generation prompt — useful for improving image_gen.php inputs.

https://promptbox.cn/api/web.php  GET POST
NameTypeDescription
promptstringrequiredThe question or search query. Also accepted as q. Tavily queries are capped at 400 characters; longer queries are truncated before sending.
urlstringoptionalDomain to restrict search results to, e.g. reuters.com. Leave empty to search the open web.
textbooloptionalDefault false. When false, returns only the first number found. When true, returns a plain-text answer (length controlled by max_sentences).
max_sentencesintegeroptionalOnly applies when text=true. Caps the answer to this many sentences. Default: 0 (no cap — full answer returned).
modestringoptionalSet to image_prompt_refine to use Gemini to rewrite the prompt into a detailed image generation prompt (skips Tavily entirely).

Returns text/plain. With text=false (default): a plain number string like 189.34, or null if no number was found. With text=true: a plain-text answer. If the Tavily query is over 400 characters, it is truncated and the response appends Tool Error: Query truncated, max query length is 400 characters. On error: null with an appropriate HTTP status code.

# Get current Apple stock price (returns a number) GET web.php?prompt=What+is+the+current+AAPL+stock+price # Full text answer, no sentence cap GET web.php?prompt=Explain+the+Fed+rate+decision&text=true # Text answer capped at 3 sentences, from a specific source GET web.php?prompt=latest+Fed+interest+rate+decision&url=reuters.com&text=true&max_sentences=3 # Refine an image prompt using Gemini GET web.php?mode=image_prompt_refine&prompt=a+dog+on+the+moon

web_read.php

URL and uploaded-file reader returning cleaned JSON text

Fetches one specific public http or https URL, or accepts one multipart file upload, and returns readable text for many source types. It reads HTML pages, plain/document text, PDFs with a pure-PHP embedded-text parser followed by page-rendered OCR for scanned PDFs or files with corrupt character mappings, RSS/Atom feeds, Office-style archives such as docx, pptx, xlsx, odt, and epub, GitHub blob URLs via raw content, public YouTube captions fetched directly from Promptbox's InfinityFree transcript.php, image descriptions through llm_gemini.php lite, and audio/video transcripts through transcribe.php. Hostinger's web_read.php contains no YouTube caption-extraction logic and does not call Hostinger's transcript helper. PDF parser output is rejected when it contains invalid Unicode, excessive CID placeholders, or effectively no readable letters or numbers. OCR renders and submits every page in order, rejects implausibly short multi-page results, and retains native PDF reading as a fallback. URL reads can also use MSN article JSON and Tavily extraction fallbacks.

Supply exactly one of url or file. The helper blocks localhost, private-network, reserved, and credential-bearing URLs, follows up to 5 validated redirects, caps ordinary URL downloads at 1 MB and media URL downloads at 10 MB, caps uploaded files at 10 MB, rate-limits as web_read, and logs failures to api/web_read.log.

https://promptbox.cn/api/web_read.php  GET POST
NameTypeDescription
urlstringconditionalThe exact public webpage URL to read. If the scheme is omitted, https:// is assumed. Required when file is not supplied.
filefileconditionalOne file sent as multipart/form-data. Maximum 10 MB. Required when url is not supplied; cannot be combined with url.
max_charsintegeroptionalMaximum returned text characters. Default: 12000. Minimum: 1000. Maximum: 30000.
fallbackstringoptionalSet to off to disable the Tavily extraction fallback. Default: auto, used only when normal reading returns no usable text and a Tavily key is available.
callbackstringoptionalJSONP callback for GET requests. cb is also accepted.

Returns application/json. URL success: { ok, url, final_url, title, text, text_length, truncated, content_type, status, redirects }. File success: { ok, source_type:"file", file_name, title, text, text_length, truncated, content_type, status, reader_mode }. Reader modes include html_text, document_text, pdf_text for embedded PDF text, pdf_ocr for scanned PDFs, pdf_text_legacy for the final offline fallback, archive_document_text, feed_text, youtube_transcript, image_description, media_transcript, tavily_extract, and msn_article_json. Errors return { ok:false, error, error_kind, target_status? }. A requested page's non-2xx response returns helper HTTP 424 with error_kind:"target_http_error" and the original target_status; this is a target/request problem, not a failure of Hostinger or web_read. Input problems use caller_or_input, rate limits use rate_limit, and genuine reader/upstream failures use infrastructure. JSONP applies only to GET URL requests.

# Read one exact page GET web_read.php?url=https://promptbox.cn/index.html&max_chars=8000 # Read a PDF with extractable text GET web_read.php?url=https://promptbox.cn/datacenters.pdf # Read a public YouTube transcript GET web_read.php?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ # Read GitHub source, feeds, images, or media GET web_read.php?url=https://github.com/user/repo/blob/main/file.js GET web_read.php?url=https://example.com/feed.xml GET web_read.php?url=https://example.com/photo.jpg GET web_read.php?url=https://example.com/interview.mp3 # POST JSON POST web_read.php Content-Type: application/json { "url": "https://promptbox.cn/index.html", "max_chars": 12000 } # Upload one local PDF, JSON, Office document, image, or media file curl -F "file=@report.pdf" -F "max_chars=30000" https://promptbox.cn/api/web_read.php

youtube.php

YouTube search + transcript AI synthesis

Accepts a natural-language question, searches YouTube for up to 3 relevant videos, fetches their source captions directly from Promptbox's InfinityFree transcript helper, and then feeds the captions to llm.php to synthesize a comprehensive answer. It does not route transcript requests through Hostinger's transcript.php. Only caption content is used — no audio transcription or external web search. The helper is rate limited as youtube and logs failures to api/youtube.log.

https://promptbox.cn/api/youtube.php  GET POST
NameTypeDescription
promptstringrequiredThe question or topic to research. Also accepted as q.
{ "success": true, "content": "AI-synthesized answer from video transcripts..." }

Returns an error if no videos are found, none have accessible transcripts, a dependency key is missing, or the helper hits its rate limit. GET also supports JSONP with callback or cb.

# Simple GET GET youtube.php?prompt=How+do+black+holes+form # POST with JSON body POST youtube.php Content-Type: application/json { "prompt": "What are the best stretches for lower back pain?" }