# Inference

## Model Inference

> An inference request is made with an HTTP POST to an inference endpoint. The model name and (optionally) version must be available in the URL. If a version is not provided the server may choose a version based on its own policies or return an error.

```json
{"openapi":"3.0.3","info":{"title":"Data Plane","version":"2.0"},"tags":[{"name":"inference"},{"name":"model"}],"paths":{"/v2/models/{model_name}/versions/{model_version}/infer":{"post":{"summary":"Model Inference","operationId":"model-version-inference","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceRequest"}}}},"description":"An inference request is made with an HTTP POST to an inference endpoint. The model name and (optionally) version must be available in the URL. If a version is not provided the server may choose a version based on its own policies or return an error.","tags":["inference","model"]}}},"components":{"schemas":{"InferenceResponse":{"title":"InferenceResponse","type":"object","properties":{"model_name":{"type":"string"},"model_version":{"type":"string"},"id":{"type":"string"},"parameters":{"$ref":"#/components/schemas/Parameters"},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/ResponseOutput"}}},"required":["model_name","outputs"]},"Parameters":{"type":"object","title":"Parameters","additionalProperties":true,"properties":{"content_type":{"type":"string"},"headers":{"type":"object"}}},"ResponseOutput":{"title":"ResponseOutput","type":"object","properties":{"name":{"type":"string"},"shape":{"type":"array","items":{"type":"integer"}},"datatype":{"type":"string"},"parameters":{"$ref":"#/components/schemas/Parameters"},"data":{"$ref":"#/components/schemas/TensorData"}},"required":["name","shape","datatype","data"]},"TensorData":{"title":"TensorData"},"InferenceErrorResponse":{"title":"InferenceErrorResponse","type":"object","properties":{"error":{"type":"string"}}},"InferenceRequest":{"title":"InferenceRequest","type":"object","properties":{"id":{"type":"string"},"parameters":{"$ref":"#/components/schemas/Parameters"},"inputs":{"type":"array","items":{"$ref":"#/components/schemas/RequestInput"}},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/RequestOutput"}}},"required":["inputs"]},"RequestInput":{"title":"RequestInput","type":"object","properties":{"name":{"type":"string"},"shape":{"type":"array","items":{"type":"integer"}},"datatype":{"type":"string"},"parameters":{"$ref":"#/components/schemas/Parameters"},"data":{"$ref":"#/components/schemas/TensorData"}},"required":["name","shape","datatype","data"]},"RequestOutput":{"title":"RequestOutput","type":"object","properties":{"name":{"type":"string"},"parameters":{"$ref":"#/components/schemas/Parameters"}},"required":["name"]}}}}
```

## Model Inference

> An inference request is made with an HTTP POST to an inference endpoint. The model name and (optionally) version must be available in the URL. If a version is not provided the server may choose a version based on its own policies or return an error.

```json
{"openapi":"3.0.3","info":{"title":"Data Plane","version":"2.0"},"tags":[{"name":"inference"},{"name":"model"}],"paths":{"/v2/models/{model_name}/infer":{"post":{"summary":"Model Inference","operationId":"model-inference","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceRequest"}}}},"description":"An inference request is made with an HTTP POST to an inference endpoint. The model name and (optionally) version must be available in the URL. If a version is not provided the server may choose a version based on its own policies or return an error.","tags":["inference","model"]}}},"components":{"schemas":{"InferenceResponse":{"title":"InferenceResponse","type":"object","properties":{"model_name":{"type":"string"},"model_version":{"type":"string"},"id":{"type":"string"},"parameters":{"$ref":"#/components/schemas/Parameters"},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/ResponseOutput"}}},"required":["model_name","outputs"]},"Parameters":{"type":"object","title":"Parameters","additionalProperties":true,"properties":{"content_type":{"type":"string"},"headers":{"type":"object"}}},"ResponseOutput":{"title":"ResponseOutput","type":"object","properties":{"name":{"type":"string"},"shape":{"type":"array","items":{"type":"integer"}},"datatype":{"type":"string"},"parameters":{"$ref":"#/components/schemas/Parameters"},"data":{"$ref":"#/components/schemas/TensorData"}},"required":["name","shape","datatype","data"]},"TensorData":{"title":"TensorData"},"InferenceErrorResponse":{"title":"InferenceErrorResponse","type":"object","properties":{"error":{"type":"string"}}},"InferenceRequest":{"title":"InferenceRequest","type":"object","properties":{"id":{"type":"string"},"parameters":{"$ref":"#/components/schemas/Parameters"},"inputs":{"type":"array","items":{"$ref":"#/components/schemas/RequestInput"}},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/RequestOutput"}}},"required":["inputs"]},"RequestInput":{"title":"RequestInput","type":"object","properties":{"name":{"type":"string"},"shape":{"type":"array","items":{"type":"integer"}},"datatype":{"type":"string"},"parameters":{"$ref":"#/components/schemas/Parameters"},"data":{"$ref":"#/components/schemas/TensorData"}},"required":["name","shape","datatype","data"]},"RequestOutput":{"title":"RequestOutput","type":"object","properties":{"name":{"type":"string"},"parameters":{"$ref":"#/components/schemas/Parameters"}},"required":["name"]}}}}
```


---

# 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/seldon-core-2/user-guide/v2/rest/inference.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.
