Skip to content

Entorno en desarrollo activo: puedes notar cambios o funciones incompletas.

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. "a3f8b2c1-1234-5678-abcd-ef0123456789")
items[].model_idstringThe model that was executed
items[].statusstringExecution status (see table below)
items[].result_dataobjectOptimization result (when completed)
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://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']}")

Response

{
  "items": [
    {
      "id": "a3f8b2c1-1234-5678-abcd-ef0123456789",
      "model_id": "b9c1d2e3-abcd-1234-5678-f0a1b2c3d4e5",
      "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
      },
      "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)
created_atstringSubmission timestamp
completed_atstringCompletion timestamp

Examples

import httpx
import time

API_URL = "https://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/a3f8b2c1-1234-5678-abcd-ef0123456789/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']}")

GET /api/v2/models/executions/{execution_id}/exact-analysis

Exact, solution-based analysis of a completed execution — binding constraints, per-constraint slack and utilization, and objective-term contributions, all computed on demand from the stored solution x* and problem data. Unlike LP-relaxation shadow prices, these figures are exact for the integer solution and identical across solvers. See Analyzing Results.

Authentication: Requires API key or JWT token.

Response

FieldTypeDescription
computedbooleanfalse when the execution has no solution or no stored flat problem (note says which)
total_constraintsnumberConstraints in the problem
binding_countnumberConstraints with ~zero slack at the optimum
constraintsarrayPer-constraint name, activity, rhs, operator, slack, is_binding, utilization — binding/tightest first, capped with truncated_constraints
contributionsarrayObjective terms label + contribution (c·x*), largest first, capped with truncated_contributions

POST /api/v2/models/{model_id}/execute

Execute one of your model projects with input data — model_id is the project's ID (e.g. a marketplace model you forked with Use in studio). All executions run async under the hood; the endpoint waits briefly and returns the result, or a task envelope to poll. For solving a project's draft or a committed version directly, prefer POST /api/v2/projects/{project_id}/solve (see Models); it also supports solution_filter=nonzero for a compact solution.


Real-Time Status Updates

For real-time execution progress, connect to the WebSocket endpoint:

wss://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