curl --request POST \
--url https://anythingmd.com/api/v1/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operation": "convert",
"capabilityVersion": "1",
"source": {
"type": "document",
"documentId": "<string>"
},
"idempotencyKey": "<string>"
}
'import requests
url = "https://anythingmd.com/api/v1/quotes"
payload = {
"operation": "convert",
"capabilityVersion": "1",
"source": {
"type": "document",
"documentId": "<string>"
},
"idempotencyKey": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operation: 'convert',
capabilityVersion: '1',
source: {type: 'document', documentId: '<string>'},
idempotencyKey: '<string>'
})
};
fetch('https://anythingmd.com/api/v1/quotes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://anythingmd.com/api/v1/quotes"
payload := strings.NewReader("{\n \"operation\": \"convert\",\n \"capabilityVersion\": \"1\",\n \"source\": {\n \"type\": \"document\",\n \"documentId\": \"<string>\"\n },\n \"idempotencyKey\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}{
"id": "<string>",
"operation": "convert",
"capabilityVersion": "<string>",
"estimatedUsage": {
"inputBytes": 4503599627370495,
"discoveredPages": 4503599627370495,
"ocrPages": 4503599627370495,
"outputBytes": 4503599627370495,
"durationMs": 4503599627370495
},
"estimatedCredits": 1,
"maximumCredits": 1,
"priceVersion": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}{
"id": "<string>",
"operation": "convert",
"capabilityVersion": "<string>",
"estimatedUsage": {
"inputBytes": 4503599627370495,
"discoveredPages": 4503599627370495,
"ocrPages": 4503599627370495,
"outputBytes": 4503599627370495,
"durationMs": 4503599627370495
},
"estimatedCredits": 1,
"maximumCredits": 1,
"priceVersion": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>",
"quote": {
"id": "<string>",
"operation": "convert",
"capabilityVersion": "<string>",
"estimatedUsage": {
"inputBytes": 4503599627370495,
"discoveredPages": 4503599627370495,
"ocrPages": 4503599627370495,
"outputBytes": 4503599627370495,
"durationMs": 4503599627370495
},
"estimatedCredits": 1,
"maximumCredits": 1,
"priceVersion": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
},
"topUpPath": "<string>",
"requiredCredits": 1,
"availableCredits": 1
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Create a quote
Returns the credits a conversion would reserve (maximumCredits) without starting it. Uploaded documents are quoted on their exact page count; URLs are quoted at the minimum because the file is not downloaded. A URL whose server does not report its size returns 422 size_unknown. Quotes can be fetched by id until expiresAt.
curl --request POST \
--url https://anythingmd.com/api/v1/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operation": "convert",
"capabilityVersion": "1",
"source": {
"type": "document",
"documentId": "<string>"
},
"idempotencyKey": "<string>"
}
'import requests
url = "https://anythingmd.com/api/v1/quotes"
payload = {
"operation": "convert",
"capabilityVersion": "1",
"source": {
"type": "document",
"documentId": "<string>"
},
"idempotencyKey": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operation: 'convert',
capabilityVersion: '1',
source: {type: 'document', documentId: '<string>'},
idempotencyKey: '<string>'
})
};
fetch('https://anythingmd.com/api/v1/quotes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://anythingmd.com/api/v1/quotes"
payload := strings.NewReader("{\n \"operation\": \"convert\",\n \"capabilityVersion\": \"1\",\n \"source\": {\n \"type\": \"document\",\n \"documentId\": \"<string>\"\n },\n \"idempotencyKey\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}{
"id": "<string>",
"operation": "convert",
"capabilityVersion": "<string>",
"estimatedUsage": {
"inputBytes": 4503599627370495,
"discoveredPages": 4503599627370495,
"ocrPages": 4503599627370495,
"outputBytes": 4503599627370495,
"durationMs": 4503599627370495
},
"estimatedCredits": 1,
"maximumCredits": 1,
"priceVersion": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}{
"id": "<string>",
"operation": "convert",
"capabilityVersion": "<string>",
"estimatedUsage": {
"inputBytes": 4503599627370495,
"discoveredPages": 4503599627370495,
"ocrPages": 4503599627370495,
"outputBytes": 4503599627370495,
"durationMs": 4503599627370495
},
"estimatedCredits": 1,
"maximumCredits": 1,
"priceVersion": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>",
"quote": {
"id": "<string>",
"operation": "convert",
"capabilityVersion": "<string>",
"estimatedUsage": {
"inputBytes": 4503599627370495,
"discoveredPages": 4503599627370495,
"ocrPages": 4503599627370495,
"outputBytes": 4503599627370495,
"durationMs": 4503599627370495
},
"estimatedCredits": 1,
"maximumCredits": 1,
"priceVersion": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
},
"topUpPath": "<string>",
"requiredCredits": 1,
"availableCredits": 1
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
Create a key under Settings → API Keys and send it as Authorization: Bearer amd_live_…. See https://docs.anythingmd.com/authentication.
Headers
If reused within the retention window, replay the original result instead of a second mutation
1Body
Work to price
convert Capability version the quote is pinned to
1Input the quote should estimate
- Option 1
- Option 2
Show child attributes
Show child attributes
If the same key is reused within the window, return the original quote
1Response
Existing quote returned for a replayed idempotency key
Quote id
1convert Pinned version of this capability. Quotes, receipts, rate cards, and Skills key off operation + version.
1Estimated natural units; not a bill
Show child attributes
Show child attributes
Expected credits if work matches the estimate
x >= 0Credits that will be reserved when the job starts; the workspace needs at least this many
x >= 0Rate-card version this quote is pinned to
1ISO-8601 quote expiration
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$