Quick Start
Go from zero to solving your first optimization problem with the JAOT API.
Prerequisites
This guide uses the public demo at jaot.io -- sign up there if you have not already. If you run your own self-hosted JAOT instance, replace jaot.io with your instance URL throughout the examples below.
Step 1: Create an API Key
Log in to the JAOT dashboard and navigate to Settings > API Keys. Click Create Key, give it a name (e.g., "Development"), and copy the key that appears.
Store your API key securely. It cannot be viewed again after creation. If you lose it, revoke it and create a new one.
Step 2: Solve Your First Problem
A furniture factory produces chairs and tables. Each chair earns $50 profit, each table earns $80. The factory has 400 units of wood and 300 hours of labor available per week.
- Each chair uses 3 units of wood and 2 hours of labor
- Each table uses 5 units of wood and 4 hours of labor
The goal: maximize weekly profit.
curl -X POST https://jaot.io/api/v2/solve \
-H "Authorization: Bearer ok_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"variables": [
{"name": "chairs", "type": "continuous", "lower_bound": 0},
{"name": "tables", "type": "continuous", "lower_bound": 0}
],
"objective": {
"sense": "maximize",
"expression": "50*chairs + 80*tables"
},
"constraints": [
{
"name": "wood",
"expression": "3*chairs + 5*tables <= 400"
},
{
"name": "labor",
"expression": "2*chairs + 4*tables <= 300"
}
]
}'Step 3: Check the Result
The API returns a JSON response with the solution:
{
"status": "optimal",
"objective_value": 6000.0,
"variables": [
{"name": "chairs", "value": 100.0, "type": "continuous"},
{"name": "tables", "value": 25.0, "type": "continuous"}
],
"solution": {"chairs": 100.0, "tables": 25.0},
"solve_time_seconds": 0.004,
"credits_used": 2,
"credits_remaining": 98
}| Field | Description |
|---|---|
status | Solver outcome. "optimal" means the best solution was found. Other values: "infeasible", "unbounded", "time_limit". |
objective_value | The optimized value of the objective function. Here, $6,000 weekly profit. |
variables | Array of {name, value, type} objects with optimal values for each decision variable. |
solution | Variable-value map for quick access (same data as variables, keyed by name). |
solve_time_seconds | Wall-clock time the solver spent on the problem. |
credits_used | Number of credits deducted for this solve. |
The optimal solution produces 100 chairs and 25 tables for $6,000 weekly profit. The wood constraint is fully utilized (400/400 units), while 50 labor hours remain unused.
What's Next
- Authentication -- API key and JWT auth flows in depth
- Solve Endpoint -- Full request/response reference for the solve API
- Rate Limits and Credits -- Credit pricing formula and rate limit details