APIs (alphabetical)

browser.phpControl Chromium sessions, pages, forms, links, tabs, screenshots, maps, and saved logins
convert_video_mp4.phpConvert an uploaded browser video to iPhone-compatible MP4
decision.phpReturn a yes/no decision, a choice, or a score with confidence
doomfly.phpRun inputs through the complete fixed-weight male fruit-fly neural network and inspect its activity
email.phpSend plain-text email
ffmpeg_helper.phpInspect, convert, and thumbnail uploaded media with safe FFmpeg presets
html_gen.phpCreate and publish HTML/JavaScript tools using existing Promptbox APIs
image_gen.phpRecommended image generation API for text-to-image PNG output
image_gen_gemini.phpGenerate or edit images with Gemini, including uploaded image input
image_gen_seedream.phpGenerate or edit images with Seedream using one or more image inputs
kgraph.phpCreate and query persistent knowledge graphs; stored data is public
llm.phpRecommended LLM API for text answers
llm_chatgpt.phpOpenAI text and image answers with selectable models; defaults to low reasoning
llm_gemini.phpUse only when native voice input is needed
llm_jb.phpSend text or multimodal prompts through simple or OpenAI-compatible chat endpoints
memory.phpCreate and manage structured long-term memory. Stored data is publicly accessible.
music_gen.phpGenerate vocal or instrumental music and download completed audio
notes.phpCreate, read, edit, list, complete, restore, and delete durable note files. Stored data is publicly accessible.
pdf_creator.phpCreate a PDF from finished text or a supported office document
places.phpSearch Google Places and retrieve addresses, ratings, websites, and reviews
publish.phpPublish HTML/ZIP apps with update tokens and renewable 30-day periods, plus documents and media
qr.phpCreate a downloadable QR card for a URL, email address, or Wi-Fi network
rag.phpAsk a Gemini File Search store and get a brief JSON answer
rag-management.phpCreate and resolve File Search stores, upload and list documents, and delete owned RAG resources
rate-limit.phpCheck and record rolling usage limits for a named program
steam.phpFetch Steam game reviews or community discussion search results
stock.phpFetch stock quotes, company profiles, and financial metrics
transcribe.phpTranscribe uploaded or base64 audio to plain text
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 MP3 or WAV in ten languages with selectable voices
tts_inworld.phpConvert text to MP3 or WAV with selectable Inworld voices
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.phpSearch the live web and return a numeric value or concise text answer
web_read.phpRead a public URL or file, or answer search terms through web.php
youtube.phpSearch YouTube and get AI-synthesized answers from video transcripts

browser.php

Control JavaScript-enabled Chromium sessions through REST

Controls a JavaScript-enabled browser: open pages, read content, fill forms, click links, manage tabs, take screenshots, and reuse saved login profiles. Use mode=agent for guided actions with current control IDs. Requires a browser API key. Uses two CPU cores and a 110-thread ceiling within a 120-thread hosting allowance, reserving ten threads for other hosting work. Supports up to two concurrent sessions and four tabs per session when resources permit; idle sessions expire after about three minutes and operations have a 45-second deadline. File uploads/downloads and interactive human takeover are unavailable.

POST JSON with Authorization: Bearer YOUR_BROWSER_API_KEY. Set mode=agent, open a URL, and use the latest page_id and control IDs for each action. Give state-changing actions a unique request_id, inspect the returned page, and close the session when finished. If content is loading or controls are truncated, request one snapshot, using focus when needed. Human-verification pages require human help; inspect uncertain results before retrying.

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

POST https://promptbox.cn/api/browser.php with JSON and Authorization: Bearer <browser API key>. Request a key from admin@promptbox.cn.

Operation deadline: Each operation is limited to 45 seconds. An expired agent operation closes its sessions; do not reuse those IDs. Concurrent actions return HTTP 409. Inspect uncertain results before retrying a click or submission.

Agent interface: Set mode:"agent" to receive short IDs for visible fields, buttons, links, and select options. Use the current page_id and control IDs for each action because every response returns a fresh observation. Mutating actions require a unique request_id of 8–160 letters, digits, hyphens, or underscores.

{"mode":"agent","action":"open","url":"https://example.com","request_id":"unique-open-001"}
{"mode":"agent","action":"fill_form","page_id":"LATEST_PAGE_ID","fields":{"field-1":"10 Market Street","field-2":"San Francisco","field-3":"option-2","field-4":true},"request_id":"unique-fill-001"}
{"mode":"agent","action":"click","page_id":"NEW_PAGE_ID","target_id":"OBSERVED_BUTTON_ID","request_id":"unique-click-001"}

fill_form fills fields sequentially and does not submit. Select controls use returned option-N IDs; checkbox and radio values are booleans. Inspect applied and the returned page, then click the submit control using the new page_id. Use snapshot with focus when controls are truncated. Close the session when finished.

Example: If an open response lists field-1 as Street address, field-2 as a Drink select with option-2 labeled Jasmine milk tea, field-3 as a checkbox, and button-4 as Continue, fill and continue like this:

{"mode":"agent","action":"fill_form","page_id":"PAGE_A","fields":{"field-1":"10 Market Street","field-2":"option-2","field-3":true},"request_id":"order-fields-001"}
{"mode":"agent","action":"click","page_id":"PAGE_B","target_id":"button-4","request_id":"order-continue-001"}
{"mode":"agent","action":"close","session_id":"SESSION_A","request_id":"order-close-001"}

PAGE_B is the fresh page ID returned by fill_form. Read the page returned by click before deciding the next action.

Low-level interface: Omit mode and use Playwright locators, coordinates, tabs, or profiles directly.

{"action":"create","url":"https://example.com"}
{"action":"snapshot","session_id":"RETURNED_SESSION_ID"}
{"action":"fill","session_id":"RETURNED_SESSION_ID","label":"Search","value":"milk tea"}
{"action":"click","session_id":"RETURNED_SESSION_ID","role":"button","name":"Search"}
{"action":"close","session_id":"RETURNED_SESSION_ID"}

Use one of selector, role + name, label, or text for low-level actions. Optional tab_id chooses a tab; optional frame resolves a locator inside an iframe. Read the page after navigation or interaction and do not repeat an uncertain state-changing action before inspecting current state.

Maximum 2 sessions and 4 tabs per session. Idle sessions expire after 3 minutes of inactivity. Cleanup runs every minute, so actual closure occurs after approximately 3–4 idle minutes. Interaction timeouts accept 1–25,000 ms. Requests are limited to 100 KB and responses to 8 MB.

Capacity and recovery: Browser v2.3.1 runs on two allowed CPUs with one raster thread. Automatic startup uses a restricted local launcher to avoid inherited web-worker virtual-memory limits. Its thread ceiling is 110 within the verified account allowance of 120, leaving ten slots for other work; browser memory remains capped at 1.5 GiB. Opening a cold browser reserves 75 threads; adding a session to a warm browser or adding a tab reserves 20. These are admission estimates; complex pages can still exceed capacity. If capacity_full reports rejected:true, no action started; wait at least retry_after seconds before an intentional retry. A resource shutdown may close existing sessions; inspect saved observations and never replay an uncertain click or submission automatically.

Complete usage reference · OpenAPI contract

convert_video_mp4.php

Convert uploaded browser video to MP4

Converts an uploaded browser-recorded or other FFmpeg-readable video into an iPhone-compatible MP4 with H.264 video and AAC audio. It accepts uploads up to 600 MB, returns raw video/mp4 bytes, and has no Promptbox request quota.

Send a multipart POST request with the source file in the video field. On success, save or play the returned video/mp4 bytes.

POST https://www.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 returned as plain text. The helper has no Promptbox request quota.

decision.php

Yes/no decisions, choices, and scores

Returns a yes/no decision, one choice from supplied options, or a score on an ordered scale, based on your context and question. The JSON result contains only answer and probability. Choose this helper when you need a typed decision rather than a prose answer. It has no Promptbox request quota.

POST JSON with context, question, output_type, and any required options. Use noul for yes/no, choice for 2–255 options, or score for 2–255 ordered levels. Prefer 2–10 levels for native scoring; 11–255 levels return an approximate score calculated from choice probabilities. Scores are zero-based and may be fractional.

https://www.promptbox.cn/api/decision.php  GET POST

GET returns a compact usage description. POST makes one JEV decision.

NameTypeDescription
contextstring, object, or arrayrequiredThe state or information the model should evaluate. Alias: state.
questionstring, object, or arrayrequiredThe decision to make or structured instructions for making it.
output_typestringrequiredOne of noul, choice, or score. Alias: type.
optionsobject or arraydepends on typeFor noul, optionally map yes/no (or true/false) to descriptions. For choice, supply 2–255 strings or an object mapping option keys to descriptions. For score, supply an ordered array of 2–255 level descriptions from lowest to highest. Scores with 2–10 levels use TypeSafe's native score type; scores with 11–255 levels use the compatibility calculation described above.
TypeAnswerProbability
noul"yes" or "no".The probability of the returned side. JEV natively reports the probability of yes; the helper converts a no result to 1 - P(yes).
choiceThe selected option key.The upstream probability for that selected key. Other option probabilities are omitted.
scoreThe expected zero-based position on the ordered scale, which may be fractional. With 2–10 levels, this is TypeSafe's native score. With 11–255 levels, this is the probability-weighted mean of the choice indices.TypeSafe's native score confidence for 2–10 levels, or its choice confidence for 11–255 levels. Per-level probabilities and the upstream legend are omitted.
curl https://www.promptbox.cn/api/decision.php \
  -H 'Content-Type: application/json' \
  -d '{"context":"Payments have failed for three days.","question":"Is this urgent?","output_type":"noul"}'

