Optimiciti API Specification
Optimiciti API
Optimiciti turns a real-world routing problem — vehicles, stops, time windows, capacities, and costs — into an optimized plan: who goes where, in what order, and at what time. This API gives you direct, programmatic access to the same solvers that power the Optimiciti app. It's a good fit for scheduling deliveries, field service, home visits, or any fleet that has to visit many places efficiently.
Beta. Endpoints and fields may still change. Using the API requires accepting our terms of service.
How it works
A real optimization can take longer than a single request should wait, so solving is asynchronous — you submit, then poll:
- (Optional) Build a travel-cost matrix.
POST /cost_matrixcomputes the distance and/or duration between every pair of your locations. Skip it if you already have your own travel costs. - Submit the problem.
POST /problemwith your locations, vehicles, and constraints. You get an id back right away (the response calls itrun_id); the solver runs in the background. - Poll for status.
GET /problem/{problemId}— the same id — orPOST /run_status, until the run reaches a terminal state:succeeded,failed, orcancelled. A status response stays small: it carriesstatus,progress, and anyerror— never the routes. - Fetch the results. Once the run is
succeeded, get the optimized routes withPOST /run_results_by_run_id. Results are a separate call on purpose — route payloads are large, and polling is frequent.
(problemId in the path and run_id in responses are the same identifier — the two names refer to one run.)
You can also save a scenario, list your past runs, and re-open results at any time — see the History section.
Authentication
Send your Clerk-issued JSON Web Token as a bearer credential on every request:
Code
The token is verified on each call (signature, expiry, and issuer), and your identity is taken from the token — never from a value in the request body.
One thing that trips people up: api.optimiciti.com sits behind a gateway. A request that arrives with no Origin header — a curl call, a script, or any server-to-server request — must carry a gateway API key, and without one it gets a 401 on authenticated tiers. That's expected, not a broken token. Get access →
Requests and responses
Every response uses the same envelope. On success:
Code
On failure:
Code
Branch on error.code (stable), not the message text (which may change).
Plans and limits
Your plan sets how large a problem can be, how many runs you can have in flight at once, and which premium features (such as road-network travel costs) you can use. See API access plans. When a request exceeds your plan, you get a 4xx with one of the codes below — each tells you exactly what to change or upgrade.
Common error codes
| Code | Meaning | What to do |
|---|---|---|
CONCURRENCY_LIMIT (429) | Too many runs in flight for your plan. | Wait for one to finish, or cancel it, then retry. |
PLAN_LIMIT_EXCEEDED | The request uses a feature or size your plan doesn't include (error.details.feature names it). | Reduce the problem, or upgrade. |
PROBLEM_TOO_LARGE | The problem exceeds your plan's size cap. | Use fewer locations or vehicles, or upgrade. |
PAYLOAD_TOO_LARGE (413) | The request body is too large to accept. | Send fewer locations, or a smaller travel-cost table. |
RUN_NOT_FOUND / RESULTS_NOT_FOUND | That run, or its results, doesn't exist yet. | Check the id; results appear once a run succeeds. |
Transient 429, 502, 503, and 504 responses are safe to retry with backoff.
Links
- Optimiciti homepage
- API access plans
- Questions: [email protected]
