Required. The instances that are the input to the explanation call. A DeployedModel may have an upper limit on the number of instances it supports per request, and when it is exceeded the explanation call errors in case of AutoML Models, or, in case of customer created Models, the behaviour is as documented by that Model. The schema of any single instance may be specified via Endpoint's DeployedModels' Model'sPredictSchemata'sinstanceSchemaUri.
If specified, overrides the explanationSpec of the DeployedModel. Can be used for explaining prediction results with different configurations, such as: - Explaining top-5 predictions results as opposed to top-1; - Increasing path count or step count of the attribution methods to reduce approximate errors; - Using different baselines for explaining the prediction results.
deployedModelId
string
If specified, this ExplainRequest will be served by the chosen DeployedModel, overriding Endpoint.traffic_split.
Required. Overrides the input metadata of the features. The key is the name of the feature to be overridden. The keys specified here must exist in the input metadata to be overridden. If a feature is not specified here, the corresponding feature's input metadata is not overridden.
This overrides the input_baseline field of the ExplanationMetadata.InputMetadata object of the corresponding feature's input metadata. If it's not specified, the original baselines are not overridden.
JSON representation
{"inputBaselines": [value]}
ExamplesOverride
Overrides for example-based explanations.
Fields
neighborCount
integer
The number of neighbors to return.
crowdingCount
integer
The number of neighbors to return that have the same crowding tag.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-27 UTC."],[],[],null,["# Method: endpoints.explain\n\n**Full name**: projects.locations.endpoints.explain\n\nPerform an online explanation.\n\nIf [deployedModelId](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/explain#body.request_body.FIELDS.deployed_model_id) is specified, the corresponding endpoints.deployModel must have [explanationSpec](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints#DeployedModel.FIELDS.explanation_spec) populated. If [deployedModelId](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/explain#body.request_body.FIELDS.deployed_model_id) is not specified, all DeployedModels must have [explanationSpec](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints#DeployedModel.FIELDS.explanation_spec) populated. \n\n### Endpoint\n\npost `https:``/``/{service-endpoint}``/v1``/{endpoint}:explain` \nWhere `{service-endpoint}` is one of the [supported service endpoints](/vertex-ai/docs/reference/rest#rest_endpoints).\n\n### Path parameters\n\n`endpoint` `string` \nRequired. The name of the Endpoint requested to serve the explanation. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`\n\n### Request body\n\nThe request body contains data with the following structure:\nFields `instances[]` `value (`[Value](https://protobuf.dev/reference/protobuf/google.protobuf/#value)` format)` \nRequired. The instances that are the input to the explanation call. A DeployedModel may have an upper limit on the number of instances it supports per request, and when it is exceeded the explanation call errors in case of AutoML Models, or, in case of customer created Models, the behaviour is as documented by that Model. The schema of any single instance may be specified via Endpoint's DeployedModels' [Model's](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints#DeployedModel.FIELDS.model) [PredictSchemata's](/vertex-ai/docs/reference/rest/v1/projects.locations.models#Model.FIELDS.predict_schemata) [instanceSchemaUri](/vertex-ai/docs/reference/rest/v1/PredictSchemata#FIELDS.instance_schema_uri).\n`parameters` `value (`[Value](https://protobuf.dev/reference/protobuf/google.protobuf/#value)` format)` \nThe parameters that govern the prediction. The schema of the parameters may be specified via Endpoint's DeployedModels' [Model's](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints#DeployedModel.FIELDS.model) [PredictSchemata's](/vertex-ai/docs/reference/rest/v1/projects.locations.models#Model.FIELDS.predict_schemata) [parametersSchemaUri](/vertex-ai/docs/reference/rest/v1/PredictSchemata#FIELDS.parameters_schema_uri).\n`explanationSpecOverride` `object (`[ExplanationSpecOverride](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/explain#ExplanationSpecOverride)`)` \nIf specified, overrides the [explanationSpec](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints#DeployedModel.FIELDS.explanation_spec) of the DeployedModel. Can be used for explaining prediction results with different configurations, such as: - Explaining top-5 predictions results as opposed to top-1; - Increasing path count or step count of the attribution methods to reduce approximate errors; - Using different baselines for explaining the prediction results.\n`deployedModelId` `string` \nIf specified, this ExplainRequest will be served by the chosen DeployedModel, overriding [Endpoint.traffic_split](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints#Endpoint.FIELDS.traffic_split). \n\n### Response body\n\nResponse message for [PredictionService.Explain](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/explain#google.cloud.aiplatform.v1.PredictionService.Explain).\n\nIf successful, the response body contains data with the following structure:\nFields `explanations[]` `object (`[Explanation](/vertex-ai/docs/reference/rest/v1/Explanation)`)` \nThe explanations of the Model's [PredictResponse.predictions](/vertex-ai/docs/reference/rest/v1/PredictResponse#FIELDS.predictions).\n\nIt has the same number of elements as [instances](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/explain#body.request_body.FIELDS.instances) to be explained.\n`deployedModelId` `string` \nid of the Endpoint's DeployedModel that served this explanation.\n`predictions[]` `value (`[Value](https://protobuf.dev/reference/protobuf/google.protobuf/#value)` format)` \nThe predictions that are the output of the predictions call. Same as [PredictResponse.predictions](/vertex-ai/docs/reference/rest/v1/PredictResponse#FIELDS.predictions). \n\nExplanationSpecOverride\n-----------------------\n\nThe [ExplanationSpec](/vertex-ai/docs/reference/rest/v1/ExplanationSpec) entries that can be overridden at [online explanation](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/explain#google.cloud.aiplatform.v1.PredictionService.Explain) time.\nFields `parameters` `object (`[ExplanationParameters](/vertex-ai/docs/reference/rest/v1/ExplanationSpec#ExplanationParameters)`)` \nThe parameters to be overridden. Note that the attribution method cannot be changed. If not specified, no parameter is overridden.\n`metadata` `object (`[ExplanationMetadataOverride](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/explain#ExplanationMetadataOverride)`)` \nThe metadata to be overridden. If not specified, no metadata is overridden.\n`examplesOverride` `object (`[ExamplesOverride](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/explain#ExamplesOverride)`)` \nThe example-based explanations parameter overrides. \n\nExplanationMetadataOverride\n---------------------------\n\nThe [ExplanationMetadata](/vertex-ai/docs/reference/rest/v1/ExplanationSpec#ExplanationMetadata) entries that can be overridden at [online explanation](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/explain#google.cloud.aiplatform.v1.PredictionService.Explain) time.\nFields `inputs` `map (key: string, value: object (`[InputMetadataOverride](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/explain#InputMetadataOverride)`))` \nRequired. Overrides the [input metadata](/vertex-ai/docs/reference/rest/v1/ExplanationSpec#ExplanationMetadata.FIELDS.inputs) of the features. The key is the name of the feature to be overridden. The keys specified here must exist in the input metadata to be overridden. If a feature is not specified here, the corresponding feature's input metadata is not overridden. \n\nInputMetadataOverride\n---------------------\n\nThe [input metadata](/vertex-ai/docs/reference/rest/v1/ExplanationSpec#InputMetadata) entries to be overridden.\nFields `inputBaselines[]` `value (`[Value](https://protobuf.dev/reference/protobuf/google.protobuf/#value)` format)` \nbaseline inputs for this feature.\n\nThis overrides the `input_baseline` field of the [ExplanationMetadata.InputMetadata](/vertex-ai/docs/reference/rest/v1/ExplanationSpec#InputMetadata) object of the corresponding feature's input metadata. If it's not specified, the original baselines are not overridden. \n\nExamplesOverride\n----------------\n\nOverrides for example-based explanations.\nFields `neighborCount` `integer` \nThe number of neighbors to return.\n`crowdingCount` `integer` \nThe number of neighbors to return that have the same crowding tag.\n`restrictions[]` `object (`[ExamplesRestrictionsNamespace](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/explain#ExamplesRestrictionsNamespace)`)` \nRestrict the resulting nearest neighbors to respect these constraints.\n`returnEmbeddings` `boolean` \nIf true, return the embeddings instead of neighbors.\n`dataFormat` `enum (`[DataFormat](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/explain#DataFormat)`)` \nThe format of the data being provided with each call. \n\nExamplesRestrictionsNamespace\n-----------------------------\n\nRestrictions namespace for example-based explanations overrides.\nFields `namespaceName` `string` \nThe namespace name.\n`allow[]` `string` \nThe list of allowed tags.\n`deny[]` `string` \nThe list of deny tags. \n\nDataFormat\n----------\n\ndata format enum."]]