---
type: study
created: 2026-08-11
updated: 2026-08-11
sensitivity: standard
status: verified
tags:
  - study
  - langchain
  - langsmith
  - smith-api
  - model-governance
  - system
topic: LangSmith Smith API Feature 模型治理、价格表与部署 Info
sources:
  - https://docs.langchain.com/langsmith/smith-api/features/delete-default-model-for-a-feature
  - https://docs.langchain.com/langsmith/smith-api/features/disable-a-model-for-a-feature
  - https://docs.langchain.com/langsmith/smith-api/features/list-feature-configurations
  - https://docs.langchain.com/langsmith/smith-api/features/re-enable-a-disabled-model-for-a-feature
  - https://docs.langchain.com/langsmith/smith-api/features/set-default-model-for-a-feature
  - https://docs.langchain.com/langsmith/smith-api/info/get-health-info
  - https://docs.langchain.com/langsmith/smith-api/info/get-server-info
  - https://docs.langchain.com/langsmith/smith-api/model-price-map/create-new-model-price
  - https://docs.langchain.com/langsmith/smith-api/model-price-map/delete-model-price
  - https://docs.langchain.com/langsmith/smith-api/model-price-map/read-model-price-map
  - https://docs.langchain.com/langsmith/smith-api/model-price-map/update-model-price
last_verified: 2026-08-11
---

# Feature 模型治理、价格表与部署 Info

这一组 System API 决定两个生产基础：某个 LangSmith feature 可使用哪些模型/默认哪个模型，以及 tracing 中的模型调用如何匹配成本。Info/Health 则用于版本门禁和实例存活检查，不是应向公网完整暴露的运维信息页。

## Feature 级模型治理

| 能力 | 方法与路径 | 成功 |
|---|---|---|
| 列所有 feature 配置 | `GET /api/v1/platform/features` | 200 |
| 设/替换默认模型 | `PUT /api/v1/platform/features/{feature}/default-model` | 204 |
| 删默认模型 | `DELETE .../{feature}/default-model` | 204 |
| 禁用模型 | `PUT .../{feature}/disabled-models` | 204 |
| 重新启用 | `DELETE .../{feature}/disabled-models/{model}` | 204 |

PUT body 是 `model` 字符串，path 中的 model 必须 URL encode。列表返回 `feature`、`default_model`、`disabled_models`、`org_disabled_providers`。`disabled_models` 是 workspace 禁用集与 organization 级禁用 provider 的并集；`org_disabled_providers` 是其中上级强制部分，workspace 管理员不能重新启用。

变更不变式：默认模型必须在有效 catalog 中、未被 workspace/org 禁用、已配置 provider 凭据并符合数据地域/合规策略。切换前在目标 feature 做能力/成本/延迟/输出兼容验证，保存旧值并可一键回滚。变更 204 无 body，应紧接 GET 校验有效配置，不仅根据 HTTP 成功更新 UI。

## Model Price Map

| 操作 | 方法与路径 |
|---|---|
| 创建 | `POST /api/v1/model-price-map` |
| 列表/搜索 | `GET /api/v1/model-price-map?offset=0&limit=100&q=...` |
| 更新 | `PUT /api/v1/model-price-map/{id}` |
| 删除 | `DELETE /api/v1/model-price-map/{id}` |

创建与 PUT 都必填 `name`、`match_pattern`、`prompt_cost`、`completion_cost`，可带 `match_path`、provider、`start_time`、prompt/completion cost details。请求 cost 可为 number 或 decimal string，读取统一是 string；用 Decimal 解析，不用二进制 float 做账务聚合。

当前 endpoint 页没有定义 cost 的币种、token 缩放单位、pattern 语法/优先级、重叠规则中谁胜出；不能从字段名自行推导。上线前在目标部署用代表性 model metadata 做匹配契约测试，明确单位与优先级，再写运维手册。

`match_pattern` 若是正则/类正则可导致过宽匹配或 ReDoS；限长、禁危险构造、在全量已知模型上预演冲突。价格变更使用新记录 + `start_time` 版本化更易审计；直接 PUT/删除可改变历史成本重算，执行前保存快照、评估报表影响并建立回滚。写/删成功只返 200 无资源 body，后续 GET 校验。

## Health 和 Info

`GET /api/v1/info/health` 当前无 security requirement，返回 `clickhouse_disk_free_pct`。这是存活/容量信号，不证明所有依赖、写入、查询或异步 worker 都可用。Kubernetes 等环境中将 liveness 与 readiness 分开；通过内网 ingress/监控网段保护此容量信息。

`GET /api/v1/info` 返回 version、git SHA、instance flags、batch-ingest config、SDK 版本界限、license expiration 和 customer info。页面描述称默认无认证，设 `FF_INFO_ENDPOINT_AUTH_REQUIRED=true` 后要认证；但当前 operation 的 OpenAPI `security` 又列出 API key/Tenant/Bearer。这是配置相关且文档/schema 表述不一致的边界；客户端要在目标部署做 200/401 contract test，运维上按需认证的更安全基线配置。

不将完整 instance flags、license/customer info 暴露给匿名用户或记入公开日志。升级前用 Info 做 SDK/server 版本门禁，但不仅根据版本字符串宣称功能可用；结合 feature flag、实际 API contract test 和迁移检查。
