> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve an ML Model Service

> Get an ML model service by ID or fully qualified name

# Retrieve an ML Model Service

Get a single ML model service by its unique ID or fully qualified name.

## Get by ID

<ParamField path="id" type="string" required>
  UUID of the ML model service to retrieve.
</ParamField>

<ParamField query="fields" type="string">
  Comma-separated list of fields to include (e.g., `owners,tags,domains`).
</ParamField>

<ParamField query="include" type="string" default="non-deleted">
  Include `all`, `deleted`, or `non-deleted` entities.
</ParamField>

## Get by Fully Qualified Name

Use `GET /v1/services/mlmodelServices/name/{fqn}` to retrieve by fully qualified name.

<ParamField path="fqn" type="string" required>
  Fully qualified name of the ML model service (e.g., `mlflow_svc`).
</ParamField>

<ParamField query="fields" type="string">
  Comma-separated list of fields to include: `owners`, `tags`, `domains`.
</ParamField>

<ParamField query="include" type="string" default="non-deleted">
  Include `all`, `deleted`, or `non-deleted` entities.
</ParamField>

<RequestExample dropdown>
  ```python GET /v1/services/mlmodelServices/{id} theme={null}
  from metadata.sdk import configure
  from metadata.sdk.entities import MlModelServices

  configure(
      host="https://your-company.open-metadata.org/api",
      jwt_token="your-jwt-token"
  )

  # Get by ID
  svc = MlModelServices.retrieve("ca22d46e-81b9-4e48-85b5-0adc44980da9")
  print(f"{svc.fullyQualifiedName}: {svc.serviceType}")

  # Get by ID with fields
  svc = MlModelServices.retrieve(
      "ca22d46e-81b9-4e48-85b5-0adc44980da9",
      fields=["owners", "tags"]
  )

  # Get by fully qualified name
  svc = MlModelServices.retrieve_by_name("mlflow_svc")

  # Get by name with fields
  svc = MlModelServices.retrieve_by_name(
      "mlflow_svc",
      fields=["owners", "tags", "domains"]
  )
  ```

  ```java GET /v1/services/mlmodelServices/{id} theme={null}
  import static org.openmetadata.sdk.fluent.MlModelServices.*;

  // Get by ID
  var svc = MlModelServices.retrieve("ca22d46e-81b9-4e48-85b5-0adc44980da9");

  // Get by ID with fields
  var svc = MlModelServices.retrieve(
      "ca22d46e-81b9-4e48-85b5-0adc44980da9",
      "owners,tags"
  );

  // Get by fully qualified name
  var svc = MlModelServices.retrieveByName("mlflow_svc");

  // Get by name with fields
  var svc = MlModelServices.retrieveByName("mlflow_svc", "owners,tags,domains");
  ```

  ```bash GET /v1/services/mlmodelServices/{id} theme={null}
  # Get by ID
  curl "{base_url}/api/v1/services/mlmodelServices/ca22d46e-81b9-4e48-85b5-0adc44980da9" \
    -H "Authorization: Bearer {access_token}"

  # Get by ID with fields
  curl "{base_url}/api/v1/services/mlmodelServices/ca22d46e-81b9-4e48-85b5-0adc44980da9?fields=owners,tags,domains" \
    -H "Authorization: Bearer {access_token}"

  # Get by fully qualified name
  curl "{base_url}/api/v1/services/mlmodelServices/name/mlflow_svc" \
    -H "Authorization: Bearer {access_token}"

  # Get by name with fields
  curl "{base_url}/api/v1/services/mlmodelServices/name/mlflow_svc?fields=owners,tags,domains" \
    -H "Authorization: Bearer {access_token}"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "ca22d46e-81b9-4e48-85b5-0adc44980da9",
    "name": "mlflow_svc",
    "fullyQualifiedName": "mlflow_svc",
    "serviceType": "Mlflow",
    "version": 0.1,
    "updatedAt": 1769982621618,
    "updatedBy": "admin",
    "href": "http://localhost:8585/api/v1/services/mlmodelServices/ca22d46e-81b9-4e48-85b5-0adc44980da9",
    "connection": {
      "config": {
        "type": "Mlflow",
        "trackingUri": "http://localhost:8088",
        "registryUri": "http://localhost:8088",
        "supportsMetadataExtraction": true
      }
    },
    "owners": [],
    "tags": [],
    "deleted": false,
    "domains": []
  }
  ```
</ResponseExample>

***

## Returns

Returns an ML model service object with all requested fields populated.

## Response

<ResponseField name="id" type="string">
  Unique identifier for the ML model service (UUID format).
</ResponseField>

<ResponseField name="name" type="string">
  ML model service name.
</ResponseField>

<ResponseField name="fullyQualifiedName" type="string">
  Fully qualified name of the service.
</ResponseField>

<ResponseField name="displayName" type="string">
  Human-readable display name.
</ResponseField>

<ResponseField name="description" type="string">
  Description of the ML model service in Markdown format.
</ResponseField>

<ResponseField name="serviceType" type="string">
  Type of ML model service (e.g., Mlflow, Sklearn, SageMaker, CustomMlModel).
</ResponseField>

<ResponseField name="connection" type="object">
  Connection configuration for the service.

  <Expandable title="properties">
    <ResponseField name="config" type="object">
      Service-specific connection configuration.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="version" type="number">
  Version number for the entity.
</ResponseField>

<ResponseField name="owners" type="array" optional>
  List of owners. Only included when `fields` contains `owners`.
</ResponseField>

<ResponseField name="tags" type="array" optional>
  Classification tags. Only included when `fields` contains `tags`.
</ResponseField>

<ResponseField name="domains" type="array" optional>
  Domain assignments. Only included when `fields` contains `domains`.
</ResponseField>

***

## Error Handling

| Code  | Error Type     | Description                                          |
| ----- | -------------- | ---------------------------------------------------- |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token              |
| `403` | `FORBIDDEN`    | User lacks permission to view this ML model service  |
| `404` | `NOT_FOUND`    | ML model service with given ID or FQN does not exist |