curl https://www.promptbox.cn/api/decision.php \
  -H 'Content-Type: application/json' \
  -d '{"context":"Customer asks for a refund.","question":"Which team should handle this?","output_type":"choice","options":{"billing":"Payments and refunds","technical":"Bugs and outages","sales":"Pricing and upgrades"}}'

curl https://www.promptbox.cn/api/decision.php \
  -H 'Content-Type: application/json' \
  -d '{"context":"I have asked five times and nobody replied!","question":"How frustrated is the customer?","output_type":"score","options":["Calm","Frustrated","Very angry"]}'
{ "answer": "yes", "probability": 0.91 } // choice { "answer": "billing", "probability": 0.84 } // score; zero-based and possibly fractional { "answer": 1.34, "probability": 0.78 }

Returns application/json. For a 2–10-level score, answer is TypeSafe's native score and probability is its native score confidence. For an 11–255-level compatibility score, answer is the probability-weighted mean of the choice indices and probability is TypeSafe's choice confidence. Input errors use HTTP 400, 413, or 415; disallowed browser origins use 403; unsupported methods use 405; configuration or upstream failures use 502 or 503. There is no Promptbox request quota. Only the selected answer and its confidence are returned.

doomfly.php

Run inputs through a complete fixed-weight male fruit-fly neural network

Simulates activity in a male fruit-fly neural network from images, retinal brightness, or direct neuron currents. Returns spike totals, population activity, selected neurons, firing rates, voltages, and optional control readouts. Sessions preserve neural state across successive inputs. Use this helper to explore neural activity; its fixed weights do not learn or establish natural fly behavior.

Set the desired route in the path query parameter. Start with a JSON POST to /v1/step; create a session only when successive inputs must share state, and DELETE it when finished. No caller API key is needed. For compact visualization, first confirm section_top80_v1 is advertised by /v1/model, cache /v1/activity-layout, and request that activity_view with top_k:0. Omit activity data when no visualization is shown.

https://www.promptbox.cn/api/doomfly.php  GET POST DELETE
PathMethodDescription
/healthGETReturn readiness, graph size, busy state, and completed-call count.
/v1/modelGETReturn the exact model, limits, graph and kernel hashes, and fixed readouts.
/v1/neuronsGETBrowse neurons using optional cell_type, superclass, offset, and limit filters.
/v1/retinaGETReturn all 3,335 retinal neuron IDs and inferred UV sample coordinates.
/v1/activity-layoutGETAvailable when advertised by /v1/model. Static section counts/offsets and packed retinal UV coordinates. Cache by activity_view.layout_id; never fetch per frame.
/v1/stepPOSTApply visual or direct-current input and advance 0.1–100 simulated milliseconds.
/v1/sessionsPOSTLease the brain for a stateful sequence lasting 30–900 seconds; default 900 seconds (15 minutes), including pauses.
/v1/sessions/SESSION_IDDELETERelease a lease and reset the neural state.
NameTypeDescription
pathstringoptionalOne supported route from the Actions table; defaults to /health.
cell_typestringoptionalExact cell-type filter for /v1/neurons.
superclassstringoptionalExact superclass filter for /v1/neurons.
offsetintegeroptionalNeuron-result offset.
limitintegeroptionalNeuron-result count from 1 to 1000.
NameTypeDescription
luminancenumber or arrayoptionalOne brightness from 0–1, or exactly 3,335 retinal brightness values.
image_base64stringoptionalBase64 PNG, JPEG, or WebP bytes, optionally as a data URL; images are resized to fit 1024 × 1024.
stimuliarrayoptionalUp to 512 objects containing a decimal-string neuron_id and current_mv from −30 to +30.
readout_idsarrayoptionalUp to 256 neuron IDs that must appear in the response readouts.
duration_msnumberoptionalSimulation interval from 0.1 to 100 milliseconds, in 0.1 ms increments.
top_kintegeroptionalNumber of top-spiking cells to return; default 100, range 0–1000. Use 0 for compact visualization to avoid duplicate individual records.
activity_viewstringoptionalExactly section_top80_v1, only when advertised by /v1/model. Returns nonzero spike counts for the strongest 80% of neurons in each section. Omit when activity visualization is not needed.
session_idstringoptionalLease ID for a stateful sequence; omit for a repeatable independent call.
request_idstringoptionalUnique idempotency key required for each session step.
curl 'https://www.promptbox.cn/api/doomfly.php?path=/v1/step' \
  -H 'Content-Type: application/json' \
  -d '{"luminance":0.5,"duration_ms":20,"top_k":10}'

Returns application/json. Step responses include complete-network total_spikes and active_neurons, population summaries, selected top_spikes, requested readouts, interval timing, graph identity, and fixed doom_controls. With activity_view requested, activity contains base64 delta-unsigned-varint index/count pairs plus section totals; absent values render black. Colors use count × 1000 / interval.duration_ms on a fixed logarithmic 0–500 Hz scale. At least 20% per section is black; selected zero-spike neurons also stay black. Reuse the cached activity layout identified by layout_id. Activity format reference. Errors use HTTP 400, 404, 405, 409, 413, 422, 429, or 503 with a JSON error; capacity failures include Retry-After.

The shared rate limit is 120 HTTP calls per minute, with one neural computation at a time. Requests are limited to 3 MB and image data to 2.8 million base64 characters. Sessions permit up to 512 unique steps and must be released promptly. The fixed lease deadline does not renew on activity. Creation responses report max_steps, steps_used and steps_remaining; stateful step responses include these under session with expires_at. Step 512 succeeds; further unique steps return 409, and expired sessions return 404. Identical retries do not advance state. Stop sending steps at the step limit or lease expiry; create a new session to start another sequence. Read the complete Fly Brain API documentation, session semantics, and scientific limitations.

email.php

Send plain-text email

Sends a plain-text email immediately and returns a JSON delivery result. The sender is adam@promptbox.cn; a different valid sender value becomes the Reply-To address. Verify the recipient, subject, and body before calling.

Prefer POST with the recipient, subject, and message fields below. Check the JSON result before reporting success. An uncertain result may still have sent the message; verify before sending it again.

https://www.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

Inspect, convert, and thumbnail audio or video

Inspects, converts, or creates a thumbnail from an uploaded audio or video file using safe FFmpeg presets. Conversion defaults to MP4 and also supports WebM, MP3, M4A, WAV, and GIF, with uploads up to 300 MB and durations up to 600 seconds. The helper returns metadata as JSON or raw media bytes and has no Promptbox request quota.

Send a multipart request with an action and the uploaded media file. Use info or probe for JSON metadata, convert for converted media bytes, or thumbnail for a JPEG image.

GET POST https://www.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://www.promptbox.cn/api/ffmpeg_helper.php', {
  method: 'POST',
  credentials: 'omit',
  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 has no Promptbox request quota. Browser origin restrictions described above still apply.

html_gen.php

Generate and publish a browser-based tool from a text prompt

Generates a self-contained HTML/CSS/JavaScript browser tool from a text description, publishes it on Promptbox, and returns its public URL. Choose it to create a new static tool; use publish.php to deploy an existing build. It does not create server-side code or new REST endpoints.

POST action=start with a prompt, save task_id, and check action=status later. Do not poll continuously or restart a pending job. When job.status is completed, open url; when it is failed, read job.error. Generated tools are public, so keep secrets out of the prompt.

https://promptbox.cn/api/html_gen.php GET POST
ActionMethodDescription
startPOSTStart an asynchronous generation job. Returns HTTP 202 and a task_id.
statusGET, POSTRetrieve a job by task_id. Check job.status to determine whether it is pending, completed, or failed.
generateGET, POSTRun generation synchronously. This can exceed HTTP or client timeouts, so start is recommended.
helpGET, POSTReturn API usage information. An empty GET request also returns help.
NameTypeRequiredDescription
actionstringoptionalstart, status, generate, or help. Use start for normal generation.
promptstringrequired for start/generateA description of the tool's purpose, inputs, expected outputs, workflow, and API preferences. Maximum 60,000 bytes. Alias: q.
task_idstringrequired for statusThe exact ID returned by start. Alias: job_id.

All responses use application/json. A successful start request returns HTTP 202 with success, pending, task_id, status, and status_url. A status request returns HTTP 200 when the task lookup succeeds; inspect job.status to determine the generation result. A completed job includes the published url. A failed job includes job.error and does not include a new published URL.

Invalid requests return HTTP 400, disallowed browser origins return 403, unknown or expired task IDs return 404, unsupported methods return 405, and rate limits return 429 with a Retry-After header.

