Overview
Conventions shared by every endpoint: base URL, headers, and response shapes.
Everything lives under https://REGION.api.lararouter.com/v1. Inference is not a live POST. You
upload a JSONL file, then create a batch. The rest of the API
is ordinary HTTP.
Call it with HTTP (cURL, PHP, TypeScript, or Python), or with the OpenAI SDK for files, batches, and models. The Laravel AI SDK and LangChain cannot submit batch jobs.
Live HTTP
| Endpoint | Purpose |
|---|---|
GET /v1/me | Verify a key, and see its plan, region, permissions, and limits |
GET /v1/regions | Discover regional hosts and their status |
GET /v1/health | Unauthenticated liveness probe |
/v1/files | Upload batch input, download batch results |
/v1/batches | Create, poll, cancel, and list jobs |
GET /v1/models | List and retrieve models |
GET /v1/usage/entities | Token and cost reporting per entity |
/v1/limits | Budgets, and their current consumption |
GET /v1/requests/{request_id} | Refetch a recorded exchange |
Batch line URLs
These three paths are not live HTTP routes. A POST to them returns nothing useful. They appear
as url on each JSONL line and as endpoint on POST /v1/batches. Every line
in a file must use the same path.
Line url | Body shape |
|---|---|
/v1/chat/completions | Chat completions |
/v1/embeddings | Embeddings |
/v1/rerank | Rerank |
Request headers
Prop
Type
Anything in the X-Lararouter-* family can also travel as a metadata object in the JSON body of
POST /v1/batches. When both are present the header wins, so middleware can stamp attribution over
application code. Per-line metadata inside the input file beats both. See
Attribution.
Response headers
Every response, success or failure, carries enough to identify the exchange and reconcile against your rate limit:
POST /v1/batches HTTP/1.1
Host: REGION.api.lararouter.com
Authorization: Bearer $LARAROUTER_API_KEY
Content-Type: application/json
{
"input_file_id": "file_9Hs4TnQ2",
"endpoint": "/v1/chat/completions",
"completion_window": "24h"
}
HTTP/1.1 200 OK
X-Lararouter-Request-Id: req_01JD8XK4M2
X-Lararouter-Region: REGION
X-Lararouter-RateLimit-Remaining: 2847
Content-Language: enThe request ID is unique to that HTTP exchange. No two responses ever share one, and it's the handle for refetching the result later.
Token and cost figures don't ride on these headers, because the HTTP call that creates a batch happens
long before any inference does. Read cost_usd off the batch object, or
usage.cost_usd off an individual line in the result file.
Shared conventions
- Lists use cursor pagination:
limitandstarting_after. See Pagination. - Errors use an OpenAI-shaped envelope with a stable
error.code. See Errors. - Timestamps are Unix seconds on objects, and ISO 8601 dates (
2026-08-01) on query filters. - Money is USD, as a decimal number, in fields suffixed
_usd. - IDs are prefixed by type:
req_,key_,prj_,lim_,file_,batch_.