/api/v1/api-keys/{keyId}Update an API key's per-key limits
Updates the per-key rate/throughput limits and model allow-list. Only the fields present in the body are changed; sending an explicit `null` CLEARS that limit, omitting the field leaves it untouched, and an empty `modelAllowlist` normalizes to null (no restriction). Sending none of the four returns 400 NO_FIELDS. Ceilings: tpmLimit/rpmLimit <= 10,000,000, maxParallel <= 10,000, modelAllowlist <= 100 entries. Enforced server-side by the gateway: `tpmLimit` and `rpmLimit` produce 429, `modelAllowlist` produces 403, `maxParallel` is read by the concurrency limiter. Requires the 'admin' role on the org that owns the key — the org is resolved from the key row, so one org cannot mutate another org's key. Responses are `Cache-Control: no-store`.
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.
Parameters
keyId in pathrequiredstringRequest body required
Example
{
"tpmLimit": 0,
"rpmLimit": 0,
"maxParallel": 0,
"modelAllowlist": [
"string"
]
}Schema
{
"application/json": {
"schema": {
"type": "object",
"properties": {
"tpmLimit": {
"type": "integer",
"nullable": true,
"description": "Tokens per minute. `null` clears the limit."
},
"rpmLimit": {
"type": "integer",
"nullable": true,
"description": "Requests per minute. `null` clears the limit."
},
"maxParallel": {
"type": "integer",
"nullable": true,
"description": "Maximum in-flight requests. `null` clears the limit."
},
"modelAllowlist": {
"type": "array",
"nullable": true,
"items": {
"type": "string"
},
"description": "Models this key may call. Blank entries and duplicates are dropped; an empty result and `null` both mean 'no model restriction'."
}
}
}
}
}Response
All status codes
Code samples
cURL
# {keyId} is shown with an EXAMPLE value — replace it with real values.
curl -X PATCH \
https://evalguard.ai/api/v1/api-keys/00000000-0000-0000-0000-000000000000 \
-H "Authorization: Bearer $EVALGUARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "tpmLimit": 0, "rpmLimit": 0, "maxParallel": 0, "modelAllowlist": [ "string" ] }'TypeScript
// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
// {keyId} is shown with an EXAMPLE value — replace it with real values.
const res = await fetch("https://evalguard.ai/api/v1/api-keys/00000000-0000-0000-0000-000000000000", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"tpmLimit": 0,
"rpmLimit": 0,
"maxParallel": 0,
"modelAllowlist": [
"string"
]
}),
});
console.log(res.status, await res.json());Python
# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:
# {keyId} is shown with an EXAMPLE value — replace it with real values.
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}
headers["Content-Type"] = "application/json"
response = requests.request(
"PATCH",
"https://evalguard.ai/api/v1/api-keys/00000000-0000-0000-0000-000000000000",
headers=headers,
json={
"tpmLimit": 0,
"rpmLimit": 0,
"maxParallel": 0,
"modelAllowlist": [
"string"
]
},
)
print(response.status_code, response.json())Go
package main
import (
"context"
"fmt"
"net/http"
"os"
"strings"
)
// {keyId} is shown with an EXAMPLE value — replace it with real values.
func main() {
body := strings.NewReader(`{"tpmLimit":0,"rpmLimit":0,"maxParallel":0,"modelAllowlist":["string"]}`)
req, _ := http.NewRequestWithContext(context.Background(), "PATCH", "https://evalguard.ai/api/v1/api-keys/00000000-0000-0000-0000-000000000000", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
fmt.Println(resp.Status)
}