Endpoints API Reference
Overview
LLM Stack provides five types of endpoint APIs:
- Synchronous (immediate response)
- Asynchronous (background processing)
- Job Status (get status and results of an asynchronous job)
- Revoke Job (cancel a running asynchronous job)
- Reprocess Job (reprocess a job)
Base URL
https://api.llmstack.dev/dapi
Authentication
All API requests require an endpoint token passed in the Authorization
header.
1. Synchronous Query API
Make a direct request and receive an immediate response.
Endpoint
POST /endpoint/{endpoint_slug}/query
Request Formats
The fields can be sent either as JSON or Form Data. Form Data additionally supports file uploads.
Field | Type | Description |
---|---|---|
variable_name_1 | string | Value 1 |
variable_name_2 | string | Value 2 |
file_variable_name | file | File to upload (Form Data only) |
info
The variables are defined using the {{variable_name}}
syntax in the endpoint prompt.
Example Request
curl --location 'https://api.llmstack.dev/dapi/endpoint/{endpoint-slug}/query' \
--header 'Authorization: {endpoint-token}' \
--form 'data=@"./PHOTO-2025-01-07-21-08-01.jpg"'
Response Format
{
"status": "success | error",
"code": "query_executed",
"message": "Query completed",
"data": {
// Response data according to endpoint schema
}
}
2. Asynchronous Query API
Submit a job for background processing.
Endpoint
POST /endpoint/{endpoint_slug}/query/async
Request Formats
Same as synchronous API (both JSON and Form Data supported)
Example Request
curl --location 'https://api.llmstack.dev/dapi/endpoint/{endpoint-slug}/query/async' \
--header 'Authorization: {endpoint-token}' \
--form 'data=@"./PHOTO-2025-01-07-21-08-01.jpg"'
Response Format
{
"status": "success",
"code": "job_created",
"message": "Job created successfully",
"queue": "default",
"job": {
"id": "0aa804e0-87d7-4b80-942a-3b255032f05f",
"task_id": "12a61f6f-17c7-4140-b6d5-4218b50596a4",
"created_at": "2025-02-09T13:02:06.598986+05:30",
"updated_at": "2025-02-09T13:02:06.617329+05:30",
"status": "pending",
"endpoint": {
"name": "Document Parser",
"slug": "3rts24",
"created_at": "2025-02-01T03:26:57.699468+05:30",
"updated_at": "2025-02-07T14:39:12.370721+05:30"
}
}
}
3. Job Status API
Get the status and results of an asynchronous job.
Endpoint
GET /endpoint/{endpoint_slug}/job/{job_id}
Example Request
curl --location 'https://api.llmstack.dev/dapi/endpoint/{endpoint-slug}/job/{job-id}' \
--header 'Authorization: {endpoint-token}'
Response Format
{
"status": "success | error",
"code": "job_fetched | job_not_found | endpoint_not_found",
"message": "Job fetched successfully",
"job": {
"id": "0aa804e0-87d7-4b80-942a-3b255032f05f",
"task_id": "12a61f6f-17c7-4140-b6d5-4218b50596a4",
"created_at": "2025-02-09T13:02:06.598986+05:30",
"updated_at": "2025-02-09T13:02:15.794134+05:30",
"status": "completed",
"response": {
"code": "job_completed",
"data": {
// Job result data
},
"status": "success",
"message": "Job completed"
},
"endpoint": {
"name": "Document Parser",
"slug": "3rts24",
"created_at": "2025-02-01T03:26:57.699468+05:30",
"updated_at": "2025-02-07T14:39:12.370721+05:30"
}
}
}
4. Cancel Job API
Cancel a running asynchronous job.
Endpoint
GET /endpoint/{endpoint_slug}/job/{job_id}/revoke
Example Request
curl --location 'https://api.llmstack.dev/dapi/endpoint/{endpoint-slug}/job/{job-id}/revoke' \
--header 'Authorization: {endpoint-token}'
Response Format
{
"status": "success | error",
"code": "job_fetched | job_not_found | endpoint_not_found",
"message": "Job fetched successfully",
"job": {
"id": "0aa804e0-87d7-4b80-942a-3b255032f05f",
"task_id": "12a61f6f-17c7-4140-b6d5-4218b50596a4",
"status": "cancelled",
"endpoint": {
"name": "Document Parser",
"slug": "3rts24"
}
}
}
5. Reprocess Job API
Reprocess a completed job with optional webhook triggers.
Endpoint
POST /endpoint/{endpoint_slug}/job/{job_id}/reprocess
Request Format
Can be sent as JSON or Form Data:
Field | Type | Required | Default | Description |
---|---|---|---|---|
reprocess_type | string | No | failed | Type of reprocessing to perform: • failed - Reprocess only failed steps• all - Reprocess both LLM processing & webhook deliveries• webhooks - Retrigger webhooks only |
Example Request
curl --location 'https://api.llmstack.dev/dapi/endpoint/{endpoint-slug}/job/{job-id}/reprocess' \
--header 'Authorization: {endpoint-token}' \
--header 'Content-Type: application/json' \
--data '{"reprocess_type": "all"}'
Response Format
{
"status": "success | error",
"code": "job_reprocessed | job_not_found | endpoint_not_found",
"message": "Job reprocessed successfully",
"job": {
"id": "0aa804e0-87d7-4b80-942a-3b255032f05f",
"task_id": "12a61f6f-17c7-4140-b6d5-4218b50596a4",
"status": "pending",
"endpoint": {
"name": "Document Parser",
"slug": "3rts24"
}
}
}