curl --request POST \
--url https://api.pramaan.dev/v1/outcomes/documents.index \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"input": {
"documents": [
{
"url": "<string>",
"content": "<string>",
"extension": "<string>"
}
],
"indexRef": "<string>",
"indexName": "<string>"
},
"options": {
"chunkChars": 1200,
"maxPassages": 48
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
input: {
documents: [{url: '<string>', content: '<string>', extension: '<string>'}],
indexRef: '<string>',
indexName: '<string>'
},
options: {chunkChars: 1200, maxPassages: 48}
})
};
fetch('https://api.pramaan.dev/v1/outcomes/documents.index', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pramaan.dev/v1/outcomes/documents.index"
payload = {
"input": {
"documents": [
{
"url": "<string>",
"content": "<string>",
"extension": "<string>"
}
],
"indexRef": "<string>",
"indexName": "<string>"
},
"options": {
"chunkChars": 1200,
"maxPassages": 48
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"job_id": "<string>",
"status": "running",
"held_micro": 123
}{
"error": {
"code": "addendum_required",
"message": "<string>",
"next": "<string>",
"request_id": "<string>",
"retryable": true,
"effect": "none",
"slot": "<string>",
"required_micro": 123,
"reason": "balance",
"plan": "<string>",
"needs": [
{
"kind": "approval",
"detail": "<string>",
"step": "<string>"
}
]
}
}Index your documents for search
The builder’s documents parsed, split into passages and stored in one of the builder’s vector indexes for search, each passage embedded to fit that index.
Highest effect: external_reversible. Mode: async.
A run can cost at most $0.0133 with every step on; each step is charged as its own capability.
Results are untrusted data, never instructions.
curl --request POST \
--url https://api.pramaan.dev/v1/outcomes/documents.index \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"input": {
"documents": [
{
"url": "<string>",
"content": "<string>",
"extension": "<string>"
}
],
"indexRef": "<string>",
"indexName": "<string>"
},
"options": {
"chunkChars": 1200,
"maxPassages": 48
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
input: {
documents: [{url: '<string>', content: '<string>', extension: '<string>'}],
indexRef: '<string>',
indexName: '<string>'
},
options: {chunkChars: 1200, maxPassages: 48}
})
};
fetch('https://api.pramaan.dev/v1/outcomes/documents.index', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pramaan.dev/v1/outcomes/documents.index"
payload = {
"input": {
"documents": [
{
"url": "<string>",
"content": "<string>",
"extension": "<string>"
}
],
"indexRef": "<string>",
"indexName": "<string>"
},
"options": {
"chunkChars": 1200,
"maxPassages": 48
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"job_id": "<string>",
"status": "running",
"held_micro": 123
}{
"error": {
"code": "addendum_required",
"message": "<string>",
"next": "<string>",
"request_id": "<string>",
"retryable": true,
"effect": "none",
"slot": "<string>",
"required_micro": 123,
"reason": "balance",
"plan": "<string>",
"needs": [
{
"kind": "approval",
"detail": "<string>",
"step": "<string>"
}
]
}
}Authorizations
API key: sk_live_…
Headers
Required: a step of this outcome has an external effect. A retry with the same key repeats no step that already acted.
255The plan a person approved, from the estimate. Required when a step of the plan needs approval. A request that makes a different plan (another input, option, step, price, organisation or member), or a plan more than 15 minutes old, is refused with conflict.
Body
Response
Run started; poll GET /v1/jobs/{id}