{"record":{"id":"3fe8b91a533a8ea3","repo":"odysseus-dev/odysseus","slug":"endpoint-url-is-required-choose-from-api-models","errorCode":null,"errorMessage":"endpoint_url is required (choose from /api/models)","messagePattern":"endpoint_url is required \\(choose from /api/models\\)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/session_routes.py","lineNumber":368,"sourceCode":"            _db = SessionLocal()\n            try:\n                q = _db.query(ModelEndpoint).filter(\n                    ModelEndpoint.id == endpoint_id.strip(),\n                    ModelEndpoint.is_enabled == True,\n                )\n                if user:\n                    q = owner_filter(q, ModelEndpoint, user)\n                endpoint_row = q.first()\n                if not endpoint_row:\n                    raise HTTPException(400, \"Model endpoint no longer exists\")\n                endpoint_base_url = endpoint_row.base_url or \"\"\n                endpoint_api_key = endpoint_row.api_key or \"\"\n                endpoint_url = build_chat_url(normalize_base(endpoint_base_url))\n            finally:\n                _db.close()\n\n        if not endpoint_url and not skip_val:\n            raise HTTPException(400, \"endpoint_url is required (choose from /api/models)\")\n\n        model_to_use = model\n        request_api_key = api_key.strip() if api_key else \"\"\n        effective_api_key = request_api_key or endpoint_api_key\n        validation_headers = None\n        if effective_api_key:\n            from src.endpoint_resolver import build_headers\n            validation_headers = build_headers(effective_api_key, endpoint_base_url or endpoint_url)\n\n        if skip_val:\n            # skip_validation = trust the caller and do NOT probe /v1/models.\n            # Used for custom endpoints AND for bare placeholder sessions with no\n            # model at all (e.g. an email reply draft just needs a session to live\n            # in). Probing here was 400-ing those with \"Cannot reach /v1/models\".\n            pass\n        elif not model_to_use:\n            from src.llm_core import list_model_ids\n            ids = list_model_ids(","sourceCodeStart":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/session_routes.py#L350-L386","documentation":"Error \"endpoint_url is required (choose from /api/models)\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Pass endpoint_url chosen from /api/models.","Fix the client to include the endpoint_url field."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}