Skip to main content
The control plane API is part of LangSmith Deployment. With the control plane API, you can programmatically create, manage, and automate your Agent Server deployments—for example, as part of a custom CI/CD workflow. Browse the full API reference in the Control Plane API section in the sidebar, or refer to the endpoint groups:

Host

The control plane hosts for Cloud data regions:
Region
GCP US
GCP EU
GCP APAC
AWS US
Note: Self-hosted deployments of LangSmith will have a custom host for the control plane. The control plane APIs can be accessed at the path /api-host. For example, http(s)://<host>/api-host/v2/deployments. See the self-host usage guide for more details.

Authentication

To authenticate with the control plane API, set the X-Api-Key header to a valid LangSmith API key and set the X-Tenant-Id header to a valid workspace ID to target. Example curl command:

Versioning

Each endpoint path is prefixed with a version (e.g. v1, v2).

Quick start

  1. Call POST /v2/deployments to create a new Deployment. The response body contains the Deployment ID (id) and the ID of the latest (and first) revision (latest_revision_id).
  2. Call GET /v2/deployments/{deployment_id} to retrieve the Deployment. Set deployment_id in the URL to the value of Deployment ID (id).
  3. Poll for revision status until status is DEPLOYED by calling GET /v2/deployments/{deployment_id}/revisions/{latest_revision_id}.
  4. Call PATCH /v2/deployments/{deployment_id} to update the deployment.

Resource spec

The resource_spec object sets CPU, memory, and replica counts for a deployment’s API servers, queue workers, Redis, and PostgreSQL. The field descriptions in the Deployments (v2) reference list each field. The following behaviors apply across fields:
  • PATCH replaces the whole object: A PATCH that includes resource_spec replaces the stored resource_spec and does not merge with it. Fields you leave out fall back to the defaults for the deployment type, not to their previous values. Send the full resource_spec on every PATCH.
  • Limits default to 2x the request: If you set a CPU or memory request and omit its limit, the limit defaults to 2x the request. The Redis memory limit is the exception: redis_memory_limit_mb defaults to redis_memory_mb. On self-hosted data planes, the CPU limit also sets the autoscaling target.
  • CPU values are rounded to 1 decimal place: Rounding uses floating-point arithmetic, so some values round down. For example, 0.25 is stored as 0.2.
  • Redis memory has its own range: redis_memory_mb and redis_memory_limit_mb accept 512 to 16384, in multiples of 128. The API enforces this range in a validator, so it does not appear in the OpenAPI schema.
For self-hosted deployments, the listener in the data plane validates the resource_spec again with the rules of its own version. A PATCH that returns 200 can still fail at deploy time on an older listener. See Listener version requirements.

Example Code

Below is example Python code that demonstrates how to orchestrate the control plane APIs to create a deployment, update the deployment, and delete the deployment.