/api/v1/gateway/proxy/{path+}Forward PATCH to LLM provider
PATCH variant for providers that use it. Authentication: your `eg_` API key in the `X-EvalGuard-Key` header (the GatewayKey scheme), NOT the document-level `Authorization: Bearer` form — on this path `Authorization` and `x-api-key` carry the upstream provider's credential and are forwarded to that provider, so an EvalGuard key sent there is disclosed and still authenticates nothing. It is the same key and the same scopes, so the published `x-required-scopes` is enforced.
Authentication
EvalGuard API key, in a different header. Send your eg_ key in the X-EvalGuard-Key header (X-Api-Key-Evalguard is also accepted).
Do NOT use the Authorization header here. On this path Authorization and x-api-key carry the UPSTREAM PROVIDER's credential and are forwarded to that provider unchanged — an eg_ key sent there is disclosed to the provider and still authenticates nothing. Same key, same scopes: gateway:proxy is enforced.
Parameters
path+ in pathrequiredWildcard suffix — the full upstream-API path to forward (e.g. `chat/completions`, `messages`, `models`). The gateway maps it to the right provider via the project's gateway config.
stringResponse
200 example
{}All status codes
Code samples
cURL
# {path+} is shown with an EXAMPLE value — replace it with real values.
curl -X PATCH \
https://evalguard.ai/api/v1/gateway/proxy/chat/completions \
-H "Authorization: Bearer $EVALGUARD_API_KEY"TypeScript
// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
// {path+} is shown with an EXAMPLE value — replace it with real values.
const res = await fetch("https://evalguard.ai/api/v1/gateway/proxy/chat/completions", {
method: "PATCH",
headers: { Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}` },
});
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:
# {path+} is shown with an EXAMPLE value — replace it with real values.
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}
response = requests.request("PATCH", "https://evalguard.ai/api/v1/gateway/proxy/chat/completions", headers=headers)
print(response.status_code, response.json())Go
package main
import (
"context"
"fmt"
"net/http"
"os"
)
// {path+} is shown with an EXAMPLE value — replace it with real values.
func main() {
req, _ := http.NewRequestWithContext(context.Background(), "PATCH", "https://evalguard.ai/api/v1/gateway/proxy/chat/completions", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
fmt.Println(resp.Status)
}