curl --request POST \
--url https://revise.io/api/v1/convert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"input": {
"file_id": "<string>"
},
"output": {},
"limits": {
"max_platform_cost_usd": "2.000000000",
"max_inference_cost_usd": "3.000000000",
"max_seconds": 900
},
"inference": {
"model": "<string>"
},
"metadata": {
"customer": "acme",
"environment": "production"
}
}
'import requests
url = "https://revise.io/api/v1/convert"
payload = {
"input": { "file_id": "<string>" },
"output": {},
"limits": {
"max_platform_cost_usd": "2.000000000",
"max_inference_cost_usd": "3.000000000",
"max_seconds": 900
},
"inference": { "model": "<string>" },
"metadata": {
"customer": "acme",
"environment": "production"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
input: {file_id: '<string>'},
output: {},
limits: {
max_platform_cost_usd: '2.000000000',
max_inference_cost_usd: '3.000000000',
max_seconds: 900
},
inference: {model: '<string>'},
metadata: {customer: 'acme', environment: 'production'}
})
};
fetch('https://revise.io/api/v1/convert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://revise.io/api/v1/convert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
'file_id' => '<string>'
],
'output' => [
],
'limits' => [
'max_platform_cost_usd' => '2.000000000',
'max_inference_cost_usd' => '3.000000000',
'max_seconds' => 900
],
'inference' => [
'model' => '<string>'
],
'metadata' => [
'customer' => 'acme',
'environment' => 'production'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://revise.io/api/v1/convert"
payload := strings.NewReader("{\n \"input\": {\n \"file_id\": \"<string>\"\n },\n \"output\": {},\n \"limits\": {\n \"max_platform_cost_usd\": \"2.000000000\",\n \"max_inference_cost_usd\": \"3.000000000\",\n \"max_seconds\": 900\n },\n \"inference\": {\n \"model\": \"<string>\"\n },\n \"metadata\": {\n \"customer\": \"acme\",\n \"environment\": \"production\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://revise.io/api/v1/convert")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"file_id\": \"<string>\"\n },\n \"output\": {},\n \"limits\": {\n \"max_platform_cost_usd\": \"2.000000000\",\n \"max_inference_cost_usd\": \"3.000000000\",\n \"max_seconds\": 900\n },\n \"inference\": {\n \"model\": \"<string>\"\n },\n \"metadata\": {\n \"customer\": \"acme\",\n \"environment\": \"production\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://revise.io/api/v1/convert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"file_id\": \"<string>\"\n },\n \"output\": {},\n \"limits\": {\n \"max_platform_cost_usd\": \"2.000000000\",\n \"max_inference_cost_usd\": \"3.000000000\",\n \"max_seconds\": 900\n },\n \"inference\": {\n \"model\": \"<string>\"\n },\n \"metadata\": {\n \"customer\": \"acme\",\n \"environment\": \"production\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "conversion",
"status": "queued",
"mode": "deterministic",
"input": {
"file_id": "<string>",
"format": "pdf",
"filename": "<string>",
"bytes": 123,
"sha256": "<string>"
},
"output": {
"format": "docx",
"artifact": {
"id": "<string>",
"format": "docx",
"filename": "<string>",
"content_type": "<string>",
"variant": "tracked_changes",
"sha256": "<string>",
"bytes": 123,
"download_url": "<string>",
"input_eligible": true,
"expires_at": "2023-11-07T05:31:56Z",
"prompt_id": "<string>",
"conversion_id": "<string>",
"encryption": {
"format": "jwe",
"alg": "RSA-OAEP-256",
"enc": "A256GCM",
"key_id": "<string>"
},
"deleted_at": "2023-11-07T05:31:56Z"
}
},
"output_encrypted": true,
"metadata": {
"customer": "acme",
"environment": "production"
},
"usage": {
"pricing_version": "local-v5-monthly-fees",
"platform": {
"tool_cpu_seconds": "1.000000",
"tool_cpu_rate_usd_per_second": "0.001000000"
},
"inference": {
"billed_by": "revise",
"input_tokens": 1200,
"cached_input_tokens": 400,
"cache_creation_input_tokens": 0,
"output_tokens": 200,
"web_search_requests": 1,
"web_search_unit": "calls"
},
"cost": {
"total_usd": "0.061000000",
"itemized": {
"base_fee_usd": "0.050000000",
"cpu_fee_usd": "0.001000000",
"inference_fee_usd": "0.010000000"
}
}
},
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"content_expires_at": "2023-11-07T05:31:56Z",
"content_deleted_at": "2023-11-07T05:31:56Z",
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"retention": {
"delete_after_webhook_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Create a conversion
Conversions cost 0.02per1,000wordsintheconvertedoutput,witha0.10 minimum. The charge is proportional per word rather than rounded to started 1,000-word units. Managed PDF/image scanning inference is included; when BYOK is selected, the provider separately bills its own inference. Vision conversion rasterizes pages in order and sends up to 10 distinct page images per model request.
curl --request POST \
--url https://revise.io/api/v1/convert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"input": {
"file_id": "<string>"
},
"output": {},
"limits": {
"max_platform_cost_usd": "2.000000000",
"max_inference_cost_usd": "3.000000000",
"max_seconds": 900
},
"inference": {
"model": "<string>"
},
"metadata": {
"customer": "acme",
"environment": "production"
}
}
'import requests
url = "https://revise.io/api/v1/convert"
payload = {
"input": { "file_id": "<string>" },
"output": {},
"limits": {
"max_platform_cost_usd": "2.000000000",
"max_inference_cost_usd": "3.000000000",
"max_seconds": 900
},
"inference": { "model": "<string>" },
"metadata": {
"customer": "acme",
"environment": "production"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
input: {file_id: '<string>'},
output: {},
limits: {
max_platform_cost_usd: '2.000000000',
max_inference_cost_usd: '3.000000000',
max_seconds: 900
},
inference: {model: '<string>'},
metadata: {customer: 'acme', environment: 'production'}
})
};
fetch('https://revise.io/api/v1/convert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://revise.io/api/v1/convert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
'file_id' => '<string>'
],
'output' => [
],
'limits' => [
'max_platform_cost_usd' => '2.000000000',
'max_inference_cost_usd' => '3.000000000',
'max_seconds' => 900
],
'inference' => [
'model' => '<string>'
],
'metadata' => [
'customer' => 'acme',
'environment' => 'production'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://revise.io/api/v1/convert"
payload := strings.NewReader("{\n \"input\": {\n \"file_id\": \"<string>\"\n },\n \"output\": {},\n \"limits\": {\n \"max_platform_cost_usd\": \"2.000000000\",\n \"max_inference_cost_usd\": \"3.000000000\",\n \"max_seconds\": 900\n },\n \"inference\": {\n \"model\": \"<string>\"\n },\n \"metadata\": {\n \"customer\": \"acme\",\n \"environment\": \"production\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://revise.io/api/v1/convert")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"file_id\": \"<string>\"\n },\n \"output\": {},\n \"limits\": {\n \"max_platform_cost_usd\": \"2.000000000\",\n \"max_inference_cost_usd\": \"3.000000000\",\n \"max_seconds\": 900\n },\n \"inference\": {\n \"model\": \"<string>\"\n },\n \"metadata\": {\n \"customer\": \"acme\",\n \"environment\": \"production\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://revise.io/api/v1/convert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"file_id\": \"<string>\"\n },\n \"output\": {},\n \"limits\": {\n \"max_platform_cost_usd\": \"2.000000000\",\n \"max_inference_cost_usd\": \"3.000000000\",\n \"max_seconds\": 900\n },\n \"inference\": {\n \"model\": \"<string>\"\n },\n \"metadata\": {\n \"customer\": \"acme\",\n \"environment\": \"production\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "conversion",
"status": "queued",
"mode": "deterministic",
"input": {
"file_id": "<string>",
"format": "pdf",
"filename": "<string>",
"bytes": 123,
"sha256": "<string>"
},
"output": {
"format": "docx",
"artifact": {
"id": "<string>",
"format": "docx",
"filename": "<string>",
"content_type": "<string>",
"variant": "tracked_changes",
"sha256": "<string>",
"bytes": 123,
"download_url": "<string>",
"input_eligible": true,
"expires_at": "2023-11-07T05:31:56Z",
"prompt_id": "<string>",
"conversion_id": "<string>",
"encryption": {
"format": "jwe",
"alg": "RSA-OAEP-256",
"enc": "A256GCM",
"key_id": "<string>"
},
"deleted_at": "2023-11-07T05:31:56Z"
}
},
"output_encrypted": true,
"metadata": {
"customer": "acme",
"environment": "production"
},
"usage": {
"pricing_version": "local-v5-monthly-fees",
"platform": {
"tool_cpu_seconds": "1.000000",
"tool_cpu_rate_usd_per_second": "0.001000000"
},
"inference": {
"billed_by": "revise",
"input_tokens": 1200,
"cached_input_tokens": 400,
"cache_creation_input_tokens": 0,
"output_tokens": 200,
"web_search_requests": 1,
"web_search_unit": "calls"
},
"cost": {
"total_usd": "0.061000000",
"itemized": {
"base_fee_usd": "0.050000000",
"cpu_fee_usd": "0.001000000",
"inference_fee_usd": "0.010000000"
}
}
},
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"content_expires_at": "2023-11-07T05:31:56Z",
"content_deleted_at": "2023-11-07T05:31:56Z",
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"retention": {
"delete_after_webhook_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}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" });
Authorizations
Revise API key from https://revise.io/console/api-keys. Send Authorization: Bearer .
Headers
1 - 200Body
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The base fee is graduated per API account each UTC calendar month: requests 1-1000 $0.05, 1001-5000 $0.035, 5001-10000 $0.02, then $0.01. Each newly accepted request counts once across all keys, including later failures/cancellations. Retries with the same idempotency key do not count again. The rate is pinned on admission; CPU and inference rates do not change with volume.
Show child attributes
Show child attributes
{
"max_platform_cost_usd": "2.000000000",
"max_inference_cost_usd": "3.000000000",
"max_seconds": 900
}
Show child attributes
Show child attributes
Show child attributes
Show child attributes
{
"customer": "acme",
"environment": "production"
}
Encrypt 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.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Queued conversion
queued, running, succeeded, failed, cancelled Empty after request content has been deleted.
deterministic, vision, Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
{
"customer": "acme",
"environment": "production"
}
Customer-facing settled charges and usage. Supplier costs, margins and internal reconciliation diagnostics are not exposed. Historical charges are never recalculated using current prices.
Show child attributes
Show child attributes
{
"pricing_version": "local-v5-monthly-fees",
"platform": {
"tool_cpu_seconds": "1.000000",
"tool_cpu_rate_usd_per_second": "0.001000000"
},
"inference": {
"billed_by": "revise",
"input_tokens": 1200,
"cached_input_tokens": 400,
"cache_creation_input_tokens": 0,
"output_tokens": 200,
"web_search_requests": 1,
"web_search_unit": "calls"
},
"cost": {
"total_usd": "0.061000000",
"itemized": {
"base_fee_usd": "0.050000000",
"cpu_fee_usd": "0.001000000",
"inference_fee_usd": "0.010000000"
}
}
}
Show child attributes
Show child attributes
Show child attributes
Show child attributes