POST https://promptbox.cn/api/html_gen.php Content-Type: application/json {"action":"start","prompt":"Build a public text summarizer. Let the user paste text, press Summarize, and copy the result. Use Promptbox llm.php."} # After allowing time for generation, use the task_id returned above: GET https://promptbox.cn/api/html_gen.php?action=status&task_id=htmlgen_app_0123456789abcdefabcd # When job.status is "completed", open the returned url.

image_gen.php

Preferred text-to-image PNG generation

Preferred helper for ordinary text-to-image requests. Generates a PNG from a text prompt, with portrait 3:4 output by default and landscape 4:3 available. It does not accept reference images; choose image_gen_gemini.php or image_gen_seedream.php for image editing.

Send prompt by GET or POST and read the successful response as image/png. Choose orientation and other optional settings below. Use an editing helper when the request includes an existing image.

https://www.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('https://www.promptbox.cn/api/image_gen.php?prompt=' + encodeURIComponent(prompt), { credentials: 'omit' }); const blob = await res.blob(); img.src = URL.createObjectURL(blob); # Display the returned image (browser origin restrictions still apply) img.src = 'https://www.promptbox.cn/api/image_gen.php?prompt=' + encodeURIComponent(prompt);

image_gen_gemini.php

Nano Banana 2 Lite image generation with optional image editing

Generates an image or edits one reference image, with 1K output and portrait 3:4 by default. Accepts PNG, JPEG, WebP, HEIC, or HEIF input up to 20 MB. Choose this helper for editing with one reference; use image_gen_seedream.php for multiple references or higher resolution, and image_gen.php for ordinary text-to-image requests.

Send prompt by GET or POST. For editing, POST an uploaded or base64 reference image using the fields below. Save or display the returned image bytes.

https://www.promptbox.cn/api/image_gen_gemini.php  GET POST
NameTypeDescription
client_idUUID stringoptionalPersistent random installation UUID for usage analysis. Logged as client_id; omitted or invalid values are logged as null. Does not change shared program quotas and is not sent to Google.
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_sizestringoptionalNano Banana 2 Lite produces 1K output. The legacy value 4K and its aliases (imageSize=4K, four_k=1, 4k=1, image_4k=1, and use_4k=1) remain accepted for compatibility but are ignored.
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 # Display the returned image (browser origin restrictions still apply) img.src = 'https://www.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": "data:image/jpeg;base64,/9j/4AAQ..." }

image_gen_seedream.php

Image generation and editing with up to 14 references

Generates or edits images using up to 14 reference images. Supports 2K, 4K, or explicit dimensions from 1440 to 4096 pixels per side. Choose it for multiple references or high-resolution editing; use image_gen.php for ordinary text-to-image requests.

Send prompt and any reference images using the fields below. Choose dimensions when needed, then save or display the returned image bytes.

https://www.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, reads, updates, deletes, and queries persistent knowledge graphs containing nodes, relationships, and notes. Supports up to 5,000 nodes and 10,000 edges per graph, with no Promptbox request quota. Graph files are publicly accessible; do not store secrets or confidential information.

Send an action, graph_id, and the fields required by that action. Save the graph ID for later calls and inspect the JSON result. Use the query action to ask questions about the stored graph.

https://www.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": "Business meals require 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

Preferred helper for ordinary text requests

Preferred LLM helper for ordinary text requests. Answers questions, summarizes, translates, and generates text. Defaults to glm-5.3 with low reasoning effort and no Promptbox request quota; model=pro selects deepseek/deepseek-v4-flash. Use a multimodal helper for images, audio, or files.

Send prompt by GET or POST and read the answer as plain text. Set reasoning_effort to low, high, or max; medium is an alias for high. Set max_tokens up to 32768 when a longer answer or reasoning needs room; use the optional model and timeout settings below when needed.

https://www.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 32768. Allow room for reasoning and the final answer; for short structured decisions, 16384 leaves headroom. Omit to use the provider default.
modelstringoptionalDefault: Z.ai glm-5.3. Omitting the field, using lite, or supplying an unrecognized value keeps GLM. Pass pro, premium, advanced, or a legacy pro selector to use AIMLAPI deepseek/deepseek-v4-flash with low reasoning effort.
timeout_secondsintegeroptionalProvider request timeout, accepted from 5 to 180 seconds. The default is 90 seconds; direct GLM calls cap at 90, while Pro calls may use up to 180. A timed-out or empty GLM request gets a separate 45-second Pro fallback.
reasoning_effortstringoptionalGLM reasoning depth: low (default), high, or max. The medium alias maps to high, the middle supported level. Invalid values return HTTP 400. Applies to GLM; Pro and timeout/empty-answer fallback retain low effort.
thinkingstringoptionalLegacy compatibility field; GLM-5.3 always reasons, so enabled and disabled both use enabled reasoning. Use reasoning_effort to control depth. Pro uses low reasoning effort.
qualitystringoptionalAlias for model selection. Use quality=pro to use AIMLAPI deepseek/deepseek-v4-flash.
probooleanoptionalSet to 1, true, or yes to use AIMLAPI deepseek/deepseek-v4-flash. Aliases: use_pro, deepseek_pro.
callbackstringoptionalGET-only JSONP callback name. Browser origin restrictions still apply. 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 DeepSeek V4 Flash pro model GET llm.php?prompt=Explain+quantum+tunneling&model=pro # Alternate selector for DeepSeek V4 Flash GET llm.php?prompt=Explain+quantum+tunneling&pro=1 # In browser JavaScript const answer = await fetch('https://www.promptbox.cn/api/llm.php?prompt=' + encodeURIComponent(prompt), { credentials: 'omit' }).then(r => r.text()); # JSONP response wrapper (browser origin restrictions still apply) window.handleLlm = (payload) => console.log(payload.ok ? payload.text : payload.error); const script = document.createElement('script'); script.src = 'https://www.promptbox.cn/api/llm.php?callback=handleLlm&prompt=' + encodeURIComponent(prompt); document.head.appendChild(script);

llm_chatgpt.php

OpenAI text and image answers with selectable models

Returns a plain-text answer with selectable OpenAI models and optional image input. Choose it when you specifically need an OpenAI model; use llm.php for ordinary text requests. Defaults to gpt-6.1-sol with low reasoning and the Promptbox request-count limit. The lite route uses gpt-6-luna and is exempt from that limit.

Send prompt by GET or POST and read the answer as plain text. POST JSON when supplying images. Set model=lite for Luna or another supported model name when needed. Use reasoning_effort to override the model default and max_tokens up to 32768 to allow room for reasoning and the answer.

https://www.promptbox.cn/api/llm_chatgpt.php  GET POST
NameTypeDescription
promptstringrequiredThe task or question. Alias: q.
modelstringoptionalDefault: gpt-6.1-sol with low reasoning. Pass another model name to select that model. lite and gpt-6-luna explicitly select the Luna lite route, which defaults to low reasoning effort and has no Promptbox request-count limit.
reasoning_effortstringoptionalAccepted values: none, minimal, low, medium, high, xhigh, or max. Defaults to low when model is omitted, and low for the explicit Luna lite route. Other explicit models use the provider default unless this field is set.
max_tokensintegeroptionalMaximum output tokens, clamped from 128 to 32768. Allow room for reasoning and the final answer; for short structured decisions, 16384 leaves headroom. Omit to use the provider default.
imagesarrayoptionalImages to include with the prompt. POST JSON accepts HTTP(S) image URLs or base64 strings/data URIs for JPEG, PNG, and WebP images.
callbackstringoptionalGET-only JSONP callback name. Alias: cb. JSONP returns a JavaScript wrapper containing { ok, text } or { ok: false, error, status }.

Successful non-JSONP requests return the model answer as text/plain. Input errors return an HTTP error status and a plain-text message. Upstream or empty-response failures return an HTTP error status and null.

# Default: GPT-6.1 Sol with low reasoning GET llm_chatgpt.php?prompt=Explain+quantum+tunneling # Select the lite route, which defaults to low reasoning effort GET llm_chatgpt.php?prompt=Summarize+this&model=lite # Set reasoning explicitly POST llm_chatgpt.php Content-Type: application/json { "prompt": "Compare these options carefully.", "reasoning_effort": "high" } # Include an image POST llm_chatgpt.php Content-Type: application/json { "prompt": "Describe this picture.", "images": ["data:image/jpeg;base64,/9j/4AAQ..."] }

llm_gemini.php

Gemini answers for native voice/audio input

Returns a plain-text Gemini answer from text, images, audio, files, or structured Gemini content. Choose this helper when native voice/audio input is needed. Use llm.php for ordinary text. Defaults to gemini-3-flash-preview without specifying thinking effort; Gemini uses its own default when no thinking controls are supplied. The standard route allows 300 requests per rolling day; model=lite selects gemini-3.1-flash-lite and is exempt from that limit.

POST the prompt and audio as Gemini parts or contents, then read the answer as plain text. Set model=lite for the lightweight model. Use the fields below for images, conversation history, system instructions, or generation settings.

https://www.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. The helper does not automatically add thinkingConfig, thinkingLevel, or thinkingBudget. Gemini uses its own default when these are omitted; caller-supplied thinking settings pass through unchanged. The same rule applies to provider-response mode (return_provider_response=true with provider_payload); explicit model names and lite remain supported.
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 }.

