Skip to content

Reference

API: Provider keys

Markdown version

MethodPathWhat it doesScope
GET/v1/provider-keysYour own provider keys (BYOK): used first for that provider's models, free of any fee. The secret is never shown.gateway:read
POST/v1/provider-keysAdd your key for a provider (web app only), sealed at rest and used only for your requests. Several active keys for one provider split its traffic by weight; replace: true disables the others. (web app only)gateway:write
DELETE/v1/provider-keys/:idDelete a provider key (web app only); the sealed secret goes with it (web app only)gateway:write
PATCH/v1/provider-keys/:idRename or disable a provider key (re-enabling is done in the web app)gateway:write

Examples

GET /v1/provider-keys

Your own provider keys (BYOK): used first for that provider's models, free of any fee. The secret is never shown.

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

PATCH /v1/provider-keys/$ID

Rename or disable a provider key (re-enabling is done in the web app)

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

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.