Quick Start
Go from zero to solving your first optimization problem with the JAOT API.
Prerequisites
To follow this guide, you need a JAOT account. Sign up at jaot.io if you have not already.
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://api.jaot.io/api/v2/solve \
-H "Authorization: Bearer ok_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"variables": [
{"name": "chairs", "type": "continuous", "lb": 0},
{"name": "tables", "type": "continuous", "lb": 0}
],
"objective": {
"sense": "maximize",
"coefficients": {"chairs": 50, "tables": 80}
},
"constraints": [
{
"name": "wood",
"coefficients": {"chairs": 3, "tables": 5},
"sense": "<=",
"rhs": 400
},
{
"name": "labor",
"coefficients": {"chairs": 2, "tables": 4},
"sense": "<=",
"rhs": 300
}
]
}'Step 3: Check the Result
The API returns a JSON response with the solution:
{
"status": "optimal",
"objective_value": 6000.0,
"variables": {
"chairs": 100.0,
"tables": 25.0
},
"solve_time_seconds": 0.004,
"credits_used": 2
}| 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 | Optimal values for each decision variable. Produce 100 chairs and 25 tables per week. |
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