# Use when the request includes native audio/voice input POST llm_gemini.php Content-Type: application/json { "prompt": "Answer the spoken question.", "parts": [{ "inlineData": { "mimeType": "audio/wav", "data": "BASE64_AUDIO_DATA" } }] }

llm_jb.php

Text and multimodal responses with OpenAI-compatible routes

Returns text or multimodal answers through a simple prompt endpoint or OpenAI-compatible chat routes. Choose it for OpenAI-compatible clients, function-tool workflows, or automatic multimodal routing; use llm.php for ordinary text. Text-only requests use the default model in llm.php. Non-text input uses the default model in llm_gemini.php. Each route inherits its downstream helper's request limits; model selection stays centralized in those helpers. Streaming returns the completed answer in one chunk, not token by token.

For simple calls, send prompt to llm_jb.php and read plain text. For OpenAI-compatible clients, set the base URL to https://www.promptbox.cn/api/llm_jb.php/v1 and POST messages to /chat/completions; GET /models lists models. Send attachments using the documented image or Gemini content fields. Set skip_prefix=true to use only your own instructions. Use provider=gemini to send text through the default model in llm_gemini.php. The optional model field is accepted for compatibility and does not override either helper's default, including when set to lite. Check HTTP errors and Retry-After before retrying.

https://www.promptbox.cn/api/llm_jb.php  GET POST
https://www.promptbox.cn/api/llm_jb.php/v1/chat/completions  POST
https://www.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 use the default model in llm_gemini.php for this request. Omit it to use llm.php for text-only requests and llm_gemini.php for multimodal requests.
modelstringoptionalCompatibility field only. All values, including lite and explicit provider model names, use the selected downstream helper's default model. Call a downstream helper directly when an alternate model is needed.
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.
skip_prefixbooleanoptionalDefault false. Set to true to omit the helper's built-in prompt prefix and send only your own system prompt and messages. Boolean-like values 1, true, yes, and on are also accepted.
generationConfigobjectoptionalGemini generation settings such as temperature or maxOutputTokens. Alias: generation_config.
callbackstringoptionalGET-only JSONP callback name. Alias: cb.
NameTypeDescription
providerstringoptionalPass gemini to use llm_gemini.php with its default model. Text and function-tool requests otherwise use llm.php with its default model; multimodal requests automatically use llm_gemini.php.
modelstringoptionalPublic compatibility label, normally promptbox-llm-jb. It never overrides the downstream helper's default model, even when lite or an explicit provider model name is supplied.
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.
skip_prefixbooleanoptionalDefault false. Set to true to omit the helper's built-in prompt prefix. This applies to both downstream helpers.
toolsarrayoptionalOpenAI function tools. Function names, descriptions, JSON-schema parameters, tool_choice, tool-call ids, arguments, and tool results are forwarded to llm.php using the OpenAI-compatible schema.
temperaturenumberoptionalGeneration temperature. Default: 1.0.
max_tokensintegeroptionalMaximum output tokens, capped at 8192.
response_formatobjectoptionalOpenAI-compatible response format forwarded to llm.php, including {"type":"json_object"} for structured JSON output.
timeout_secondsintegeroptionalProvider timeout, clamped from 5 to 180 seconds.
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. Helper failures return their actual HTTP status and a readable error message; rate-limit errors preserve HTTP 429 and the Retry-After header. Empty or invalid helper responses return a descriptive HTTP 502, and transport timeouts return HTTP 504. Input validation failures use their existing HTTP error codes. 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 the text helper requests a function call. Errors retain the OpenAI-style JSON error envelope, the helper HTTP status, and any Retry-After header. Downstream 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 # Legacy model label; still uses the llm.php default GET llm_jb.php?prompt=Explain+photosynthesis&model=lite # Send text through the llm_gemini.php default GET llm_jb.php?prompt=Explain+photosynthesis&provider=gemini # Skip the helper's built-in prompt prefix GET llm_jb.php?prompt=Reply+with+only+OK&skip_prefix=true # 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?", "images": ["data:image/jpeg;base64,/9j/4AAQ..."] } # Simple server-side prompt request POST https://www.promptbox.cn/api/llm_jb.php Content-Type: application/json { "prompt": "Reply with only OK.", "skip_prefix": true } # Browser JavaScript const answer = await fetch('https://www.promptbox.cn/api/llm_jb.php?prompt=' + encodeURIComponent(prompt), { credentials: 'omit' }).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" }] } # OpenAI-compatible client settings base_url: https://www.promptbox.cn/api/llm_jb.php/v1 api_mode: chat_completions model: promptbox-llm-jb supports_vision: true

memory.php

Create and manage structured long-term memory

Creates and manages persistent structured memory for preferences, project context, knowledge, and tasks. Supports section-specific additions, exact item edits, consolidation, and semantic forgetting. Memory files are publicly accessible and limited to 400,000 bytes; do not store secrets, confidential material, or sensitive personal information.

Send an action and memory_id with the fields required by that action. Save the memory ID for later calls. Use include_ids=true to retrieve item IDs for exact edits; use forget with item_id to remove one item and purge to delete the entire memory. Mutating actions require POST.

https://www.promptbox.cn/api/memory.php  GET POST
NameTypeDescription
actionstringoptionalDefault: get. Supported values: create, add, forget, update, get, and purge. Aliases: new, output, full, delete, and clear. Mutating actions require POST. The legacy delete alias still means purge the complete memory file; use forget plus item_id to remove one item.
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 add/updateMemory text. With add plus section, the exact text is stored directly. With legacy add and no section, it is merged by GLM. With update, it replaces the identified item's text. Aliases for add include memory, content, add, entry, and new_memory.
sectionstringoptionalWhen supplied with add, selects one of the eight structured sections and enables the fast direct-add path. The summary is cleared after direct edits so it cannot contradict the complete sections.
item_idstringrequired for update/direct forgetStable item ID returned by get with include_ids=1. Use update plus text to edit that item, or forget plus this ID to delete it exactly. Alias: itemId.
forgetstringrequired for semantic forgetFact, preference, topic, or instruction for GLM to remove when item_id is omitted. Aliases: forget_text, text, content, and query.
include_idsbooleanoptionalFor get, include a flat items array containing each stable id, section, text, and timestamps. Default false, preserving the legacy response exactly. Alias: includeIds.
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.

# 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." } # Fast direct add (no LLM call) POST memory.php Content-Type: application/json { "action": "add", "memory_id": "agent-main", "section": "preferences", "text": "The user prefers compact mobile screens." } # Read memory with stable item IDs GET memory.php?action=get&memory_id=agent-main&include_ids=1 # Update one exact item POST memory.php Content-Type: application/json { "action": "update", "memory_id": "agent-main", "item_id": "mem_0123456789abcdef", "text": "The user prefers compact, phone-first screens." } # Delete one exact item POST memory.php Content-Type: application/json { "action": "forget", "memory_id": "agent-main", "item_id": "mem_0123456789abcdef" } # 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

Generate vocal or instrumental music

Creates vocal songs from a prompt and lyrics, or instrumental music, and returns a job ID for later status checks and audio download. Supports MP3 and WAV. Prompts must contain 10–2,000 characters; vocal lyrics must contain 10–3,000 characters.

POST a prompt and lyrics for a vocal track, or set is_instrumental for an instrumental. Save the generation ID, check status later with GET, and request action=audio when complete. Do not poll continuously.

https://www.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://www.promptbox.cn/api/music_gen.php', { method: 'POST', credentials: 'omit', 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://www.promptbox.cn/api/music_gen.php?callback=handleMusic&generation_id=' + encodeURIComponent(job.id);

notes.php

Persistent notes with search, status, and tags

Creates, reads, searches, edits, completes, restores, and deletes persistent JSON notes with titles, text, status, tags, timestamps, and optional metadata. The default overview action lists up to 100 notes, while individual note text may contain up to 50,000 characters. The helper has no Promptbox request quota, but stored notes are publicly accessible and must not contain secrets.

Send an action with the fields required for that operation and save returned note IDs for later edits. Notes are publicly accessible, so do not store secrets, confidential material, or sensitive personal information.

https://www.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

Create PDFs from text or office documents

Creates a downloadable PDF from finished text or converts one supported office document while preserving its layout. Text input supports page size, orientation, margins, fonts, headers, footers, and metadata. File uploads are limited to 10 MB. Returns PDF bytes.

POST either content or one multipart file, with any optional page settings. Check the response status, then save the successful application/pdf bytes. Errors return JSON.

https://www.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://www.promptbox.cn/api/pdf_creator.php

places.php

Search places, find nearby businesses, and retrieve details and reviews

Searches named places and businesses, finds nearby results, and retrieves addresses, coordinates, ratings, websites, opening hours, phone numbers, prices, and reviews. No caller API key is needed. If an initial text search finds no location, the helper automatically geocodes the query with Photon/OpenStreetMap and retries Google once with a coordinate bias before returning a not-found error.

Send GET or JSON POST with action=search, nearby, or details and the required fields below. Use a Google place ID from search results for details. Request only fields you display and show the required attribution. For street addresses, submit the complete address as query; fallback is automatic. Only returned Google IDs can be used for details. Fallback coordinates are a search hint, not a verified house destination. Review the fallback response before displaying or using coordinates.

