diff --git a/sdk/api/handlers/openai/openai_handlers.go b/sdk/api/handlers/openai/openai_handlers.go index 2e85dcf851..be8ec2f014 100644 --- a/sdk/api/handlers/openai/openai_handlers.go +++ b/sdk/api/handlers/openai/openai_handlers.go @@ -59,34 +59,15 @@ func (h *OpenAIAPIHandler) Models() []map[string]any { // OpenAIModels handles the /v1/models endpoint. // It returns a list of available AI models with their capabilities // and specifications in OpenAI-compatible format. +// All metadata from the model registry is included so that downstream +// consumers (dashboards, IDEs, proxy UIs) can group and display models +// without maintaining a separate static list. func (h *OpenAIAPIHandler) OpenAIModels(c *gin.Context) { - // Get all available models allModels := h.Models() - // Filter to only include the 4 required fields: id, object, created, owned_by - filteredModels := make([]map[string]any, len(allModels)) - for i, model := range allModels { - filteredModel := map[string]any{ - "id": model["id"], - "object": model["object"], - } - - // Add created field if it exists - if created, exists := model["created"]; exists { - filteredModel["created"] = created - } - - // Add owned_by field if it exists - if ownedBy, exists := model["owned_by"]; exists { - filteredModel["owned_by"] = ownedBy - } - - filteredModels[i] = filteredModel - } - c.JSON(http.StatusOK, gin.H{ "object": "list", - "data": filteredModels, + "data": allModels, }) }