Skip to content

Welcome to Flio.ai API Documentation

Flio.ai is an API platform offering advanced route optimization and vehicle routing solutions. Create optimized routes for your logistics, distribution, and fleet management needs, reduce costs, and improve operational efficiency.

API Overview

Flio.ai API provides two core endpoints:

API Endpoint Description
Route API POST /solver/route Calculates an optimized route between points. Supports turn-by-turn directions, toll costs, and vehicle properties.
Optimize API POST /solver/optimize Solves multi-vehicle distribution problems. Performs optimization with vehicle fleets, jobs, time windows, and various constraints.

Authentication

You need an API key to use the API. Send your API key as a query parameter:

curl -X POST "https://api.flio.ai/solver/route?apiKey=YOUR-API-KEY" \
  -H "Content-Type: application/json" \
  -d '{"origin": {...}, "destination": {...}}'

NOTE: The API key parameter is apiKey (camelCase). The old api_key parameter no longer works.

Documentation Structure

  • Route API — Route calculation endpoint and features
  • Optimize API — Optimization endpoint and features
  • Examples — Usage examples and scenarios

Breaking Changes (Migration Guide)

Our API has been updated. If you are using an older version, please pay attention to the following changes:

1. Authentication Parameter Rename

Old New
api_key apiKey

The query parameter is now in camelCase format.

2. Route API Structure Change

The old API had a tasks array wrapper. In the new API, this wrapper has been removed and each request is made for a single route:

Old (deprecated):

{
  "tasks": [{
    "origin": {...},
    "destination": {...}
  }]
}

New:

{
  "origin": {...},
  "destination": {...}
}

If multiple routes are needed, separate requests must be made.

3. Avoid Features Enum — camelCase

avoid_features enum values have been changed from snake_case to camelCase:

Old New
toll_road tollRoad
seasonal_closure seasonalClosure
controlled_access_highway controlledAccessHighway

4. Optimize API — Removed Fields

The following fields have been removed from the options object. The API now automatically detects the problem type:

Field Status
problem ❌ Removed (no TSP/VRP/CVRP/VRPTW/PDP/MDHVRPTW selection)
solver ❌ Removed (no heuristic/mathematical selection)
map ❌ Removed (no cartesian/geographic selection)
model ❌ Removed
restrictions ❌ Removed (contents moved to options)

5. Job Time Windows — Plural

The time window field in job locations has been made plural:

Old New
time_window time_windows

Multiple time ranges can now be specified: [["08:00:00", "12:00:00"], ["13:00:00", "17:00:00"]]

6. Vehicle Profile → Vehicle Type

The profile field in vehicle constraints has been renamed to vehicleType:

Old New
profile vehicleType

7. Removed Endpoints

The following endpoints have been removed:

Endpoint Status
POST /solver/optimize/validate ❌ Removed
POST /solver/route/validate ❌ Removed
GET / ❌ Removed
GET /health ❌ Removed

8. New Query Parameter: direction

A new direction query parameter has been added to both the Route and Optimize APIs:

Value Description
geocode Returns a [lat, lon] coordinate array for each action
polyline Returns a string in Google Encoded Polyline format
(not specified) The directions field is returned as null

Getting Started

For a quick start, check out the Examples section.


Smarter routes, more efficient operations with Flio.ai API. — Flio.ai

Next Steps