Lararouter
API reference

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

EndpointPurpose
GET /v1/meVerify a key, and see its plan, region, permissions, and limits
GET /v1/regionsDiscover regional hosts and their status
GET /v1/healthUnauthenticated liveness probe
/v1/filesUpload batch input, download batch results
/v1/batchesCreate, poll, cancel, and list jobs
GET /v1/modelsList and retrieve models
GET /v1/usage/entitiesToken and cost reporting per entity
/v1/limitsBudgets, 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 urlBody shape
/v1/chat/completionsChat completions
/v1/embeddingsEmbeddings
/v1/rerankRerank

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: en

The 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: limit and starting_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_.

On this page