https://www.promptbox.cn/api/places.php  GET POST

Use query parameters for GET or an application/json object for POST. Do not combine POST with query parameters. Maximum JSON body: 16 KiB.

ParameterTypeUsage
actionstringsearch (default), nearby, or details.
querystringRequired for search. Business, named place or category text such as milk tea in Saratoga CA; maximum 500 bytes. Street addresses are accepted; include house number, street, city and postal code for the automatic geocoding fallback.
lat, lngnumbersRequired together for nearby; optional together for search. Latitude −90 to 90; longitude −180 to 180. Not accepted for details.
radiusnumber1–50,000 meters; default 5,000. Requires coordinates. A strict circle for nearby; a geographic bias for search, which may return places outside the circle.
limitintegerSearch/nearby results per request, 1–20; default 5. Fewer results may be available.
rankstringSearch: relevance (default) or distance. Nearby: distance (default) or popularity. Distance requires coordinates. Results retain Google's ranking; distance ranking for text search is intended for categorical queries.
typesstring or arrayNearby only. Optional comma-separated list or JSON array of 1–50 Google place types, such as cafe or restaurant. Omit to search all types.
place_idstringRequired for details. Use a place's id from search/nearby, without a places/ prefix.
fieldsstring or arrayComma-separated field names or a JSON array. Default: id,displayName,formattedAddress,location,googleMapsUri. See supported fields below. Wildcards and places. prefixes are not accepted.
languagestringGoogle-supported language code, such as en (default) or zh-TW.
page_tokenstringSearch only. Use next_page_token from the previous response, keeping the other request parameters unchanged. Each page is a separate request.

Version 1.1.0: An initial search returning no places or HTTP 404 triggers one Photon/OpenStreetMap geocoding lookup, followed by one Google text-search retry biased to the returned coordinates. The original query, requested fields, limit, language and ranking remain unchanged; the supplied radius or 5,000 meters is used for the retry bias. Any distance_meters still measures from the caller's original coordinates. No unrelated nearby business is substituted for an address.

Fallback does not run for pagination, nearby, details, invalid input, authentication failures, quota errors or upstream outages. A geocoder with no match ends the search with HTTP 404; a geocoder outage or busy fallback returns HTTP 502 geocoding_unavailable. After a coordinate-assisted retry, an empty result is HTTP 404 not_found; Google retry errors retain their normal status. Google place IDs are never fabricated from OpenStreetMap data.

Photon is a separate provider using OpenStreetMap data. Its public endpoint permits moderate usage without an availability guarantee. Outbound geocoding is serialized and spaced at least one second apart, with private bounded caching (24 hours for coordinates, five minutes for misses, up to 300 entries); each uncached lookup counts against the shared helper quota. Use explicit submitted searches, not polling or keystroke requests. Display © OpenStreetMap contributors when fallback coordinates are used. They may be approximate or ambiguous; verify the address and house number before routing to a precise destination.

id, displayName, formattedAddress, location, googleMapsUri, types, primaryType, businessStatus, rating, userRatingCount, websiteUri, nationalPhoneNumber, internationalPhoneNumber, regularOpeningHours, currentOpeningHours, priceLevel, reviews, attributions.

id and attributions are always requested. Searches with coordinates also request location. Add rating,userRatingCount for ratings, websiteUri for a business website, or reviews for up to five available reviews. Request only the fields your app displays; missing data may be omitted.

GET /api/places.php?action=search&query=milk%20tea%20in%20Saratoga%20CA&limit=5

POST /api/places.php
Content-Type: application/json

{"action":"nearby","lat":37.7937,"lng":-122.3965,"radius":1500,"types":["cafe"],"limit":5,"fields":["displayName","formattedAddress","location","googleMapsUri","rating","userRatingCount"]}

POST /api/places.php
Content-Type: application/json

{"action":"details","place_id":"PLACE_ID_FROM_SEARCH","fields":"displayName,formattedAddress,googleMapsUri,websiteUri,rating,userRatingCount,reviews"}
async function callPlaces(parameters) {
  const response = await fetch('https://www.promptbox.cn/api/places.php', {
    method: 'POST',
    credentials: 'omit',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(parameters)
  });
  const data = await response.json();
  if (!response.ok || !data.success) throw new Error(data.error || 'Places request failed');
  return data;
}
const data = await callPlaces({ action: 'search', query: 'milk tea in Saratoga CA', limit: 5 });
for (const place of data.places) console.log(place.id, place.displayName?.text, place.formattedAddress);

Search/nearby return {success:true, action, provider:"Google Maps", places:[...], rate_limit:{...}}. Search may also return next_page_token. Details return {success:true, action:"details", provider:"Google Maps", place:{...}, rate_limit:{...}}.

Each place uses Google's field names: displayName.text, location.latitude, location.longitude, and reviews[].text.text. Searches with coordinates add distance_meters, the straight-line distance, not driving or walking distance. Empty nearby results and pagination remain places:[]; an initial text search with no match uses the fallback before returning an error.

When displaying results, show Google Maps attribution and any returned third-party attributions. Display review authors using reviews[].authorAttribution, including their links when available. Render returned text as text, not HTML. Follow Google's display, attribution, and storage rules.

Responses that use fallback include fallback:{attempted:true,provider:"Photon / OpenStreetMap",status:"found|no_match|unavailable|busy",retried:boolean}. Successful geocoding adds location:{latitude,longitude}, attribution:{text,url} and cached. The top-level provider and all places remain Google Maps. These fields also accompany fallback-related errors. Check retried to distinguish a completed Google retry from geocoding without a candidate.

All actions share the places rate-limit program: with shared rolling limits configured on the rate-limit dashboard (currently 200 upstream requests per 24 hours and no separate hourly cap). Check current usage with rate-limit.php?program=places&action=check. Each outbound Google call and uncached Photon lookup consumes one request, even on an upstream error. A full fallback can consume three requests (initial Google search, geocoding, Google retry); a cached geocode consumes none. Each step checks quota before dispatch and can return 429 if the remaining budget is exhausted. Invalid local input does not consume quota. Inspect rate_limit.remaining_day and remaining_hour in successful responses.

Errors return {success:false,error:"...",error_code:"..."}. Status codes: 400 invalid parameters/JSON, 403 unsupported browser origin, 404 place not found, 405 unsupported method, 413 oversized body, 415 non-JSON POST, 429 rate limit or upstream quota, 502 upstream failure, 503 service unavailable. A helper rate-limit response includes retry_after seconds; 429 responses include a Retry-After header. Wait for user action before retrying; do not poll.

publish.php

Publish and manage static apps, documents, and media

Publishes static HTML or ZIP web apps, supported documents, and media files to public Promptbox URLs. App deployments use private owner tokens and can be inspected, completely replaced, extended, deleted, or assigned a new token; each app has a renewable 30-day period. App uploads are limited to 25 MiB, file publications to 10 MiB, and static apps cannot run server-side code.

For an app, POST mode=app, a directory name, and either an HTML file, a complete ZIP build, or HTML text. Save the returned private token outside the published files. Use that token for later status, files, replace, extend, delete, or rotate-token operations. Every replacement must contain the complete app. For a document or media file, POST mode=file with one multipart file.

https://www.promptbox.cn/api/publish.php  GET POST
ActionMethodDescription
createPOSTPublish a new app or file. Omit action and send the appropriate mode.
statusGET, POSTReturn an owned app's URL, files, size, timestamps, and expiry.
filesGET, POSTReturn an owned app's file paths, sizes, content types, URLs, and expiry.
replacePOSTReplace an app with a complete build and renew it for 30 days.
extendPOSTRenew an app for 30 days without changing its files.
deletePOSTImmediately unpublish an app and invalidate its token.
rotate-tokenPOSTReturn a new owner token and invalidate the previous token.
capabilitiesGETReturn current availability, capacity, formats, and limits.
NameTypeRequiredDescription
modestringrequiredapp for static applications or file for documents and media.
directorystringrequired for new appsPreferred app directory name using 1–80 letters, digits, underscores, or hyphens.
filefileconditionalAn HTML or ZIP app build, or one supported document or media file. App uploads must include the complete build.
textstringconditionalUTF-8 HTML for app mode or UTF-8 content for supported text-file publishing.
tokenUUIDrequired for lifecycle actionsThe private owner token. Prefer Authorization: Bearer UUID; never place it in a URL.
actionstringoptionalA lifecycle action listed above. Omit it when creating new content.

New content returns HTTP 201 with a JSON receipt containing its public url and expires_at. New apps also return the only copy of the private owner token. Successful replacements return HTTP 200. Apps use renewable 30-day periods; published files expire after 30 days and have no management token. Honor Retry-After on HTTP 429, and inspect validation fields such as removed_files, sanitized_files, deleted_files, and stripped_prefix.

App uploads allow up to 25 MiB and 1,000 files. File-mode uploads allow up to 10 MiB for supported binary files and 1 MiB for UTF-8 text formats. Check live capabilities when current limits or availability matter.

curl https://www.promptbox.cn/api/publish.php \
-F 'mode=app' \
-F 'directory=my-app' \
-F 'file=@app.zip'
curl \
-H "Authorization: Bearer $PROMPTBOX_APP_TOKEN" \
"https://www.promptbox.cn/api/publish.php?action=status&mode=app"

