The graph is stored on the AlphaEdge side: you only send the file (multipart/form-data). The trailing / is optional. {org} is the organization identifier (or "alphaedge" for AlphaEdge pipelines), {id} is the pipeline number in that space. Authentication: X-API-Key: <key> or Authorization: Bearer <key> header.
/api/pipelines/{org}/{id}/run/
Request body
The following parameters can be included in the request body:
Parameters
file
Document (image, PDF) for an OCR pipeline, audio file for an audio pipeline. The names image, audio and document are accepted as aliases.
stream
false
true: SSE stream (text/event-stream) of the run's events. Otherwise JSON response.
pdf_password
Password of a protected PDF.
Successful response
The following fields are returned in a successful response:
Response fields
run_id
Run identifier (also in the X-Run-Id header).
pipeline_hash
SHA-256 fingerprint of the executed graph.
result
Result: text and regions (OCR) or transcription (audio).
trace
Execution events, identical to the SSE stream.
executed
Path actually followed by each region (or global path for audio).
pipeline
Pipeline executed: id, name, kind, source.
Examples
Code examples for using this endpoint:
curl -X POST https://api-endpoints.alphaedge-ai.com/api/pipelines/alphaedge/4/run/ \
-H "X-API-Key: $ALPHAEDGE_API_KEY" \
-F "file=@invoice.pdf"
import os, requests
with open("invoice.pdf", "rb") as f:
r = requests.post(
"https://api-endpoints.alphaedge-ai.com/api/pipelines/alphaedge/4/run/",
headers={"X-API-Key": os.environ["ALPHAEDGE_API_KEY"]},
files={"file": ("invoice.pdf", f, "application/pdf")},
timeout=3600,
)
print(r.json()["result"]["text"])
Response
Sample API response:
{
"run_id": "r_47e35f3501c95a06",
"pipeline_hash": "b1b1653a…",
"trace": [ … ],
"executed": { "regions": [ … ] },
"result": { "text": "…", "regions": [ … ] },
"ok": true,
"pipeline": { "id": "alphaedge/4", "name": "IDP — Quality", "kind": "ocr", "source": "standard" }
}
event: run.started
data: {"run_id":"r_47e35f3501c95a06","seq":1,"t_ms":0,"type":"run.started","scope":{"level":"run"},"kind":"ocr","pipeline_hash":"96c6be3b…","pages":1}
event: node.started
data: {"run_id":"r_47e35f3501c95a06","seq":2,"t_ms":4,"type":"node.started","scope":{"level":"page","page":1},"node_id":"n1","node_type":"layout"}
event: edge.taken
data: {"run_id":"r_47e35f3501c95a06","seq":9,"t_ms":812,"type":"edge.taken","scope":{"level":"region","page":1,"region_id":"p1r1"},"from":"n2","port":"yes","to":"n3"}
event: run.completed
data: {"run_id":"r_47e35f3501c95a06","seq":40,"t_ms":3150,"type":"run.completed","scope":{"level":"run"},"result":{…},"executed":{…},"trace_summary":{…}}
List and retrieve pipelines
Pipelines offered in the Studio: alphaedge/1 (IDP Balanced), alphaedge/4 (IDP Quality) and alphaedge/7 (Audio Balanced).
| Method | Path | Role |
|---|---|---|
GET | /api/pipelines/ | List the pipelines accessible with the key (?kind=ocr or ?kind=audio filter) |
GET | /api/pipelines/{org}/{id}/ | Details: executed graph, pipeline_hash and run_path |
POST | /api/pipelines/{org}/{id}/run/ | Run |
Access and errors
Saved pipelines through the API are reserved for the enterprise plan. There is no specific key: it is your usual API key, with execution rights (a "Read Only" key is rejected).
These routes are served by the website: their errors have the form {"error": {"code", "message"}}, without type or request_id.
| HTTP | Code | Meaning |
|---|---|---|
| 401 | missing_api_key | No key provided |
| 401 | invalid_api_key | Invalid, expired or revoked key |
| 403 | insufficient_scope | The key cannot run models |
| 403 | pipeline_access_denied | Enterprise plan required |
| 404 | pipeline_not_found | Pipeline does not exist or is not allowed for this key |
| 400 | invalid_document | No file in the file field |
| 502 | gateway_unreachable | Gateway unreachable |
Execution errors (rejected document, unavailable model, timeout…) are those of the "Error codes" page.