Skip to content

Reference

API: Gateway keys

Markdown version

MethodPathWhat it doesScope
GET/v1/gateway-keysYour inference API keys with their limits and spend (secrets are never shown again)gateway:read
POST/v1/gateway-keysCreate an inference API key (sk-lg-v1-…), shown once. Agents must set a total limit no larger than the balance.gateway:write
DELETE/v1/gateway-keys/:idDelete a key (web app only; its spend history stays in the activity log) (web app only)gateway:write
GET/v1/gateway-keys/:idOne inference key, its limits and spendgateway:read
PATCH/v1/gateway-keys/:idChange a key: name, limits, rate limit, BYOK fallback, disable. Agents may only lower limits and disable.gateway:write
POST/v1/gateway-keys/:id/rotateReplace a key's secret, shown once; the old secret stops working at once. The key keeps its id, limits and spend.gateway:write

Examples

GET /v1/gateway-keys

Your inference API keys with their limits and spend (secrets are never shown again)

curl -s "https://manage.restolayer.com/v1/gateway-keys" \
  -H "Authorization: Bearer $LG_API_KEY"
const res = await fetch(`https://manage.restolayer.com/v1/gateway-keys`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.LG_API_KEY}` },
});
const data = await res.json();

POST /v1/gateway-keys

Create an inference API key (sk-lg-v1-…), shown once. Agents must set a total limit no larger than the balance.

curl -s -X POST "https://manage.restolayer.com/v1/gateway-keys" \
  -H "Authorization: Bearer $LG_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://manage.restolayer.com/v1/gateway-keys`, {
  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();

GET /v1/gateway-keys/$ID

One inference key, its limits and spend

curl -s "https://manage.restolayer.com/v1/gateway-keys/$ID" \
  -H "Authorization: Bearer $LG_API_KEY"
const res = await fetch(`https://manage.restolayer.com/v1/gateway-keys/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.LG_API_KEY}` },
});
const data = await res.json();

PATCH /v1/gateway-keys/$ID

Change a key: name, limits, rate limit, BYOK fallback, disable. Agents may only lower limits and disable.

curl -s -X PATCH "https://manage.restolayer.com/v1/gateway-keys/$ID" \
  -H "Authorization: Bearer $LG_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://manage.restolayer.com/v1/gateway-keys/${id}`, {
  method: "PATCH",
  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();

POST /v1/gateway-keys/$ID/rotate

Replace a key's secret, shown once; the old secret stops working at once. The key keeps its id, limits and spend.

curl -s -X POST "https://manage.restolayer.com/v1/gateway-keys/$ID/rotate" \
  -H "Authorization: Bearer $LG_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://manage.restolayer.com/v1/gateway-keys/${id}/rotate`, {
  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.