Skip to content

Reference

API: Models and routing

Markdown version

MethodPathWhat it doesScope
GET/v1/modelsEvery model you can use now, with its lowest list price per token, context length, supported parameters and whether its prices are confirmed, and the base URL to send requests to. include=pending also lists models waiting for a provider. No key needed (no sign-in)—
GET/v1/models/:author/:name/endpointsOne model's providers: each one's list price, context, limits, data policy and capabilities. No key needed (no sign-in)—
POST/v1/routing/previewExplain how a request would be routed, without sending it: every provider considered, why each was kept or left out, the order and the estimated costgateway:read

Examples

GET /v1/models

Every model you can use now, with its lowest list price per token, context length, supported parameters and whether its prices are confirmed, and the base URL to send requests to. include=pending also lists models waiting for a provider. No key needed. No sign-in, so it sends no key.

curl -s "https://manage.restolayer.com/v1/models"
const res = await fetch(`https://manage.restolayer.com/v1/models`, {
  method: "GET",
});
const data = await res.json();

GET /v1/models/$AUTHOR/$NAME/endpoints

One model's providers: each one's list price, context, limits, data policy and capabilities. No key needed. No sign-in, so it sends no key.

curl -s "https://manage.restolayer.com/v1/models/$AUTHOR/$NAME/endpoints"
const res = await fetch(`https://manage.restolayer.com/v1/models/${author}/${name}/endpoints`, {
  method: "GET",
});
const data = await res.json();

POST /v1/routing/preview

Explain how a request would be routed, without sending it: every provider considered, why each was kept or left out, the order and the estimated cost

curl -s -X POST "https://manage.restolayer.com/v1/routing/preview" \
  -H "Authorization: Bearer $LG_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://manage.restolayer.com/v1/routing/preview`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.LG_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

Request and response schemas: https://www.restolayer.com/openapi.json. All resources: API reference.

Send feedback

Tell us what's broken, confusing or missing on this page, or an idea. It goes to the team that builds the product.
Please don't include passwords or card numbers.
Only to reply about this. Never added to any mailing list.