POST /api/pipelines/{org}/{id}/run

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.

POST /api/pipelines/{org}/{id}/run/

Request body

The following parameters can be included in the request body:

Parameters

file
file
Required

Document (image, PDF) for an OCR pipeline, audio file for an audio pipeline. The names image, audio and document are accepted as aliases.

stream
boolean
Default value: false

true: SSE stream (text/event-stream) of the run's events. Otherwise JSON response.

pdf_password
string

Password of a protected PDF.

Successful response

The following fields are returned in a successful response:

Response fields

run_id
string
Required

Run identifier (also in the X-Run-Id header).

pipeline_hash
string
Required

SHA-256 fingerprint of the executed graph.

result
object

Result: text and regions (OCR) or transcription (audio).

trace
array<object>
Required

Execution events, identical to the SSE stream.

executed
object
Required

Path actually followed by each region (or global path for audio).

pipeline
object
Required

Pipeline executed: id, name, kind, source.

Examples

Code examples for using this endpoint:

curl
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"
python
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:

json
{
  "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" }
}
text
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).

MethodPathRole
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.

HTTPCodeMeaning
401missing_api_keyNo key provided
401invalid_api_keyInvalid, expired or revoked key
403insufficient_scopeThe key cannot run models
403pipeline_access_deniedEnterprise plan required
404pipeline_not_foundPipeline does not exist or is not allowed for this key
400invalid_documentNo file in the file field
502gateway_unreachableGateway unreachable

Execution errors (rejected document, unavailable model, timeout…) are those of the "Error codes" page.