{"record":{"id":"29c4cfa0a2460f1b","repo":"plandex-ai/plandex","slug":"custom-models-are-not-supported-on-plandex-cloud-i","errorCode":null,"errorMessage":"Custom models are not supported on Plandex Cloud in Integrated Models mode","messagePattern":"Custom models are not supported on Plandex Cloud in Integrated Models mode","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"app/server/handlers/models.go","lineNumber":55,"sourceCode":"\n\tif len(modelsInput.CustomProviders) > 0 {\n\t\tif os.Getenv(\"IS_CLOUD\") != \"\" {\n\t\t\thttp.Error(w, \"Custom model providers are not supported on Plandex Cloud\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif len(modelsInput.CustomModels) > 0 {\n\t\tif os.Getenv(\"IS_CLOUD\") != \"\" {\n\t\t\tapiOrg, err := getApiOrg(auth.OrgId)\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"Error fetching org: %v\\n\", err)\n\t\t\t\thttp.Error(w, \"Failed to create custom model: \"+err.Error(), http.StatusInternalServerError)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif apiOrg.IntegratedModelsMode {\n\t\t\t\thttp.Error(w, \"Custom models are not supported on Plandex Cloud in Integrated Models mode\", http.StatusBadRequest)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\thasDuplicates, errMsg := modelsInput.CheckNoDuplicates()\n\tif !hasDuplicates {\n\t\thttp.Error(w, \"Has duplicates: \"+errMsg, http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tfor _, provider := range modelsInput.CustomProviders {\n\t\tif provider.Name == \"\" {\n\t\t\tmsg := \"Provider name is required\"\n\t\t\tlog.Println(msg)\n\t\t\thttp.Error(w, msg, http.StatusBadRequest)\n\t\t\treturn\n\t\t}","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/models.go#L37-L73","documentation":"On Plandex Cloud, custom models are blocked for organizations that have IntegratedModelsMode enabled. In that mode the org uses Plandex-provided integrated models and cannot define its own custom models. The handler returns HTTP 400 with this message after confirming the org is in integrated mode.","triggerScenarios":"POSTing a ModelsInput with non-empty CustomModels to the upsert endpoint on a cloud-mode server when the authenticated org's IntegratedModelsMode flag is true.","commonSituations":"An org switched to integrated (credit-based) model plans and an admin then tries to import an old custom models.json; scripting model config sync across orgs where one is integrated-mode; a user unaware their org admin enabled integrated models.","solutions":["Have the org admin disable IntegratedModelsMode for the org on Plandex Cloud","Switch to a self-hosted Plandex server, where custom models are always allowed","Remove the customModels section from the payload and use the org's integrated models instead","Check the org's plan/settings to confirm which model mode it is in before syncing configs"],"exampleFix":"// before: sending custom models to an integrated-mode org on cloud\nPOST /custom_models {\"customModels\": [...]}\n// after: only send custom models to non-integrated orgs or self-hosted\nif !org.IntegratedModelsMode || selfHosted {\n    POST /custom_models {\"customModels\": [...]}\n}","handlingStrategy":"validation","validationCode":"if org.IntegratedModelsMode && !selfHosted && len(input.CustomModels) > 0 {\n    return errors.New(\"custom models are blocked for integrated-models orgs on Plandex Cloud\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fetch the org's IntegratedModelsMode flag before sending custom models","Skip custom-model sync automatically for integrated-mode orgs","Prefer self-hosted deployments when custom models are core to your workflow"],"tags":["http","go","cloud-restriction","organization-config","bad-request"],"backgroundTag":"feature-not-supported-on-cloud","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}