Executions
The Executions endpoints let you track the status of optimization runs and retrieve results. Every model execution and async solve creates an execution record that you can query.
GET /api/v2/models/executions/all
List all executions across all models for your organization.
Authentication: Requires API key or JWT token.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
status | string | -- | Filter by status: pending, running, completed, failed, timeout |
page | integer | 1 | Page number |
page_size | integer | 20 | Items per page (max 100) |
Response
| Field | Type | Description |
|---|---|---|
items | array | List of execution objects |
items[].id | string | Execution ID (e.g. "exe_9a1b2c3d") |
items[].model_id | string | The model that was executed |
items[].status | string | Execution status (see table below) |
items[].result_data | object | Optimization result (when completed) |
items[].credits_used | number | Credits consumed |
items[].created_at | string | ISO 8601 timestamp when submitted |
items[].completed_at | string | ISO 8601 timestamp when finished (null if pending/running) |
total | integer | Total matching executions |
page | integer | Current page number |
page_size | integer | Page size |
Status values:
| Status | Meaning |
|---|---|
pending | Queued, waiting for a solver worker |
running | Solver is actively working on the problem |
completed | Solve finished successfully |
failed | Solve encountered an error |
timeout | Solve exceeded the time limit |
Examples
import httpx
API_URL = "https://api.jaot.io/api/v2"
headers = {"Authorization": "Bearer ok_live_your_key_here"}
# List completed executions
response = httpx.get(
f"{API_URL}/models/executions/all",
params={"status": "completed", "page_size": 5},
headers=headers,
)
data = response.json()
for execution in data["items"]:
print(f"Status: {execution['status']}")
print(f"Objective: {execution['result_data']['objective_value']}")
print(f"Credits used: {execution['credits_used']}")Response
{
"items": [
{
"id": "exe_9a1b2c3d",
"model_id": "mdl_wh7k9x2m",
"status": "completed",
"result_data": {
"status": "optimal",
"objective_value": 1250.50,
"variables": [
{"name": "east_allocation", "value": 320},
{"name": "west_allocation", "value": 180}
],
"solve_time_seconds": 2.34
},
"credits_used": 3,
"created_at": "2026-02-19T10:05:00Z",
"completed_at": "2026-02-19T10:05:12Z"
}
],
"total": 24,
"page": 1,
"page_size": 5
}GET /api/v2/models/executions/{execution_id}
Get the status and result of a specific execution.
Authentication: Requires API key or JWT token.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
execution_id | string | The execution ID |
Response
| Field | Type | Description |
|---|---|---|
id | string | Execution ID |
model_id | string | Model ID |
status | string | Current status |
result_data | object | Full optimization result (null if not completed) |
credits_used | number | Credits consumed |
created_at | string | Submission timestamp |
completed_at | string | Completion timestamp |
Examples
import httpx
import time
API_URL = "https://api.jaot.io/api/v2"
headers = {
"Authorization": "Bearer ok_live_your_key_here",
"Content-Type": "application/json",
}
# Execute a model
response = httpx.post(
f"{API_URL}/models/exe_9a1b2c3d/execute",
headers=headers,
json={"input_data": {"warehouses": warehouses, "products": products}},
)
execution = response.json()
# Poll for completion
while execution["status"] in ("pending", "running"):
time.sleep(2)
response = httpx.get(
f"{API_URL}/models/executions/{execution['id']}",
headers=headers,
)
execution = response.json()
print(f"Status: {execution['status']}")
print(f"Result: {execution['result_data']['objective_value']}")POST /api/v2/models/{model_id}/execute
Execute an activated model with input data. See the Models page for full documentation of this endpoint.
Real-Time Status Updates
For real-time execution progress, connect to the WebSocket endpoint:
ws://api.jaot.io/api/v2/ws/executions/{execution_id}
The WebSocket sends JSON messages as the solver progresses:
{"type": "progress", "progress": 0.45, "objective_value": 1234.56, "gap": 0.02}{"type": "completed", "result": {"status": "optimal", "objective_value": 1250.50, "..."}}Info: For details on the WebSocket protocol, message types, and connection handling, see the WebSocket documentation.
Errors
| HTTP Code | Error | Description |
|---|---|---|
| 401 | unauthorized | Missing or invalid API key |
| 404 | not_found | Execution not found |