Documentation

Everything you need to integrate routes.ai into your applications

Quick Start

1. Get your API key

Sign up for a free account and get your API key from the dashboard.

Get API key

2. Make your first request

curl -X POST https://api.routes.ai/v1/solve \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "nodes": [
      {"id": "depot", "lat": 37.7749, "lng": -122.4194},
      {"id": "stop_1", "lat": 37.7849, "lng": -122.4094, "demand": 10}
    ],
    "vehicles": [{"id": "truck_1", "capacity": 100, "start": "depot"}],
    "objective": "minimize_distance"
  }'

API Endpoints

POST/v1/solve

Submit a routing problem for optimization

Returns a job ID and status. Poll for completion or use webhooks.

GET/v1/solve/{job_id}

Get the solution for a completed job

Returns optimized routes, distances, and performance metrics.

POST/v1/estimate

Get cost estimates without consuming credits

Fast estimation of credits required and expected runtime.

GET/v1/usage

Get current usage and billing information

Monitor your credit consumption and billing status.

Authentication

Include your API key in the Authorization header:

Authorization: Bearer sk_prod_your_api_key_here