plandex-ai/plandex · warning

Use POST /custom_models instead to create model packs

Error message

Use POST /custom_models instead to create model packs

What it means

CreateModelPackHandler is a deprecated stub. Once custom models (POST /custom_models) shipped, the old model-pack creation endpoint was removed and now unconditionally returns HTTP 400 telling callers to use POST /custom_models instead. No logic runs besides auth and a minimum client-version check.

Source

Thrown at app/server/handlers/models.go:475

		return
	}

	log.Println("Successfully fetched custom providers")
}

func CreateModelPackHandler(w http.ResponseWriter, r *http.Request) {
	log.Println("Received request for CreateModelPackHandler")

	auth := Authenticate(w, r, true)
	if auth == nil {
		return
	}

	if !requireMinClientVersion(w, r, CustomModelsMinClientVersion) {
		return
	}

	http.Error(w, "Use POST /custom_models instead to create model packs", http.StatusBadRequest)
}

func UpdateModelPackHandler(w http.ResponseWriter, r *http.Request) {
	log.Println("Received request for UpdateModelPackHandler")

	auth := Authenticate(w, r, true)
	if auth == nil {
		return
	}

	if !requireMinClientVersion(w, r, CustomModelsMinClientVersion) {
		return
	}

	http.Error(w, "Use POST /custom_models instead to update model packs", http.StatusBadRequest)
}

func ListModelPacksHandler(w http.ResponseWriter, r *http.Request) {

View on GitHub (pinned to e2d772072e)

Solutions

  1. Switch the call to POST /custom_models.
  2. Upgrade the Plandex client/CLI to a version that uses the custom models API.
  3. Update internal scripts/docs that still reference the legacy model-pack endpoints.

Example fix

// before
POST /server/model_packs {"pack": {...}}
// after
POST /server/custom_models {"pack": {...}}
Defensive patterns

Strategy: validation

Validate before calling

// client-side: use the replacement endpoint directly
const modelPackEndpoint = "/custom_models" // legacy /model_packs create returns 400

Type guard

func isLegacyModelPackRoute(path string) bool {
	return strings.HasPrefix(path, "/model_packs")
}

Try / catch

resp, err := client.Post(base+"/custom_models", "application/json", body)
if err != nil { return err }
if resp.StatusCode == 400 && strings.Contains(readBody(resp), "Use POST /custom_models") {
	return migrateToCustomModelsCall()
}

Prevention

When it happens

Trigger: Any POST to the legacy model-pack creation endpoint with a client at least CustomModelsMinClientVersion; older clients are rejected earlier by requireMinClientVersion.

Common situations: Automated scripts or SDK versions still calling the pre-custom-models API surface; cached API docs referencing model packs; integrations not updated after a Plandex server upgrade.

Related errors


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/53e90cb9a8776a87. Report an issue: GitHub.