@reviseio/api is a public npm package for Node.js 22+ and compatible runtimes. It has no runtime npm dependencies. Use it on your server; fromPath and save require Node filesystem APIs.
files, prompts, conversions, artifacts, account, models, usage, and webhooks. Their JSON bodies use the same snake_case fields shown in the REST reference. Each endpoint page includes a corresponding TypeScript example.
Sources and results
edit(source, prompt, options) and convert(source, format, options) handle input resolution, upload, submission, and polling. Both return another Source, so results can become inputs without managing intermediate transfers.
All factories accept filename, contentType, maxBytes, and upload lifetime options. A filename is required for upload: URLs/Responses infer it from Content-Disposition or the URL path, and unnamed Blobs need one supplied. Redirects are disabled. Applications accepting user-supplied URLs must enforce their own network access policy.
bytes() returns an independent byte copy; blob() returns an immutable Blob; stream() returns a fresh Web stream after buffering and verification; save(path) writes to an explicit local path. Standalone reads default to 64 MiB and accept { signal, maxBytes }. Upload resolution caps at 18 MiB. The byte limit is not a process-memory ceiling.
Successful reads are cached snapshots. A failed one-shot stream/Response cannot restart. Its active reader owns the signal and cap, so an abort or size failure also affects waiting readers. Use a stream factory for retryable input; an independently aborted waiter cannot cancel another active reader.
source.result and source.artifact are defensive copies. variant("tracked_changes") selects another output from the same prompt; edits return the clean artifact by default. getResponseMetadata works on original low-level JSON results, not copied source.result receipts.
Configuration
outputEncryption, responseOptions (edit only), trackedChanges (edit only), inference, limits, metadata, and retention. Direct REST-shaped methods retain wire names such as output_encryption.
See job lifecycle and error recovery for deadlines and retry behavior. A returned Source downloads lazily with its own signal. Aborting locally never cancels a server job automatically.