# Create a new PT serving endpoint

Launch stage: Public Preview

`POST /api/2.0/serving-endpoints/pt`

Create a new PT serving endpoint.

API scopes: model-serving

## Request body

- `name` (string, required)
  The name of the serving endpoint. This field is required and must be unique across a <Workspace>.
   An endpoint name can consist of alphanumeric characters, dashes, and underscores.
  Example: `feed-ads`
- `config` (object, required)
  The core config of the serving endpoint.
  - `served_entities` (array of object, optional)
    The list of served entities under the serving endpoint config.
    - `name` (string, optional)
      The name of a served entity. It must be unique across an endpoint. A served entity name can consist of alphanumeric characters, dashes, and underscores. If not specified for an external model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if not specified for other entities, it defaults to entity_name-entity_version.
      Example: `ads-model-3`
    - `entity_name` (string, required)
      The name of the entity to be served. The entity may be a model in the Databricks Model Registry, a model in the Unity Catalog (UC), or a function of type FEATURE_SPEC in the UC. If it is a UC object, the full name of the object should be given in the form of **catalog_name.schema_name.model_name**.
      Example: `ads-model`
    - `entity_version` (string, optional)
      Example: `3`
    - `provisioned_model_units` (int64, required)
      The number of model units to be provisioned.
      Example: `1000`
    - `burst_scaling_enabled` (boolean, optional)
      Whether burst scaling is enabled. When enabled (default), the endpoint can automatically
       scale up beyond provisioned capacity to handle traffic spikes. When disabled, the endpoint
       maintains fixed capacity at provisioned_model_units.
      Example: `true`
  - `traffic_config` (object, optional)
    - `routes` (array of object, optional)
      The list of routes that define traffic to each served entity.
      - `served_model_name` (string, optional)
        The name of the served model this route configures traffic for.
        Example: `ads-model-3`
      - `traffic_percentage` (int32, required)
        The percentage of endpoint traffic to send to this route. It must be an integer between 0 and 100 inclusive.
        Example: `100`
      - `served_entity_name` (string, optional)
        Example: `ads-model-3`
- `tags` (array of object, optional)
  Tags to be attached to the serving endpoint and automatically propagated to billing logs.
  - `key` (string, required)
    Key field for a serving endpoint tag.
    Example: `team`
  - `value` (string, optional)
    Optional value field for a serving endpoint tag.
    Example: `data science`
