typefile
{
"doc": "https://replicate.delivery/pbxt/M9lE653pyLnXBk7P0VrmymcjqvQyXKsBBUgNkLz3YN2Y9wdw/Tradewinds%2BMarketplace%2BAnnouncement%2BRevision%2B6.pdf"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Oky**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run cuuupid/markitdown using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"cuuupid/markitdown:dd93798a7da2d07eca80ff763499525f3287a35d18d8bd40627297ce0dadfe6c",
{
input: {
doc: "https://replicate.delivery/pbxt/M9lE653pyLnXBk7P0VrmymcjqvQyXKsBBUgNkLz3YN2Y9wdw/Tradewinds%2BMarketplace%2BAnnouncement%2BRevision%2B6.pdf"
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Oky**********************************
This is your API token. Keep it to yourself.
import replicate
Run cuuupid/markitdown using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cuuupid/markitdown:dd93798a7da2d07eca80ff763499525f3287a35d18d8bd40627297ce0dadfe6c",
input={
"doc": "https://replicate.delivery/pbxt/M9lE653pyLnXBk7P0VrmymcjqvQyXKsBBUgNkLz3YN2Y9wdw/Tradewinds%2BMarketplace%2BAnnouncement%2BRevision%2B6.pdf"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Oky**********************************
This is your API token. Keep it to yourself.
Run cuuupid/markitdown using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "cuuupid/markitdown:dd93798a7da2d07eca80ff763499525f3287a35d18d8bd40627297ce0dadfe6c",
"input": {
"doc": "https://replicate.delivery/pbxt/M9lE653pyLnXBk7P0VrmymcjqvQyXKsBBUgNkLz3YN2Y9wdw/Tradewinds%2BMarketplace%2BAnnouncement%2BRevision%2B6.pdf"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "sar7fcvqssrgc0ckt67vnnshtg",
"model": "cuuupid/markitdown",
"version": "dd93798a7da2d07eca80ff763499525f3287a35d18d8bd40627297ce0dadfe6c",
"input": {
"doc": "https://replicate.delivery/pbxt/M9lE653pyLnXBk7P0VrmymcjqvQyXKsBBUgNkLz3YN2Y9wdw/Tradewinds%2BMarketplace%2BAnnouncement%2BRevision%2B6.pdf"
},
"logs": "/tmp/tmp65nbl8y2Tradewinds Marketplace Announcement Revision 6.pdf\n<markitdown._markitdown.DocumentConverterResult object at 0x7c1288215090>",
"output": "https://replicate.delivery/czjl/XjQLmZIOYF7vPJO2PFYsToGbOpTINSUTp64zzfReUQTQnl7TA/output.md",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-12-16T22:21:00.75Z",
"started_at": "2024-12-16T22:21:00.766182Z",
"completed_at": "2024-12-16T22:21:04.895688Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/sar7fcvqssrgc0ckt67vnnshtg/cancel",
"get": "https://api.replicate.com/v1/predictions/sar7fcvqssrgc0ckt67vnnshtg",
"stream": "https://stream.replicate.com/v1/files/fddq-nsrimzx2yzzjycrhyhzxnjkn2pntkbogkja7cfhoworylccjt4wa",
"web": "https://replicate.com/p/sar7fcvqssrgc0ckt67vnnshtg"
},
"metrics": {
"predict_time": 4.129505683,
"total_time": 4.145688
}
}