> ## 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

**id** `string` *required*

UUID of the ML model service to retrieve.

**fields** `string`

Comma-separated list of fields to include, for example `owners,tags,domains`.

**include** `string` (default: non-deleted)

Include `all`, `deleted`, or `non-deleted` entities.

## Get by Fully Qualified Name

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

**fqn** `string` *required*

Fully qualified name of the ML model service, for example `mlflow_svc`.

**fields** `string`

Comma-separated list of fields to include: `owners`, `tags`, `domains`.

**include** `string` (default: non-deleted)

Include `all`, `deleted`, or `non-deleted` entities.

```python GET /v1/services/mlmodelServices/{id} theme={null}
from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import (
    AuthProvider,
    OpenMetadataConnection,
)
from metadata.generated.schema.security.client.openMetadataJWTClientConfig import (
    OpenMetadataJWTClientConfig,
)
from metadata.ingestion.ometa.ometa_api import OpenMetadata
from metadata.generated.schema.entity.services.mlmodelService import MlModelService

metadata = OpenMetadata(
    OpenMetadataConnection(
        hostPort="https://your-company.open-metadata.org/api",
        authProvider=AuthProvider.openmetadata,
        securityConfig=OpenMetadataJWTClientConfig(jwtToken="your-jwt-token"),
    )
)

# Get by ID
svc = metadata.get_by_id(entity=MlModelService, entity_id="ca22d46e-81b9-4e48-85b5-0adc44980da9")
print(f"{svc.fullyQualifiedName.root}: {svc.serviceType.value}")

# Get by ID with fields
svc = metadata.get_by_id(
    entity=MlModelService,
    entity_id="ca22d46e-81b9-4e48-85b5-0adc44980da9",
    fields=["owners", "tags"]
)

# Get by fully qualified name
svc = metadata.get_by_name(entity=MlModelService, fqn="mlflow_svc")

# Get by name with fields
svc = metadata.get_by_name(
    entity=MlModelService,
    fqn="mlflow_svc",
    fields=["owners", "tags", "domains"]
)
```

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

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

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

// Get by fully qualified name
MlModelService serviceByName = MlModelServices.retrieveByName("mlflow_svc");

// Get by name with fields
MlModelService serviceByNameWithFields = 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}"
```

```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": []
}
```

***

## Returns

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

## Response

**id** `string`

Unique identifier for the ML model service (UUID format).

**name** `string`

ML model service name.

**fullyQualifiedName** `string`

Fully qualified name of the service.

**displayName** `string`

Human-readable display name.

**description** `string`

Description of the ML model service in Markdown format.

**serviceType** `string`

Type of ML model service, for example Mlflow, Sklearn, SageMaker, CustomMlModel.

**connection** `object`

Connection configuration for the service.

**properties**

**config** `object`

Service-specific connection configuration.

**version** `number`

Version number for the entity.

**owners** `array`

List of owners. Only included when `fields` contains `owners`.

**tags** `array`

Classification tags. Only included when `fields` contains `tags`.

**domains** `array`

Domain assignments. Only included when `fields` contains `domains`.

***

## 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 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.