# OpenAPI Support

MLServer follows the Open Inference Protocol (previously known as the "V2 Protocol"). You can find the full OpenAPI spec for the Open Inference Protocol in the links below:

| Name                       | Description                                                                                          | OpenAPI Spec                                                                                 |
| -------------------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| Open Inference Protocol    | Main dataplane for inference, health and metadata                                                    | [dataplane.json](https://github.com/SeldonIO/mlserver/openapi/dataplane.json)                |
| Model Repository Extension | Extension to the protocol to provide a control plane which lets you load / unload models dynamically | [model\_repository.json](https://github.com/SeldonIO/mlserver/openapi/model_repository.json) |

## Swagger UI

On top of the OpenAPI spec above, MLServer also autogenerates a Swagger UI which can be used to interact dynamycally with the Open Inference Protocol.

The autogenerated Swagger UI can be accessed under the `/v2/docs` endpoint.

{% hint style="info" %}
Besides the Swagger UI, you can also access the *raw* OpenAPI spec through the `/v2/docs/dataplane.json` endpoint.
{% endhint %}

![](/files/uV7e3CeOF2e8YxAYw6p4)

## Model Swagger UI

Alongside the [general API documentation](#Swagger-UI), MLServer will also autogenerate a Swagger UI tailored to individual models, showing the endpoints available for each one.

The model-specific autogenerated Swagger UI can be accessed under the following endpoints:

* `/v2/models/{model_name}/docs`
* `/v2/models/{model_name}/versions/{model_version}/docs`

{% hint style="info" %}
Besides the Swagger UI, you can also access the model-specific *raw* OpenAPI spec through the following endpoints:

* `/v2/models/{model_name}/docs/dataplane.json`
* `/v2/models/{model_name}/versions/{model_version}/docs/dataplane.json`
  {% endhint %}

![](/files/kC0AFIjZ1qrhkGvBL5XM)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.seldon.ai/mlserver/user-guide/openapi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
