Skip to content

Reference

lg_gateway_keys_create: Create an inference API key

Markdown version

Create an inference API key; the secret is in this answer only. As an agent you must set limit_total_usd, at most the organization's balance; it can never spend more.

  • Changes data: yes
  • Credential scope: gateway:write (an API key's scopes, or what you allowed when connecting with OAuth)
  • Assistant level: an assistant at Full; a lower level is refused

Inputs

FieldTypeRequiredNotes
bodyobject (name, limit_total_usd, limit_daily_usd, limit_monthly_usd, rate_limit_rpm, byok_fallback, expires_in_days, workspace_id)yes
body.namestringyes
body.limit_total_usdstring or numbernoMost this key may ever spend (required for agents)
body.limit_daily_usdstring or numbernoUS dollars, at most 6 decimals: "5.00"
body.limit_monthly_usdstring or numbernoUS dollars, at most 6 decimals: "5.00"
body.rate_limit_rpmintegernoRequests a minute (default 600)
body.byok_fallbackbooleannoWhen your provider key is refused, go on with credits (web app only)
body.expires_in_daysintegerno
body.workspace_idstringnoThe key spends within this workspace's budget

Example MCP call

A tools/call request to https://manage.restolayer.com/mcp:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "lg_gateway_keys_create",
    "arguments": {
      "body": {
        "name": "nightly-evals",
        "limit_total_usd": "5.00",
        "limit_daily_usd": "1.00"
      }
    }
  }
}

Example REST call

The same thing over REST (POST /v1/gateway-keys):

curl -s -X POST "https://manage.restolayer.com/v1/gateway-keys" \
  -H "Authorization: Bearer $LG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"nightly-evals","limit_total_usd":"5.00","limit_daily_usd":"1.00"}'

All tools: MCP tools. Connecting: connect your assistant.

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.