- `ai_gateway` (object, optional)
  The AI Gateway configuration for the serving endpoint.
  - `usage_tracking_config` (object, optional)
    Configuration to enable usage tracking using system tables.
     These tables allow you to monitor operational usage on endpoints and their associated costs.
    - `enabled` (boolean, optional)
      Whether to enable usage tracking.
      Example: `true`
  - `inference_table_config` (object, optional)
    Configuration for payload logging using inference tables.
     Use these tables to monitor and audit data being sent to and received from model APIs and to improve model quality.
    - `catalog_name` (string, optional)
      The name of the catalog in Unity Catalog. Required when enabling inference tables.
       NOTE: On update, you have to disable inference table first in order to change the catalog name.
      Example: `my-catalog`
    - `schema_name` (string, optional)
      The name of the schema in Unity Catalog. Required when enabling inference tables.
       NOTE: On update, you have to disable inference table first in order to change the schema name.
      Example: `my-schema`
    - `table_name_prefix` (string, optional)
      The prefix of the table in Unity Catalog.
       NOTE: On update, you have to disable inference table first in order to change the prefix name.
      Example: `my-prefix`
    - `enabled` (boolean, optional)
      Indicates whether the inference table is enabled.
      Example: `true`
  - `rate_limits` (array of object, optional)
    Configuration for rate limits which can be set to limit endpoint traffic.
    - `calls` (int64, optional)
      Used to specify how many calls are allowed for a key within the renewal_period.
      Example: `15`
    - `key` (string, optional)
      Key field for a rate limit. Currently, 'user', 'user_group, 'service_principal', and 'endpoint' are supported,
       with 'endpoint' being the default if not specified.
    - `renewal_period` (string, required)
      Renewal period field for a rate limit. Currently, only 'minute' is supported.
    - `principal` (string, optional)
      Principal field for a user, user group, or service principal to apply rate limiting to. Accepts a user email, group name, or service principal application ID.
      Example: `user@test.com`
    - `tokens` (int64, optional)
      Used to specify how many tokens are allowed for a key within the renewal_period.
      Example: `10000`
  - `guardrails` (object, optional)
    Configuration for AI Guardrails to prevent unwanted data and unsafe data in requests and responses.
    - `input` (object, optional)
      Configuration for input guardrail filters.
      - `safety` (boolean, optional)
        Indicates whether the safety filter is enabled.
        Example: `true`
      - `pii` (object, optional)
        Configuration for guardrail PII filter.
        - `behavior` (string, optional)
          Configuration for input guardrail filters.
          Possible values:
          - `BEHAVIOR_UNSPECIFIED`
          - `NONE`
          - `BLOCK`
          - `MASK`
          Example: `BLOCK`
      - `valid_topics` (array of string, optional, Deprecated)
        The list of allowed topics.
         Given a chat request, this guardrail flags the request if its topic is not in the allowed topics.
      - `invalid_keywords` (array of string, optional, Deprecated)
        List of invalid keywords.
         AI guardrail uses keyword or string matching to decide if the keyword exists in the request or response content.
    - `output` (object, optional)
      Configuration for output guardrail filters.
      - `safety` (boolean, optional)
        Indicates whether the safety filter is enabled.
        Example: `true`
      - `pii` (object, optional)
        Configuration for guardrail PII filter.
        - `behavior` (string, optional)
          Configuration for input guardrail filters.
          Possible values:
          - `BEHAVIOR_UNSPECIFIED`
          - `NONE`
          - `BLOCK`
          - `MASK`
          Example: `BLOCK`
      - `valid_topics` (array of string, optional, Deprecated)
        The list of allowed topics.
         Given a chat request, this guardrail flags the request if its topic is not in the allowed topics.
      - `invalid_keywords` (array of string, optional, Deprecated)
        List of invalid keywords.
         AI guardrail uses keyword or string matching to decide if the keyword exists in the request or response content.
  - `fallback_config` (object, optional)
    Configuration for traffic fallback which auto fallbacks to other served entities if the request to a served
     entity fails with certain error codes, to increase availability.
    - `enabled` (boolean, required)
      Whether to enable traffic fallback. When a served entity in the serving endpoint returns specific error
       codes (e.g. 500), the request will automatically be round-robin attempted with other served entities in the same
       endpoint, following the order of served entity list, until a successful response is returned.
       If all attempts fail, return the last response with the error code.
      Example: `true`
- `budget_policy_id` (string, optional)
  The budget policy associated with the endpoint.
- `email_notifications` (object, optional)
  Email notification settings.
  - `on_update_success` (array of string, optional)
    A list of email addresses to be notified when an endpoint successfully updates its configuration or state.
    Example: `user.name@databricks.com`
  - `on_update_failure` (array of string, optional)
    A list of email addresses to be notified when an endpoint fails to update its configuration or state.
    Example: `user.name@databricks.com`

## Returns

Returns the InferenceEndpointDetailed object.

## Response

```json
{
  "name": "feed-ads",
  "creator": "alice@company.com",
  "creation_timestamp": 0,
  "last_updated_timestamp": 0,
  "state": {
    "ready": "READY",
    "config_update": "NOT_UPDATING"
  },
  "config": {
    "config_version": 0,
    "served_entities": [
      {}
    ],
    "served_models": [
      {}
    ],
    "traffic_config": {},
    "auto_capture_config": {}
  },
  "pending_config": {
    "served_entities": [
      {}
    ],
    "served_models": [
      {}
    ],
    "traffic_config": {},
    "config_version": 0,
    "start_time": 0,
    "auto_capture_config": {}
  },
  "id": "88fd3f75a0d24b0380ddc40484d7a31b",
  "permission_level": "CAN_MANAGE",
  "tags": [
    {
      "key": "team",
      "value": "data science"
    }
  ],
  "task": "model-serving-task",
  "route_optimized": true,
  "endpoint_url": "string",
  "data_plane_info": {
    "query_info": {}
  },
  "ai_gateway": {
    "usage_tracking_config": {},
    "inference_table_config": {},
    "rate_limits": [
      {}
    ],
    "guardrails": {},
    "fallback_config": {}
  },
  "budget_policy_id": "string",
  "email_notifications": {
    "on_update_success": [
      "user.name@databricks.com"
    ],
    "on_update_failure": [
      "user.name@databricks.com"
    ]
  },
  "description": "string",
  "telemetry_config": {
    "telemetry_profile_id": "string",
    "table_names": {},
    "inference_table_config": {},
    "enabled_telemetry_features": [
      "TELEMETRY_FEATURE_LOGS"
    ]
  }
}
```