Complete publishing guide · Complete publishing contract

qr.php

Downloadable QR cards for URLs, email, and Wi-Fi

Creates a downloadable PNG QR code card for a website, email address, or Wi-Fi network. Output is 600 by 600 pixels without a title and 600 by 800 pixels with one, with medium QR error correction. It has no Promptbox request quota; Wi-Fi passwords should be sent by POST so they do not appear in a URL.

Send a destination or Wi-Fi fields by GET or POST, then display or save the returned image/png. Prefer POST for Wi-Fi passwords so credentials do not appear in a URL.

https://www.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://www.promptbox.cn/api/qr.php?destination=example.com
# GET a titled 600×800 card https://www.promptbox.cn/api/qr.php?title=My+Portfolio&destination=example.com/portfolio
# POST a JSON body curl -X POST https://www.promptbox.cn/api/qr.php \ -H "Content-Type: application/json" \ -d '{"title":"Contact Support","destination":"support@example.com"}' \ -o contact-support.png
# POST Wi-Fi credentials as JSON (recommended so passwords do not appear in URLs) curl -X POST https://www.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://www.promptbox.cn/api/qr.php?title=Guest+Wi-Fi&ssid=Guest+Network&security=nopass
// Display in JavaScript const url = 'https://www.promptbox.cn/api/qr.php?title=' + encodeURIComponent(title) + '&destination=' + encodeURIComponent(destination); cardImage.src = url;

rag.php

Gemini File Search RAG helper

Answers a text or audio question using documents in a Gemini File Search store and returns a concise, document-grounded JSON result. Choose it when answers should come from your uploaded documents. Create and populate the store with rag-management.php. Defaults to gemini-3-flash-preview; voice input is limited to 5 MB.

Send a question and store_id by GET or POST; use the full File Search store resource name when available. For audio, use the documented POST fields. Inspect the JSON answer and HTTP status before retrying.

https://www.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-flash-preview. 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 }

rag-management.php

Create and manage Gemini File Search stores and documents

Creates, finds, lists, and deletes Gemini File Search stores, and uploads or manages their documents for use with rag.php. Uploads are limited to 20 MB per document; default document chunks contain 512 tokens with a 100-token overlap. Returns resource names for later requests; create, upload, and delete actions change stored data.

Send an action and the fields required below. Use resolve_filestore to find or create a store by exact display name. Save returned resource names and verify resulting state before retrying an uncertain create, upload, or delete request.

https://www.promptbox.cn/api/rag-management.php  GET POST
ActionMethodEffect and result
queryGET or POSTDefault. Answers from an existing store; accepts the same query fields as rag.php.
create_filestorePOSTCreates a store from display_name; returns store/filestore.
resolve_filestorePOST recommendedFinds an exact display-name match or creates it; returns store_id, store_name, and created.
add_filePOSTUploads one document to store_id; returns the Gemini document object in file.
list_filesGET or POSTReturns files/documents and optional next_page_token.
delete_filePOSTDeletes one document and returns its normalized resource name in deleted.
delete_filestorePOSTDeletes one store and returns its normalized resource name in deleted.

Hyphenated action names are accepted. Aliases include create_store, resolve_store, upload_file, list_documents, delete_document, and delete_store.

NameTypeDescription
actionstringoptionalOperation listed above. Default: query. Alias: operation.
display_namestringrequired*Required for create/resolve and usable as the uploaded document name. Maximum 256 characters. Aliases for store creation/resolution include name and new_store_name.
store_idstringrequired*Required for query, upload, list, and store deletion. Full fileSearchStores/… name or bare ID. Aliases: filestore_id, store.
filefilerequired*Multipart document for add_file, up to 20 MB. Alias: first item in files_to_add.
file_b64stringconditionalJSON/form alternative to multipart upload. Plain base64 or a data URI, up to 20 MB decoded.
file_contentstringconditionalText/binary content alternative for add_file, up to 20 MB. Use filename and optional mime_type.
filenamestringoptionalDisplay filename for base64/content uploads. Maximum 256 characters.
file_idstringrequired*Required for delete_file. Full document resource, documents/…, or bare ID when store_id is supplied. Aliases: document_id, file_name, document_name.
page_sizeintegeroptionalFor list_files; maximum 100.
page_tokenstringoptionalContinuation token for list_files. Alias: pageToken.
forcebooleanoptionalFor delete actions. Default: true.

Returns application/json. Success responses use { "success": true, ... , "code": 200 }; the remaining fields depend on the action as described above. Errors use { "success": false, "error": "...", "code": 400 } or another appropriate HTTP status. HTTP 429 may include Retry-After.

# Idempotently resolve or create a store curl -X POST https://www.promptbox.cn/api/rag-management.php \ -H "Content-Type: application/json" \ -d '{"action":"resolve_filestore","display_name":"Product handbook"}' # Upload one document curl https://www.promptbox.cn/api/rag-management.php \ -F 'action=add_file' -F 'store_id=fileSearchStores/abc123' -F 'file=@handbook.pdf' # List documents without changing them GET https://www.promptbox.cn/api/rag-management.php?action=list_files&store_id=fileSearchStores/abc123&page_size=25 # Delete one document; mutating action POST https://www.promptbox.cn/api/rag-management.php Content-Type: application/json { "action": "delete_file", "store_id": "fileSearchStores/abc123", "file_id": "document456" }

rate-limit.php

Check and record rolling usage limits

Checks and records rolling daily and optional hourly request usage for a named program. New programs default to 300 requests per rolling day with no hourly limit, while existing programs may have custom limits. Use action=check for a non-consuming inspection and action=record to consume one request; denials return HTTP 429 and Retry-After.

Send a program name and action=check to inspect availability or action=record to consume usage. Read the JSON response, and honor HTTP 429 and its Retry-After value.

https://www.promptbox.cn/api/rate-limit.php  GET POST
NameTypeDescription
client_idUUID stringoptionalPersistent random installation UUID for usage analysis. It does not change shared program quotas.
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.

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

steam.php

Steam game reviews and community discussions

Retrieves Steam user reviews or searches community discussions for a game identified by name. Discussion search is the default; reviews=true selects reviews. Optional search terms narrow discussions, and unresolved game names return suggestions for a corrected request.

Send game_name by GET or POST. Set reviews=true for reviews or supply search_terms to narrow community discussions. Read the result in the documented response format and use returned suggestions if the game name cannot be resolved.

https://www.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

Returns stock quotes, company profiles, and financial metrics for a ticker symbol, ISIN, or CUSIP. Returns all three sections by default; callers may request selected sections or metric groups. Quotes may be delayed, so check timestamps and warnings before using them.

Send the security identifier by GET or POST. Use sections to select quote, profile, or financials and financial_metric when needed. Inspect the JSON result, including timestamps and warnings.

https://www.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

Transcribe speech to plain text

Transcribes uploaded or base64-encoded spoken audio into plain text. Accepts common browser audio formats up to 10 MB. Recordings shorter than 0.5 seconds, silence, or unintelligible audio may return null. Use llm_gemini.php when you need an answer to recorded speech rather than a transcript.

POST an audio file as multipart form data or use the supported base64 audio fields below. Read the successful response as plain text. Supply a custom prompt only when a particular transcript format is needed.

https://www.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('https://www.promptbox.cn/api/transcribe.php', { method: 'POST', credentials: 'omit', 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 technical product names." }

transcript.php

YouTube transcript extraction API

Returns existing captions for a public YouTube video in a JSON transcript field. Choose it for captions from one known video; use youtube.php to research a topic across videos or transcribe.php for your own audio. It does not generate missing captions. Cached captions may be up to 30 days old when a refresh fails; check stale and any warning.

Send an 11-character videoId or a YouTube URL by GET or POST and read transcript from the JSON result. Check cache and error fields. If captions are temporarily unavailable, skip the video or offer an explicit later retry rather than polling.

https://www.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.

Cached transcripts are fresh for seven days. If a refresh fails, captions up to 30 days old may be returned with stale:true and a warning. Each request makes one retrieval pass; offer an explicit later retry when needed.

