Skip to content

Detect the best model for a file

POST
/api/v1/models/detect
curl --request POST \
--url https://api.langparse.dev/api/v1/models/detect \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <X-Api-Key>' \
--data '{ "file": { "id": "file_mrb1a2c3d4" } }'

Classify a file against all your models (no extraction). Async: the polled document carries the routed model + routerConfidence.

Media typeapplication/json
object
file
required
One of:
By id
object
id
required

An existing file id (from POST /v1/files or a folder listing).

string
Example
{
"file": {
"id": "file_mrb1a2c3d4"
}
}

Accepted — poll for the routed model.

Media typeapplication/json
object
data
required

Async accept — the parse is queued. Poll pollUrl.

object
id
string
status
string
Allowed values: queued
debugId
string
pollUrl
string
Example
{
"data": {
"id": "doc_mrb1x9y8z7",
"status": "queued",
"pollUrl": "/api/v1/documents/doc_mrb1x9y8z7"
}
}

No models to classify against, or invalid body.

Media typeapplication/json

Error response. statusCode mirrors the HTTP status; statusMessage is human-readable.

object
statusCode
integer
statusMessage
string
Example
{
"statusCode": 404,
"statusMessage": "Document not found"
}

Missing or invalid API key.

Media typeapplication/json

Error response. statusCode mirrors the HTTP status; statusMessage is human-readable.

object
statusCode
integer
statusMessage
string
Example
{
"statusCode": 404,
"statusMessage": "Document not found"
}