Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat(api): allow admin auth for model routes (#16224)

Hassieb Pakzada9b9a739aaa9
diff --git a/web/src/pages/api/public/models/[modelId]/index.ts b/web/src/pages/api/public/models/[modelId]/index.ts
index 6b6b02d7e0..39f96ac0b6 100644
--- a/web/src/pages/api/public/models/[modelId]/index.ts
+++ b/web/src/pages/api/public/models/[modelId]/index.ts
@@ -14,6 +14,7 @@ import {
export default withMiddlewares({
GET: createAuthedProjectAPIRoute({
name: "Get model definitions",
+ isAdminApiKeyAuthAllowed: true,
querySchema: GetModelV1Query,
responseSchema: GetModelV1Response,
fn: async ({ query, auth }) => {
@@ -26,6 +27,7 @@ export default withMiddlewares({
DELETE: createAuthedProjectAPIRoute({
name: "Delete model",
+ isAdminApiKeyAuthAllowed: true,
querySchema: DeleteModelV1Query,
responseSchema: DeleteModelV1Response,
fn: async ({ query, auth }) => {
diff --git a/web/src/pages/api/public/models/index.ts b/web/src/pages/api/public/models/index.ts
index 3c1ac4559a..fc91c35049 100644
--- a/web/src/pages/api/public/models/index.ts
+++ b/web/src/pages/api/public/models/index.ts
@@ -14,6 +14,7 @@ import {
export default withMiddlewares({
GET: createAuthedProjectAPIRoute({
name: "Get model definitions",
+ isAdminApiKeyAuthAllowed: true,
querySchema: GetModelsV1Query,
responseSchema: GetModelsV1Response,
fn: async ({ query, auth }) => {
@@ -27,6 +28,7 @@ export default withMiddlewares({
POST: createAuthedProjectAPIRoute({
name: "Create custom model definition",
+ isAdminApiKeyAuthAllowed: true,
bodySchema: PostModelsV1Body,
responseSchema: PostModelsV1Response,
fn: async ({ body, auth }) => {