{ "success": true, "videoId": "dQw4w9WgXcQ", "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "transcript": "...", "length": 2335, "source": "promptbox-youtube-captions", "cached": false, "stale": false }

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

Success includes source: promptbox-youtube-captions, cached and stale; cache hits also include cache_age_seconds. Stale recovery includes a warning and does not refresh the saved timestamp. Retrieval failures return HTTP 503 with retryable: true and diagnostics containing stage, HTTP status, response byte count and transport-error flag, without bodies or credentials. Upstream HTTP 429 uses error_code: youtube_rate_limited; HTTP 403 uses youtube_request_rejected; other failures remain caption_fetch_failed and do not prove captions are absent. Shared helper rate limits return HTTP 429 and retry_after. Callers may skip failed videos or offer an explicit later retry while retaining completed work. Invalid input returns HTTP 400.

# 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

Uploads temporary files, returns eight-character receipts and download URLs, reports receipt metadata, streams stored files, and supports explicit deletion. Files expire after three days and are deleted after the first API download by default unless auto_delete=0 is supplied. Each upload may be roughly 850 MB, but callers should inspect the JSON receipt before relying on storage.

POST multipart files with action=upload, save the returned receipt, and use its browser or API download URL. Files expire after three days and are deleted after the first API download by default unless auto_delete=0 was supplied.

https://www.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://www.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://www.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://www.promptbox.cn/api/transfer.php

tts.php

Multilingual speech with selectable voices and speed

Converts up to 50,000 characters of text into one MP3 or WAV speech file, or streams complete WAV blocks for earlier playback, with selectable voices and speed. Defaults to shimmer (Katerina), MP3, and normal speed. Supports Chinese, English, French, German, Russian, Italian, Spanish, Portuguese, Japanese, and Korean. Voice aliases are accepted; hear the selected voice before relying on its accent or timbre.

Send text by GET, JSON POST, or form POST, with optional voice, format, and speed. Save or play the returned audio bytes. For earlier playback, set stream=true and decode each WAV audio record from the application/x-ndjson response as it arrives. This is block streaming: the provider synthesizes each block completely. Do not wait for the whole response or automatically repeat a partially played request.

https://www.promptbox.cn/api/tts.php GET POST
NameTypeRequirementDescription
textstringrequiredText, maximum 50000 characters after markup cleanup. Empty or oversized inputs return HTTP 400. Longer requests take more time; allow sufficient client time or send smaller narration blocks for incremental playback.
voicestringoptionalCase-insensitive legacy aliases: alloy→Ethan, ash→Li, ballad→Ryan, coral→Cherry, echo→Nofish, fable→Dylan, onyx→Marcus, nova→Jennifer, sage→Elias, shimmer→Katerina, verse→Peter, marin→Kiki, cedar→Roy. Also accepts Qwen native voice: Cherry, Ethan, Nofish, Jennifer, Ryan, Katerina, Elias, Jada, Dylan, Sunny, Li, Marcus, Roy, Peter, Rocky, Kiki, Eric. Unknown values use shimmer (Katerina).
formatstringoptionalmp3 (default) or wav. Unknown formats use mp3.
speednumberoptionalDefault 1.0; clamped to 0.25–4.0. Controls playback speed.
streambooleanoptionalDefault false. True returns application/x-ndjson records with base64 WAV blocks instead of one audio file. The first block is at most 160 characters, later blocks at most 600; all text remains ordered. Streaming always uses WAV; format is ignored, and speed still applies. One request consumes one quota count.

Each legacy alias maps to a distinct Qwen voice. Gender follows Alibaba's voice descriptions; Elias is female and Li is male. Neutral-sounding alloy maps to male Ethan.

Legacy nameQwen voiceGender
alloyEthanMale (neutral legacy voice)
ashLiMale
balladRyanMale
coralCherryFemale
echoNofishMale
fableDylanMale
onyxMarcusMale
novaJenniferFemale
sageEliasFemale
shimmerKaterinaFemale
versePeterMale
marinKikiFemale
cedarRoyMale

By default, HTTP 200 with raw audio/mpeg or audio/wav bytes. With stream=true, HTTP 200 with application/x-ndjson: each line is {"type":"audio","index":0,"format":"wav","data":"BASE64"}, followed by {"type":"done","chunks":1}. An upstream failure after streaming starts produces {"type":"error","error":"..."}; a missing done record means an incomplete stream. Stop queued playback on failure or cancellation. Audio records may span multiple network reads; buffer until a newline. Before streaming begins, validation, configuration and rate-limit errors use the normal JSON and HTTP error contract. Errors return JSON {"success":false,"error":"..."} with HTTP 400, 405, 429, 500 or 502. The request quota counts each helper request once. Native Qwen voice names and legacy aliases are accepted case-insensitively. No caller API key is needed.

GET tts.php?text=Hello+world&voice=nova POST tts.php {"text":"你好。Hello.こんにちは。","voice":"Jennifer","format":"wav","speed":1.25} POST tts.php Content-Type: application/json {"text":"Read this aloud as each block arrives.","voice":"Jennifer","stream":true}

tts_inworld.php

Speech with selectable Inworld voices

Converts up to 50,000 characters of text into one MP3 or WAV speech file using selectable Inworld voices. Defaults to Ashley and MP3. If Inworld is unavailable, a backup voice may sound different and supports only the ten languages documented for tts.php.

Send text by GET or POST with optional voice and format. Save or play the returned audio bytes. Send smaller blocks sequentially for earlier playback.

https://www.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, up to 50000 characters. Returns one complete audio file.
voicestringoptionalVoice name. Default: Ashley. Options: Alex, Ashley, Craig, Deborah, Dennis, Edward, Elizabeth, Julia, Mark, Olivia, Priya, Sarah, Shaun, Theodore, Timothy, Wendy, Yichen, Xiaoyin, Xinyi, Jing.
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 public Twitter/X, Facebook, and Reddit posts or comments and returns a formatted summary plus structured results. Defaults to Twitter/X, Facebook, and Reddit posts; select Reddit comments explicitly. Supports sorting, pagination, and optional Facebook sentiment. Queries are limited to 500 characters.

Send query by GET or POST and choose platforms when needed. Start with one page per platform. Read the structured results to display links, authors, and metadata, and check any warnings.

https://www.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 H.264/AAC MP4 using FFmpeg. The default balanced profile caps the long edge at 1280 pixels; small and quality target roughly 540p and 1080p, respectively. It accepts files up to 600 MB, has no Promptbox request quota, and retains no output unless save is explicitly enabled.

POST the source in the multipart video field with any optional compression settings, then save the returned video/mp4 bytes. Enable save only when a public archived copy is required.

GET POST https://www.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://www.promptbox.cn/api/video_compress.php', {
  method: 'POST',
  credentials: 'omit',
  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 helper has no Promptbox request quota. Browser origin restrictions described above still apply.

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

Searches the live web and returns a number or a plain-text answer. The default returns the first number found; text=true returns prose. Queries are capped at 400 characters, and url can restrict the source domain. Use web_read.php to read a particular page or file.

Send prompt by GET or POST and read plain text. Set text=true for a prose answer, max_sentences for a length cap, or url for a source domain. Use mode=image_prompt_refine only to improve an image prompt; that mode does not search the web.

https://www.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/file reader and automatic web search returning JSON text

Extracts text and source metadata from one public URL or uploaded file, including webpages, PDFs, office documents, feeds, images, media, and YouTube captions. Images use llm_chatgpt.php with model=lite (currently gpt-6-luna) at original resolution. JPEG, PNG, and WebP bytes are sent unchanged; other image formats are converted to full-resolution PNG, using the first frame for animated images. Document and text-bearing pictures request every readable word, number, table cell, footnote, and handwritten note in the original language and reading order, with unreadable portions marked [illegible]; scenes receive a description plus all visible text. Search terms return a generated search summary with source links/snippets, answer status and warnings. Search success is not answer verification; insufficient or mismatched-date evidence needs a targeted follow-up. Uploads and supported document downloads are limited to 10 MB; oversized downloads return an error instead of partial file bytes. PDFs are limited to 30 pages per request. Each page is checked separately: usable embedded text is preserved, while pages with images/form objects or unusable text are rendered at 240 dpi (up to 3200 pixels per side, lossless PNG) for OCR in batches of up to three pages. Page boundaries, paragraph breaks, table spacing, and literal characters are retained. OCR responses must finish normally and cover every requested page; failures are errors, never silent partial success. Automatic checks cannot detect every faulty text layer; use pdf_ocr=always to visually transcribe all pages. OCR may misread characters or numbers; verify critical values against the original. Uncertain spans are marked [illegible]. PDF, Office, ebook, plain/structured text, email and feed output defaults to 500,000 characters for URLs and uploads, with explicit caller limits respected. Image output defaults to 500,000 characters, supports an explicit max_chars up to 500,000, and requests up to 32,768 model completion tokens including reasoning; exceptionally dense images may exceed the model output allowance. HTML, media transcripts and search output default to 12,000 characters and are capped at 30,000 for URLs/search or 500,000 for uploads. Direct HTTP reading follows up to 10 redirects, validating each destination. An eleventh redirect returns HTTP 424 with error_kind:"target_redirect_error"; this error does not invoke browser or search fallback. Empty HTML or recognizable JavaScript/loading shells first use browser.php in a new isolated session, with no saved login profile. The reader waits once for 2.5 seconds after navigation and extracts rendered main-page text, then closes its session. Version 3.4 also retries HTTP 403 HTML responses once in an isolated browser, with one 8-second wait for automatic page loading. Successful retries return reader_mode: "browser_text" and browser_fallback.trigger_status: 403. Persistent login or verification challenges return target_access_required; unavailable browser reads preserve the HTTP error. This 403 path does not use search fallback or submit challenges. Short valid pages stay on direct extraction. If browser reading is unavailable or still has no useful text, Tavily is the final search fallback. Search answers may summarize a source rather than reproduce the full page. DOCX preserves paragraphs/tables and includes headers, footers, footnotes, endnotes and comments. PPTX follows presentation slide order and includes speaker notes. XLSX preserves sheet order, cell addresses, shared strings, dates, numeric formatting, booleans, comments, hyperlinks and merged ranges; saved formula results are labeled and never recalculated. EPUB follows the package spine rather than ZIP order. ODT preserves document text, tables and headers/footers. RTF decodes Unicode and escaped text; EML decodes MIME headers and message bodies while listing attachments separately. JSON retains its original values and syntax, including false, null, empty values and large numbers. Plain text and CSV retain line breaks and literal characters; XML is returned as a labeled hierarchy. RSS/Atom include all entries up to the explicit 1,000-entry limit, including Atom link URLs. Office and ebook raster images use embedded-image OCR by default; see document_ocr and coverage warnings below. Legacy binary DOC/XLS/PPT files are explicitly unsupported.

Supply exactly one url containing a public URL or search terms, or one multipart file. Use GET or POST for URLs/search and multipart POST for files. Inspect text, reader_mode, source_type, and truncated. For PDFs also inspect pdf.page_count, pdf.ocr_pages, pdf.blank_pages, and pdf.warnings. Inspect document.extraction_complete and document.warnings for non-PDF documents. Set document_ocr=off when only native Office/ebook text is needed. Submit email attachments separately. Split PDFs exceeding 30 pages into smaller files. OCR can take several minutes; each batch consumes one shared Gemini request and inherits its rate limit. The only automatic HTTP-error retry is the single browser attempt for HTML 403 responses. Set fallback=off to disable both browser and search fallback and use direct extraction only. Search terms still perform a search, with a 400-character query cap. Inspect answer_status and sources before relying on a search answer; for time-sensitive questions match the source date and destination timezone. Search queries do not automatically enter the URL browser-rendering fallback.

https://www.promptbox.cn/api/web_read.php  GET POST
NameTypeDescription
urlstringconditionalA public resource URL or natural-language search terms. Recognizable hostnames without a scheme assume https://; search terms automatically use Tavily. 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: 500000 for images, PDFs, Office/ebook files, text documents, email and feeds, 12000 otherwise. Minimum: 1000. Maximum: 500000 for images, PDFs, Office/ebook files, text documents, email and feeds (URL or upload), and other uploads, 30000 for other URLs/search answers. Explicit caller limits can truncate any returned text; inspect truncated.
document_ocrstringoptionalauto (default) transcribes embedded raster images in DOCX, PPTX, XLSX, ODT and EPUB. off reads native text only and reports omitted images. Up to 10 image references per document; duplicate image bytes are transcribed once. Supported embedded formats: PNG, JPEG, WebP and GIF (first frame). Image transcriptions are appended after native text with source labels. Each unique supported image consumes one shared Gemini request; completion is checked, failures return errors and no automatic retries are performed. Embedded vector graphics, charts and objects require PDF export for visual reading. PDF and standalone image behavior are unaffected.
pdf_ocrstringoptionalauto (default) checks each PDF page and OCRs pages containing images/form objects or unusable embedded text. always OCRs every page, useful for incorrect but apparently readable text layers. Only these two values are accepted; ignored for non-PDF sources.
fallbackstringoptionalSet to off to disable browser rendering and Tavily search fallback for URL extraction. Default: auto. Empty HTML or explicit JavaScript/loading shells try browser rendering before search; other empty readable resource types retain their existing search fallback. Short text alone does not trigger rendering. Explicit search terms still use Tavily with fallback=off. PDF and document extraction errors never become search answers. Uploads and the dedicated YouTube/MSN paths do not use this fallback; target HTTP errors and failed URL validation remain errors.
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 }. Search success: { ok, source_type:"web_search", query, title, text, text_length, truncated, content_type, status, reader_mode:"web_search" }. A search fallback retains url, final_url, and redirects, adds source_type:"web_search", and uses reader_mode:"web_search_fallback". These results are Tavily search answers, not guaranteed full-page extraction. Search terms use the reader’s 400-character query cap and shared web rate limits; unavailable answers return HTTP 502 for search requests, and upstream rate limits propagate HTTP 429 with Retry-After when supplied. Reader modes include html_text, browser_text for rendered webpage text, document_text, pdf_text for embedded PDF text, pdf_ocr for fully OCR-read PDFs, pdf_mixed for combined embedded-text and OCR pages, archive_document_text, feed_text, youtube_transcript, image_description, media_transcript, web_search, web_search_fallback, 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/search requests.

