SAP Business Technology Platform Metrics API
Access metrics of training runs
Access metrics of training runs
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/sap-btp:sap-btp-metrics-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Sap Btp Metrics API
version: 2.42.0
description: 'Operations tagged Metrics across 2 of this provider''s published API definitions: ai-core.yaml, sap-btp-ai-core-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.ai.{region}.ml.hana.ondemand.com/v2
description: Production endpoint for SAP AI Core
variables:
region:
enum:
- prod.eu-central-1.aws
- prodeuonly.eu-central-1.aws
- prod.us-east-1.aws
- prod.ap-northeast-1.aws
- prod-ap11.ap-southeast-1.aws
- prod-ap20.australiaeast.azure
- prod.ap-southeast-2.aws
- prod-eu20.westeurope.azure
- prod-ap30.australia-southeast1.gcp
- prod-in30.asia-south1.gcp
- prod-sa30.me-central2.gcp
- prod-us21.eastus.azure
- prod-eu30.europe-west3.gcp
- prod-us30.us-central1.gcp
- prod-br10.sa-east-1.aws
default: prod.eu-central-1.aws
security:
- Oauth2: []
tags:
- name: Metrics
description: Access metrics of training runs
paths:
/lm/metrics:
get:
summary: Get metrics according to specified filter conditions
description: 'Retrieve metrics, labels, or tags according to filter conditions.
One query parameter is mandatory, either execution ID or filter.
Use up to 10 execution IDs in a query parameter.
With top/skip parameters it is possible to paginate the result list.'
tags:
- Metrics
parameters:
- $ref: '#/components/parameters/TrcktrackingResourceGroupHeader'
- $ref: '#/components/parameters/TrckqueryFilter'
- $ref: '#/components/parameters/TrckexecutionIds'
- $ref: '#/components/parameters/TrckmetricAttributeSelector'
- $ref: '#/components/parameters/TrcktagFilters'
- $ref: '#/components/parameters/Trcktop'
- $ref: '#/components/parameters/Trckskip'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/TrckGetMetricResourceList'
description: List of tracking metadata, where each item includes metrics, labels, tags and customInfo. If $select query parameter is specified, each item will include only the resources specified in $select.
'400':
$ref: '#/components/responses/TrckBadRequest'
'501':
$ref: '#/components/responses/TrckNotImplemented'
operationId: metrics.find
patch:
summary: Create or update metrics, tags, or labels
description: Update or create metrics, tags, or labels associated with an execution.
parameters:
- $ref: '#/components/parameters/TrcktrackingResourceGroupHeader'
requestBody:
content:
application/merge-patch+json:
schema:
$ref: '#/components/schemas/TrckMetricResource'
required: true
tags:
- Metrics
responses:
'204':
description: Metrics was successfully updated/created
'400':
$ref: '#/components/responses/TrckBadRequest'
'413':
$ref: '#/components/responses/TrckPayloadTooLarge'
operationId: metrics.patch
delete:
summary: Delete metrics, tags, or labels
description: Delete metrics, tags, or labels associated with an execution.
parameters:
- $ref: '#/components/parameters/TrcktrackingResourceGroupHeader'
- $ref: '#/components/parameters/TrckexecutionId'
tags:
- Metrics
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/TrckDeleteMetricsResponse'
description: Metric Resource was successfully deleted
'404':
$ref: '#/components/responses/TrckNotFound'
operationId: metrics.delete
servers:
- url: https://api.ai.{region}.ml.hana.ondemand.com/v2
description: Production endpoint for SAP AI Core
variables:
region:
enum:
- prod.eu-central-1.aws
- prodeuonly.eu-central-1.aws
- prod.us-east-1.aws
- prod.ap-northeast-1.aws
- prod-ap11.ap-southeast-1.aws
- prod-ap20.australiaeast.azure
- prod.ap-southeast-2.aws
- prod-eu20.westeurope.azure
- prod-ap30.australia-southeast1.gcp
- prod-in30.asia-south1.gcp
- prod-sa30.me-central2.gcp
- prod-us21.eastus.azure
- prod-eu30.europe-west3.gcp
- prod-us30.us-central1.gcp
- prod-br10.sa-east-1.aws
default: prod.eu-central-1.aws
components:
schemas:
TrckTag:
description: A dictionary of name-value pairs to support segregation at execution level.
required:
- name
- value
type: object
properties:
name:
oneOf:
- $ref: '#/components/schemas/TrckGenericName'
value:
description: tag value
maxLength: 256
minLength: 1
type: string
example: RFC-1
example:
name: Artifact Group
value: RFC-1
TrckMetricList:
description: Array of Metric items
type: array
items:
$ref: '#/components/schemas/TrckMetric'
TrckLabelList:
description: a list of name-value object pairs associated with some metric.
type: array
items:
$ref: '#/components/schemas/TrckLabel'
example:
- name: group
value: tree-82
- name: metrics.ai.sap.com/Artifact.name
value: sk_learn_rf_classifier_model
TrckmetricSelectorPermissibleValues:
description: Permissible value for $select could be either * or one or many of the values from metrics, tags, custominfo
type: array
items:
type: string
enum:
- metrics
- tags
- customInfo
- '*'
TrckCustomInfoObjectData:
description: Message
minLength: 1
type: string
example: "[{'Predicted': 'False',\t'Actual': 'False','value': 34},{'Predicted': 'False','Actual': 'True',\t'value': 124}, {'Predicted': 'True','Actual': 'False','value': 165},{\t'Predicted': 'True','Actual': 'True','value': 36}]"
TrckLabel:
description: a classifying phrase/name applied to a metric
required:
- name
- value
type: object
properties:
name:
$ref: '#/components/schemas/TrckLabelName'
value:
description: Metric Label Value
maxLength: 256
minLength: 1
type: string
example: sk_learn_random_forest_model
example:
name: group
value: tree-82
TrckCustomInfoObject:
description: large object which provides rendering/semantic information regarding certain metric for consuming application or can be complex metrics in JSON format
required:
- name
- value
type: object
properties:
name:
oneOf:
- $ref: '#/components/schemas/TrckGenericName'
value:
$ref: '#/components/schemas/TrckCustomInfoObjectData'
example:
name: Confusion Matrix
value: '[{''Predicted'': ''False'', ''Actual'': ''False'',''value'': 34},{''Predicted'': ''False'',''Actual'': ''True'', ''value'': 124}, {''Predicted'': ''True'',''Actual'': ''False'',''value'': 165},{ ''Predicted'': ''True'',''Actual'': ''True'',''value'': 36}]'
TrckGetMetricList:
description: Array of Metric items
type: array
items:
$ref: '#/components/schemas/TrckGetMetric'
TrckDetailsErrorResponse:
type: object
properties:
code:
description: Descriptive error code (not http status code)
type: string
message:
description: Plaintext error description
type: string
TrckLabelName:
description: Label name to label one or more metrics. "metrics.ai.sap.com/Artifact.name" is a reserved label to associate an artifact with the metrics
maxLength: 256
minLength: 1
type: string
example: metrics.ai.sap.com/Artifact.name
TrckGetMetricResourceList:
type: object
required:
- resources
properties:
count:
type: integer
description: Number of the resource instances in the list
resources:
type: array
items:
$ref: '#/components/schemas/TrckGetMetricResource'
TrckMlapiExecutionId:
description: Generic ID
pattern: ^[\w.-]{4,64}$
type: string
example: aa97b177-9383-4934-8543-0f91b7a0283a
TrckExecutionId:
type: string
example: aa97b177-9383-4934-8543-0f91b7a0283a
oneOf:
- $ref: '#/components/schemas/TrckMlapiExecutionId'
description: ID of the deployment/execution
TrckCustomInfoObjectList:
description: ''
type: array
items:
$ref: '#/components/schemas/TrckCustomInfoObject'
TrckMetricResource:
description: Collection of various metrics/tags/labels associated against some execution/deployment
required:
- executionId
type: object
properties:
executionId:
$ref: '#/components/schemas/TrckExecutionId'
createdAt:
$ref: '#/components/schemas/TrckTimestamp'
modifiedAt:
$ref: '#/components/schemas/TrckTimestamp'
metrics:
$ref: '#/components/schemas/TrckMetricList'
tags:
$ref: '#/components/schemas/TrckTagList'
customInfo:
$ref: '#/components/schemas/TrckCustomInfoObjectList'
TrckGetMetricResource:
description: Collection of various metrics/tags/labels associated against some execution/deployment
type: object
properties:
executionId:
$ref: '#/components/schemas/TrckExecutionId'
createdAt:
$ref: '#/components/schemas/TrckTimestamp'
modifiedAt:
$ref: '#/components/schemas/TrckTimestamp'
metrics:
$ref: '#/components/schemas/TrckGetMetricList'
tags:
$ref: '#/components/schemas/TrckTagList'
customInfo:
$ref: '#/components/schemas/TrckCustomInfoObjectList'
required:
- executionId
TrckTimestamp:
type: string
description: Time when the metric was created or logged in RFC3339 format
format: date-time
TrckMetricValue:
type: number
description: Numeric Value of the metric
example: 0.98
TrckTagList:
description: a list of name-value object pairs associated with the execution/deployment. Tags are queryable.
type: array
items:
$ref: '#/components/schemas/TrckTag'
TrckApiError:
required:
- code
- message
type: object
properties:
code:
description: Descriptive error code (not http status code).
type: string
message:
description: plaintext error description
type: string
requestId:
description: id of individual request
type: string
target:
description: url that has been called
type: string
details:
type: array
items:
$ref: '#/components/schemas/TrckDetailsErrorResponse'
TrckDeleteMetricsResponse:
type: object
properties:
id:
$ref: '#/components/schemas/TrckExecutionId'
message:
type: string
example: Metric Resource was successfully deleted
TrckGenericName:
description: Generic name which can belong to a tag,label,metric or customInfo Object
maxLength: 256
minLength: 1
type: string
example: sample name
TrckMetric:
description: Key-value metrics, where the value is numeric. Metric can also have optional step and label fields.
required:
- name
- value
type: object
properties:
name:
$ref: '#/components/schemas/TrckMetricName'
value:
$ref: '#/components/schemas/TrckMetricValue'
timestamp:
$ref: '#/components/schemas/TrckTimestamp'
step:
description: step is an optional integer that represents any measurement of training progress (number of training iterations, number of epochs, and so on) for the metric
type: integer
minimum: 0
example: 2
labels:
$ref: '#/components/schemas/TrckLabelList'
TrckGetMetric:
description: Key-value metrics, where the value is numeric. Metric can also have optional step and label fields.
type: object
required:
- name
- value
- timestamp
properties:
name:
$ref: '#/components/schemas/TrckMetricName'
value:
$ref: '#/components/schemas/TrckMetricValue'
timestamp:
$ref: '#/components/schemas/TrckTimestamp'
step:
description: step is an optional integer that represents any measurement of training progress (number of training iterations, number of epochs, and so on) for the metric
type: integer
minimum: 0
example: 2
labels:
$ref: '#/components/schemas/TrckLabelList'
TrckStringArray:
type: array
example:
- value1
- value2
items:
type: string
TrckMetricName:
pattern: '[\w-]{1,64}'
type: string
maxLength: 256
description: Name of the metric
example: Error Rate
parameters:
TrckqueryFilter:
example: executionId eq 'aa97b177-9383-4934-8543-0f91b7a0283a'
name: $filter
description: Filter parameter allows filtering of metric resource using ExecutionId(s). User can only use in, eq operators in filter expression.
schema:
type: string
in: query
required: false
deprecated: true
Trckskip:
name: $skip
description: Number of results to be skipped from the ordered list of results
in: query
required: false
schema:
type: integer
example: 10
x-visible: false
TrcktrackingResourceGroupHeader:
name: AI-Resource-Group
description: Specify a resource group id
in: header
schema:
type: string
required: true
TrckexecutionIds:
example: executionIds=aa97b177-9383-4934-8543-0f91b7a0283a,aa97b177-9383-4934-8543-0f91b7a0283b
name: executionIds
description: executionIds parameter allows filtering of metric resource using single or multiple ExecutionId(s).
schema:
$ref: '#/components/schemas/TrckStringArray'
in: query
style: form
required: false
explode: false
TrcktagFilters:
example: name1=value1,name2!=value2,name3,name4=v%26a%3D%2Cl%23u%21%3De%5E2%25
name: tagFilters
description: Filter metrics using tags by providing expressions in the format name=value or name!=value, separated by commas (,). The results will include only those metrics that match all the specified tag expressions, ensuring a logical AND operation. The filter supports up to 100 tag expressions, key-only searches (e.g., name) without a value, and tags containing special characters, which must be properly percent-encoded for accurate matching.
schema:
type: string
maxLength: 5000
in: query
style: form
required: false
explode: false
TrckmetricAttributeSelector:
examples:
selectAll:
value: $select=*
selectSpecific:
value: $select=metrics,customInfo
name: $select
description: returns only the resources that the client explicitly requests. User can also pass * as a value for $select, which will behave same as that of not passing $select query param.
schema:
$ref: '#/components/schemas/TrckmetricSelectorPermissibleValues'
in: query
style: form
required: false
explode: false
Trcktop:
name: $top
description: Number of results to display
in: query
required: false
schema:
type: integer
maximum: 10000
default: 1000
example: 10
x-visible: false
TrckexecutionId:
name: executionId
description: The Id of an execution
schema:
$ref: '#/components/schemas/TrckExecutionId'
in: query
required: true
responses:
TrckNotImplemented:
content:
application/json:
schema:
type: object
properties:
error:
$ref: '#/components/schemas/TrckApiError'
description: Operation is not Supported.
TrckBadRequest:
content:
application/json:
schema:
type: object
properties:
error:
$ref: '#/components/schemas/TrckApiError'
description: The specification of the resource was incorrect
TrckNotFound:
description: The specified resource was not found
content:
application/json:
schema:
type: object
properties:
error:
$ref: '#/components/schemas/TrckApiError'
TrckPayloadTooLarge:
content:
application/json:
schema:
type: object
properties:
error:
$ref: '#/components/schemas/TrckApiError'
description: request entity is larger than limits defined by server.
securitySchemes:
Oauth2:
type: oauth2
description: OAuth client credentials (client ID and secret) are required. These can be requested from SAP BTP cloud cockpit.
flows:
clientCredentials:
tokenUrl: https://{subdomain_identity_zone}.authentication.{host}/oauth/token
scopes: {}
externalDocs:
description: Documentation for SAP AI Core
url: https://help.sap.com/docs/AI_CORE?version=CLOUD
x-refined-from:
- ai-core.yaml
- sap-btp-ai-core-openapi.yml
x-sap-shortText: Create and manage AI scenarios, trainings, deployments, and artifacts in SAP AI Core.