Create a conversion
https://revise.io/api/v1/convertConvert one uploaded file to docx, pdf, md, html, or txt. Same-format conversion is rejected. DOCX, Markdown, HTML, text, RTF, and ODT use deterministic conversion at $0.005 each. PDF and image inputs use semantic scanning: $0.02 per page with managed inference on the default OpenAI model, or $0.005 per page plus provider inference when using your own OpenAI key. Only your own key permits another catalogued OpenAI model. Deterministic conversions reject nonempty inference settings. Uploads are limited to 18 MiB, PDFs to 100 pages, and output to 50 MiB before encryption. There is no default spending cap; an explicitly set insufficient page budget fails with conversion_limit_exceeded before inference. PDF processing errors include pdf_page_limit_exceeded, pdf_password_protected, invalid_pdf, and empty_pdf. These validation failures are unbilled. Cancellation or customer limits can incur charges for work already performed; read settled usage. Conversions have no additional CPU or Revise inference fee and do not count toward prompt base-fee tiers.
See conversion formats and limits for integration guidance.
This call returns an admission receipt. Poll the get endpoint until work stops, then inspect the result and download its artifacts. See job lifecycle.
TypeScript#
import { ReviseClient } from "@reviseio/api";
const revise = new ReviseClient({ apiKey: process.env.REVISE_API_KEY! });
const result = await revise.conversions.create(
{ input: { file_id: "file_id" }, output: { format: "pdf" } },
{ idempotencyKey: "convert-42" },
);Authorization#
AuthorizationstringrequiredBearer <key>, with an API key from the console.
Headers#
Idempotency-Keystringrequiredmin length 1 · max length 200
Body#
application/json · required
inputobjectrequiredProperties
file_idstringrequiredoutputobjectrequiredProperties
formatstringrequiredone of "docx", "pdf", "md", "html", "txt"
limitsLimitsOptional execution and spending thresholds. Spending limits are opt-in: omitted cost limits are unlimited. The time limit defaults to 900 seconds. Prompt platform cost is base fee plus tool CPU; conversion platform cost is its flat/page fee. Prompt cost limits may each be at most $500,000; conversion cost limits may each be at most $1,000,000. These thresholds do not reserve account credit.
example {"max_platform_cost_usd":"2.000000000","max_inference_cost_usd":"3.000000000","max_seconds":900}
Properties
max_platform_cost_usdstring | numberPlatform spending threshold. Must cover the applicable base/conversion fee, or one scan page. A scan checks its full page fee before inference. For prompts, no new model call starts once observed platform spend reaches this threshold; active work may exceed it. Omit for no per-request spending limit. Must be greater than zero when supplied.
max_inference_cost_usdstring | numberSoft inference threshold, including managed prompt premium and search. Active responses can exceed it. With your own provider key it meters provider list-price spend, while Revise charges no inference fee. For managed scans, scan inference is included in the page fee but remains subject to this threshold. Omit for no per-request spending limit. Must be greater than zero when supplied.
max_secondsintegerdefault: 900Work budget in seconds, starting when a worker begins, excluding queue time. Prompts stop new turns at the deadline; active responses and exports can finish later.
min 120 · max 3600
inferenceInferenceRequestProperties
providerstringPublic provider ID. Omit for the API default on a new conversation, or inherit from previous_prompt_id.
one of "openai", "anthropic", "xai", "gemini"
modelstringExact model ID from /v1/models, or default. Omitting it selects the provider default, except when inherited from a predecessor.
billingstringWhich party pays for inference. Omitted or "revise" is automatic: the account's stored key for the resolved provider is used when present (billed by the provider, no Revise inference charge), otherwise managed inference applies. "provider" requires a stored key for the resolved provider and fails admission with provider_key_required instead of falling back. Provider resolution includes defaults and predecessor inheritance, so an omitted provider still uses the account key.
one of "revise", "provider"
metadataMetadataUp to 16 string values for application attribution. Keys are 1–64 UTF-8 bytes; values at most 512 UTF-8 bytes. Metadata is deleted with request content; persist your own job mapping for long-term attribution.
example {"customer":"acme","environment":"production"}
output_encryptionOutputEncryptionEncrypt exported artifact bytes using compact JWE, RSA-OAEP-256 and A256GCM. Only encrypted files are downloadable. Disables prompt continuation and artifact reuse; cannot be combined with previous_prompt_id or artifact_id input. Prompts require editing or export_document=true.
Properties
formatstringrequiredone of "jwe"
public_key_pemstringrequiredRSA SubjectPublicKeyInfo PEM (BEGIN PUBLIC KEY), 2048–8192 bits. Private keys, certificates and key URLs are rejected.
max length 16384
retentionRetentionOptionsProperties
delete_after_webhook_idstringrequiredAccount-owned endpoint subscribed to prompt.completed or conversion.completed, matching the request kind. Its successful acknowledgement deletes request content and ephemeral source. Download everything before returning 2xx.
Responses#
202ConversionQueued conversion
Headers
LocationstringAccount-authenticated path to retrieve this resource.
Idempotent-ReplayedstringPresent with value true on an idempotent replay.
Retry-AfterstringSuggested delay before polling, in seconds.
Body
idstringrequiredobjectstringrequiredalways "conversion"
statusstringrequiredone of "queued", "running", "succeeded", "failed", "cancelled"
modestringrequiredEmpty after request content has been deleted.
one of "deterministic", "vision", ""
inputobjectrequiredProperties
file_idstringrequiredformatstringrequiredEmpty after request content has been deleted.
one of "pdf", "docx", "md", "html", "txt", "rtf", "odt", "image", ""
filenamestringrequiredbytesintegerrequiredsha256stringrequiredoutputobjectrequiredProperties
formatstringrequiredEmpty after request content has been deleted.
one of "docx", "pdf", "md", "html", "txt", ""
artifactArtifact | nullrequiredoutput_encryptedbooleanrequiredmetadataMetadatarequiredUp to 16 string values for application attribution. Keys are 1–64 UTF-8 bytes; values at most 512 UTF-8 bytes. Metadata is deleted with request content; persist your own job mapping for long-term attribution.
example {"customer":"acme","environment":"production"}
usageUsage | nullrequiredcreated_atstring<date-time>requiredcompleted_atstring | nullrequiredcontent_expires_atstring | nullrequiredcontent_deleted_atstring | nullrequirederrorobject | nullrequiredretentionRetentionOptionsProperties
delete_after_webhook_idstringrequiredAccount-owned endpoint subscribed to prompt.completed or conversion.completed, matching the request kind. Its successful acknowledgement deletes request content and ephemeral source. Download everything before returning 2xx.
defaultErrorError
errorobjectrequiredProperties
codestringrequiredmessagestringrequireddetailsobject