Skip to content

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.

Terminal window
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 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.

List endpoints use the same page-based pagination:

ParameterTypeDefaultDescription
pinteger1Page number, from 1 to 1000000
page_sizeinteger10Items 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.

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.

Paths below are relative to https://www.routeapi.ai/api/open/v1.

MethodPathDescription
GET/balanceGet balance
MethodPathDescription
GET/keysList API Keys
GET/keys/:idGet an API Key
GET/keys/:id/keyReveal an API Key
POST/keysCreate an API Key
PATCH/keys/:idUpdate an API Key
DELETE/keys/:idDelete an API Key
MethodPathDescription
GET/logsGet account logs
GET/logs/exportExport logs
MethodPathDescription
GET/usageGet usage statistics
GET/usage/modelsGet usage by model
GET/usage/keysGet usage by Key