Platform API Overview
The Platform API lets scripts and third-party systems manage your RouteAPI account on your behalf: query balance, create and manage API Keys, and view account logs (with CSV/JSONL export) and usage statistics.
Base URL: https://www.routeapi.ai/api/open/v1
Authentication: Authorization: Bearer rat_xxxx — see Platform API authentication to create and store a Management Key.
Request example
Section titled “Request example”curl https://www.routeapi.ai/api/open/v1/balance \ -H "Authorization: Bearer $ROUTEAPI_MANAGEMENT_KEY"Every endpoint under /api/open/v1 takes the same header. Responses use the unified { success, message, data } body; see Errors and limits for that format, error codes, and rate limits.
Amount and currency
Section titled “Amount and currency”Amount fields are in the site display currency with two decimals (for example 10.00); the currency is returned by Get balance. Each amount is rounded independently, so a summed amount may differ from the sum of per-row amounts by up to 0.01.
Pagination
Section titled “Pagination”List endpoints use the same page-based pagination:
| Parameter | Type | Default | Description |
|---|---|---|---|
p | integer | 1 | Page number, from 1 to 1000000 |
page_size | integer | 10 | Items per page, from 1 to 1000 |
An explicitly supplied p or page_size must be within these ranges. Non-integers, 0, negative numbers, and out-of-range values all return 400 invalid_request; they are never silently replaced or capped. The page / page_size in the response are the values actually used.
For log endpoints, total is counted up to 10000 and is always 10000 when there are more matches; fetch older data in smaller time windows.
Query string encoding
Section titled “Query string encoding”Do not put a raw ; in the query string; encode it as %3B, otherwise the whole request returns 400 invalid_request. Encode % as %25, and use + or %20 for spaces.
Endpoints
Section titled “Endpoints”Paths below are relative to https://www.routeapi.ai/api/open/v1.
Account
Section titled “Account”| Method | Path | Description |
|---|---|---|
| GET | /balance | Get balance |
API Keys
Section titled “API Keys”| Method | Path | Description |
|---|---|---|
| GET | /keys | List API Keys |
| GET | /keys/:id | Get an API Key |
| GET | /keys/:id/key | Reveal an API Key |
| POST | /keys | Create an API Key |
| PATCH | /keys/:id | Update an API Key |
| DELETE | /keys/:id | Delete an API Key |
| Method | Path | Description |
|---|---|---|
| GET | /logs | Get account logs |
| GET | /logs/export | Export logs |
| Method | Path | Description |
|---|---|---|
| GET | /usage | Get usage statistics |
| GET | /usage/models | Get usage by model |
| GET | /usage/keys | Get usage by Key |