1. Authenticate REST calls
Include your API key as thecapout-api-key header.
2. Upload a document
The upload API supports both a fetchableurl and an inline file_base64 payload.
file_base64 value.
Expected shape:
Go from API key to document status updates in a few requests.
capout-api-key header.
export CAPOUT_API_KEY="capout_test_your_api_key"
url and an inline file_base64 payload.
curl https://api.capout.ai/upload \
-X POST \
-H "content-type: application/json" \
-H "capout-api-key: $CAPOUT_API_KEY" \
-d '{
"url": "https://example.com/claims/123/scope.pdf",
"file_name": "claim-123-scope.pdf",
"xn_address": "restoration-team@example.xn"
}'
curl https://api.capout.ai/upload \
-X POST \
-H "content-type: application/json" \
-H "capout-api-key: $CAPOUT_API_KEY" \
-d '{
"file_base64": "BASE64_PDF_CONTENT",
"file_name": "claim-123-scope.pdf",
"xn_address": "restoration-team@example.xn"
}'
file_base64 value.
Expected shape:
{
"document_id": "doc_123",
"workflow_id": "wf_123",
"status": "processing",
"created_at": "2026-04-14T14:30:00Z",
"status_url": "/status/doc_123",
"ws_url": "/ws/status"
}
curl https://api.capout.ai/status/doc_123 \
-H "capout-api-key: $CAPOUT_API_KEY"
{
"document_id": "doc_123",
"status": "processing",
"progress": {
"ocr": "complete",
"structure": "in_progress",
"actions": null,
"trades": null,
"categories": null
},
"workflow_complete": false,
"completed_at": null,
"updated_at": "2026-04-14T14:31:12Z"
}
curl https://api.capout.ai/ws/token \
-X POST \
-H "capout-api-key: $CAPOUT_API_KEY"
const tokenResponse = await fetch("https://api.capout.ai/ws/token", {
method: "POST",
headers: {
"capout-api-key": process.env.CAPOUT_API_KEY
}
}).then((res) => res.json());
const streamUrl = new URL(tokenResponse.sse_url, "https://api.capout.ai");
streamUrl.searchParams.set("token", tokenResponse.token);
streamUrl.searchParams.append("document_id", "doc_123");
const source = new EventSource(streamUrl);
source.onmessage = (event) => {
console.log(JSON.parse(event.data));
};
curl https://api.capout.ai/credits \
-H "capout-api-key: $CAPOUT_API_KEY"