Skip to content
JAOT

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

ParameterTypeDefaultDescription
statusstring--Filter by status: pending, running, completed, failed, timeout
pageinteger1Page number
page_sizeinteger20Items per page (max 100)

Response

FieldTypeDescription
itemsarrayList of execution objects
items[].idstringExecution ID (e.g. "exe_9a1b2c3d")
items[].model_idstringThe model that was executed
items[].statusstringExecution status (see table below)
items[].result_dataobjectOptimization result (when completed)
items[].credits_usednumberCredits consumed
items[].created_atstringISO 8601 timestamp when submitted
items[].completed_atstringISO 8601 timestamp when finished (null if pending/running)
totalintegerTotal matching executions
pageintegerCurrent page number
page_sizeintegerPage size

Status values:

StatusMeaning
pendingQueued, waiting for a solver worker
runningSolver is actively working on the problem
completedSolve finished successfully
failedSolve encountered an error
timeoutSolve 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

ParameterTypeDescription
execution_idstringThe execution ID

Response

FieldTypeDescription
idstringExecution ID
model_idstringModel ID
statusstringCurrent status
result_dataobjectFull optimization result (null if not completed)
credits_usednumberCredits consumed
created_atstringSubmission timestamp
completed_atstringCompletion 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 CodeErrorDescription
401unauthorizedMissing or invalid API key
404not_foundExecution not found