PDF success also includes pdf: { page_count, ocr_pages, text_pages, blank_pages, extraction_complete, warnings }. Page numbers are one-based. extraction_complete:true means every page completed extraction before the caller's character limit; it is not a guarantee of recognition accuracy. truncated:true means the returned text was shortened by max_chars. text_length retains its existing UTF-8 byte-count meaning. Blank/non-text pages appear as Page N followed by [No readable text]. PDF errors include HTTP 413 (pdf_page_limit or resource_too_large), 422 (pdf_invalid, pdf_render_failed, pdf_unreadable), 502/504 (pdf_ocr_incomplete), or 503 for unavailable OCR/rendering. Encrypted/damaged PDFs that cannot be read are rejected. No legacy font-blind extraction or unverified whole-document OCR fallback is used.

Office, ebook, email, RTF, text and feed responses add document: { format, extraction_complete, warnings, units?, embedded_images?, entries? }. units counts sheets, slides, EPUB spine sections, or one main DOCX/ODT document. embedded_images counts discovered image references, not necessarily unique images or completed OCR calls. extraction_complete:false indicates known skipped content or missing formula results; true means no known omission was detected, not guaranteed visual fidelity. Shape reading order, automatic list numbering, equation layout, master/layout text, embedded charts/objects and complex RTF font mappings are not fully reconstructed. Email attachments and remote linked resources are not fetched. Some apparently readable text may still be wrong; export complex layouts to PDF for visual reading. Encrypted or damaged archives, invalid JSON/XML/RTF and ambiguous text encodings return HTTP 422 (document_invalid); legacy binary Office formats return 415 (document_unsupported). Text accepts UTF-8, BOM-marked UTF-16/32, and supported declared charsets; undeclared non-UTF-8 text must be converted to UTF-8. XML custom entities and document-type declarations are rejected. Archive limits: 10,000 entries, 20 MB per expanded part, 50 MB expanded total; XLSX permits up to 100,000 stored cells. These limits and the 10-image/1,000-feed-entry limits return HTTP 413 (document_limit), never silent partial output. Embedded-image OCR failures return HTTP 502/504 (document_ocr_incomplete). Native document text is not sent to a model; embedded images are sent only when OCR is enabled.

Browser success retains URL metadata and adds reader_mode:"browser_text", source_type:"url", browser_fallback:{attempted:true,status:"ready"}, and warnings. If search follows an unsuccessful browser attempt, browser_fallback.status is unavailable or no_readable_content. Rendered text honors the normal URL character limit (12,000 default, 30,000 maximum), with Unicode-aware truncated reporting. Rendering captures one snapshot without clicking, scrolling or filling forms; later-loaded and embedded-frame content may be absent. Recognized login/verification pages return HTTP 422 with error_kind:"target_access_required"; they are not bypassed or replaced with search answers. Initial non-2xx target responses and PDF/document extraction errors remain errors. Browser rendering uses the server's existing private credential, shares browser quota/capacity, and normally consumes three operations (create, read, close). No existing session or saved profile is selected. Navigation and cleanup use fixed timeouts; if cleanup cannot be confirmed, idle expiry applies. The browser helper's own bounded navigation recovery policy still applies; web_read does not retry browser calls.

Search and search-fallback responses add answer_type:"generated_search_summary", answer_status:"unverified"|"insufficient_evidence", sources:[{url,title,snippet,published_date}], retrieved_at, query_truncated and warnings. The reader requests one advanced Tavily search with up to five results and retains source snippets of at most 2,000 characters each. It shares the existing web search credentials and rate limits. Advanced search uses two provider credits; it does not guarantee a matching dated forecast. ok:true confirms successful retrieval, not a verified answer. Missing-evidence detection is a conservative text heuristic; all other generated summaries remain unverified. Source timestamps may be absent, and retrieval time must not be treated as the source's date. max_chars limits the answer text; the separately bounded source snippets remain available for follow-up. For weather and other current facts, inspect a dated source matching the requested location and date rather than treating averages or another day's conditions as the answer.

# Read one exact page GET web_read.php?url=https://www.promptbox.cn/index.html&max_chars=8000 # Search terms automatically use Tavily GET web_read.php?url=ABC+store+opening+hours # Disable URL extraction fallback (search terms still work) GET web_read.php?url=https://example.com/article&fallback=off # Read a PDF with extractable text GET web_read.php?url=https://www.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://www.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=500000" https://www.promptbox.cn/api/web_read.php # Read a workbook without embedded-image OCR curl -F "file=@report.xlsx" -F "document_ocr=off" https://www.promptbox.cn/api/web_read.php # Visually transcribe every PDF page curl -F "file=@report.pdf" -F "pdf_ocr=always" https://www.promptbox.cn/api/web_read.php

youtube.php

YouTube search + transcript AI synthesis

Searches YouTube, reads available captions from up to five relevant videos, and returns an answer based on those transcripts. Choose it to research a question across videos; use transcript.php for captions from one known video. Videos without accessible captions are skipped.

Send a question in prompt by GET or POST and read the JSON content answer. If no usable videos or captions are available, inspect the error and offer an explicit later retry. Do not poll.

https://www.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?" }