Skip to content

Reference

API: Presets

Markdown version

MethodPathWhat it doesScope
GET/v1/presetsYour presets (the live version of each): a model, its routing and a system prompt, used as @preset/<name>gateway:read
POST/v1/presetsSave a new preset (version 1). It can't loosen your organization's guardrails: those still apply.gateway:write
DELETE/v1/presets/:idArchive a preset (web app only): requests naming it stop resolving; its versions are kept (web app only)gateway:write
GET/v1/presets/:idOne preset: its live version and the earlier onesgateway:read
PATCH/v1/presets/:idChange a preset: saves the result as a new version (the earlier ones stay)gateway:write

Examples

GET /v1/presets

Your presets (the live version of each): a model, its routing and a system prompt, used as @preset/<name>

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

POST /v1/presets

Save a new preset (version 1). It can't loosen your organization's guardrails: those still apply.

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

One preset: its live version and the earlier ones

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

PATCH /v1/presets/$ID

Change a preset: saves the result as a new version (the earlier ones stay)

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

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.