Salesforce Einstein Models API

Manage Einstein Discovery prediction models

Operations 11

GET /wave/models Salesforce Einstein List prediction models #
GET /wave/models/{modelId} Salesforce Einstein Get a prediction model #
DELETE /wave/models/{modelId} Salesforce Einstein Delete a prediction model #
GET /einstein/llm/models Salesforce Einstein List available models #
GET /einstein/llm/models/{modelId} Salesforce Einstein Get model details #
GET /datasets/{datasetId}/models Salesforce Einstein List models for a dataset #
POST /train Salesforce Einstein Train a model #
POST /retrain Salesforce Einstein Retrain a model #
GET /models/{modelId} Salesforce Einstein Get model details #
DELETE /models/{modelId} Salesforce Einstein Delete a model #
GET /models/{modelId}/lc Salesforce Einstein Get model learning curve #

Documentation

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • 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.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/salesforce-einstein-models-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API 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. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

salesforce-einstein-models-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Salesforce Einstein Models API
  contact:
    name: Salesforce Developer Support
    url: https://developer.salesforce.com/
  license:
    name: Salesforce Master Subscription Agreement
    url: https://www.salesforce.com/company/legal/agreements/
  termsOfService: https://www.salesforce.com/company/legal/agreements/
  version: '1.0'
  description: 'Operations tagged Models across 4 of this provider''s published API definitions: salesforce-einstein-discovery-openapi.yml, salesforce-einstein-gpt-openapi.yml, salesforce-einstein-language-openapi.yml, salesforce-einstein-vision-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://{instance}.salesforce.com/services/data/v58.0
  description: Salesforce Instance
  variables:
    instance:
      default: login
      description: Your Salesforce instance domain.
- url: https://api.einstein.ai/v2/language
  description: Einstein Language Production Server
- url: https://api.einstein.ai/v2/vision
  description: Einstein Vision Production Server
tags:
- name: Models
  description: Manage Einstein Discovery prediction models
paths:
  /wave/models:
    get:
      operationId: listModels
      summary: Salesforce Einstein List prediction models
      description: Returns a list of Einstein Discovery prediction models.
      tags:
      - Models
      parameters:
      - name: pageSize
        in: query
        schema:
          type: integer
          default: 25
      - name: page
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Successful response with models list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelCollection'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
      - oauth2: []
    servers:
    - url: https://{instance}.salesforce.com/services/data/v58.0
      description: Salesforce Instance
      variables:
        instance:
          default: login
          description: Your Salesforce instance domain.
  /wave/models/{modelId}:
    get:
      operationId: getModel
      summary: Salesforce Einstein Get a prediction model
      description: Returns details of a specific prediction model.
      tags:
      - Models
      parameters:
      - $ref: '#/components/parameters/ModelId'
      responses:
        '200':
          description: Successful response with model details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscoveryModel'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
      - oauth2: []
    delete:
      operationId: deleteModel
      summary: Salesforce Einstein Delete a prediction model
      description: Deletes an Einstein Discovery prediction model.
      tags:
      - Models
      parameters:
      - $ref: '#/components/parameters/ModelId'
      responses:
        '204':
          description: Model deleted successfully.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
      - oauth2: []
    servers:
    - url: https://{instance}.salesforce.com/services/data/v58.0
      description: Salesforce Instance
      variables:
        instance:
          default: login
          description: Your Salesforce instance domain.
  /einstein/llm/models:
    get:
      operationId: listModels
      summary: Salesforce Einstein List available models
      description: Returns a list of available generative AI models that can be used for content generation.
      tags:
      - Models
      responses:
        '200':
          description: Successful response with available models.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelCollection_2'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
      - oauth2: []
    servers:
    - url: https://{instance}.salesforce.com/services/data/v58.0
      description: Salesforce Instance
      variables:
        instance:
          default: login
          description: Your Salesforce instance domain.
  /einstein/llm/models/{modelId}:
    get:
      operationId: getModel
      summary: Salesforce Einstein Get model details
      description: Returns details of a specific generative AI model.
      tags:
      - Models
      parameters:
      - $ref: '#/components/parameters/ModelId_2'
      responses:
        '200':
          description: Successful response with model details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerativeModel'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
      - oauth2: []
    servers:
    - url: https://{instance}.salesforce.com/services/data/v58.0
      description: Salesforce Instance
      variables:
        instance:
          default: login
          description: Your Salesforce instance domain.
  /datasets/{datasetId}/models:
    get:
      operationId: listModelsForDataset
      summary: Salesforce Einstein List models for a dataset
      description: Returns all models trained on the specified dataset.
      tags:
      - Models
      parameters:
      - $ref: '#/components/parameters/DatasetId'
      responses:
        '200':
          description: Successful response with models list.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Model'
        '401':
          $ref: '#/components/responses/Unauthorized_2'
      security:
      - bearerAuth: []
    servers:
    - url: https://api.einstein.ai/v2/language
      description: Einstein Language Production Server
  /train:
    post:
      operationId: trainModel
      summary: Salesforce Einstein Train a model
      description: Trains a text classification model on a dataset. Training is asynchronous.
      tags:
      - Models
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name for the trained model.
                datasetId:
                  type: integer
                  description: ID of the dataset to train on.
                trainParams:
                  type: string
                  description: JSON string of optional training parameters.
                epochs:
                  type: integer
                  description: Number of training epochs.
                learningRate:
                  type: number
                  description: Learning rate for training.
              required:
              - name
              - datasetId
      responses:
        '200':
          description: Training job started successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized_2'
      security:
      - bearerAuth: []
    servers:
    - url: https://api.einstein.ai/v2/language
      description: Einstein Language Production Server
  /retrain:
    post:
      operationId: retrainModel
      summary: Salesforce Einstein Retrain a model
      description: Retrains an existing model with additional data.
      tags:
      - Models
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                modelId:
                  type: string
                  description: ID of the model to retrain.
                epochs:
                  type: integer
                learningRate:
                  type: number
              required:
              - modelId
      responses:
        '200':
          description: Retraining job started successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized_2'
      security:
      - bearerAuth: []
    servers:
    - url: https://api.einstein.ai/v2/language
      description: Einstein Language Production Server
  /models/{modelId}:
    get:
      operationId: getModel
      summary: Salesforce Einstein Get model details
      description: Returns the details and metrics of a trained model.
      tags:
      - Models
      parameters:
      - $ref: '#/components/parameters/ModelId'
      responses:
        '200':
          description: Successful response with model details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Model'
        '401':
          $ref: '#/components/responses/Unauthorized_2'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
      - bearerAuth: []
    delete:
      operationId: deleteModel
      summary: Salesforce Einstein Delete a model
      description: Deletes a trained model.
      tags:
      - Models
      parameters:
      - $ref: '#/components/parameters/ModelId'
      responses:
        '200':
          description: Model deleted successfully.
        '401':
          $ref: '#/components/responses/Unauthorized_2'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
      - bearerAuth: []
    servers:
    - url: https://api.einstein.ai/v2/language
      description: Einstein Language Production Server
  /models/{modelId}/lc:
    get:
      operationId: getModelLearningCurve
      summary: Salesforce Einstein Get model learning curve
      description: Returns the learning curve data for a trained model.
      tags:
      - Models
      parameters:
      - $ref: '#/components/parameters/ModelId'
      responses:
        '200':
          description: Successful response with learning curve.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LearningCurve'
        '401':
          $ref: '#/components/responses/Unauthorized_3'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
      - bearerAuth: []
    servers:
    - url: https://api.einstein.ai/v2/vision
      description: Einstein Vision Production Server
components:
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
        errorCode:
          type: string
        fields:
          type: array
          items:
            type: string
    ModelCollection:
      type: object
      properties:
        models:
          type: array
          items:
            $ref: '#/components/schemas/DiscoveryModel'
        totalSize:
          type: integer
        nextPageUrl:
          type: string
    DiscoveryModel:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        label:
          type: string
        status:
          type: string
          enum:
          - Active
          - Inactive
          - Training
          - Failed
        storyId:
          type: string
        algorithmType:
          type: string
        predictionType:
          type: string
        createdDate:
          type: string
          format: date-time
        lastModifiedDate:
          type: string
          format: date-time
        url:
          type: string
          format: uri
    GenerativeModel:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        label:
          type: string
        provider:
          type: string
          description: Model provider name.
        modelType:
          type: string
          enum:
          - gpt-4
          - gpt-3.5-turbo
          - claude
          - custom
          description: Type of the model.
        capabilities:
          type: array
          items:
            type: string
          description: Capabilities supported by the model.
        status:
          type: string
          enum:
          - Active
          - Inactive
    ModelCollection_2:
      type: object
      properties:
        models:
          type: array
          items:
            $ref: '#/components/schemas/GenerativeModel'
        totalSize:
          type: integer
    Error_2:
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message.
        errorCode:
          type: string
          description: Machine-readable error code.
    Model:
      type: object
      properties:
        modelId:
          type: string
        name:
          type: string
        datasetId:
          type: integer
        datasetVersionId:
          type: integer
        status:
          type: string
          enum:
          - QUEUED
          - RUNNING
          - SUCCEEDED
          - FAILED
          - DELETED
        progress:
          type: number
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        learningRate:
          type: number
        epochs:
          type: integer
        object:
          type: string
        modelType:
          type: string
        failureMsg:
          type: string
    TrainResponse:
      type: object
      properties:
        modelId:
          type: string
        datasetId:
          type: integer
        datasetVersionId:
          type: integer
        name:
          type: string
        status:
          type: string
        progress:
          type: number
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        epochs:
          type: integer
        learningRate:
          type: number
        object:
          type: string
    Error_3:
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message.
        errorCode:
          type: string
          description: Machine-readable error code.
    Model_2:
      type: object
      properties:
        modelId:
          type: string
          description: Unique model identifier.
        name:
          type: string
          description: Model name.
        datasetId:
          type: integer
          description: Dataset the model was trained on.
        datasetVersionId:
          type: integer
          description: Version of the dataset used.
        status:
          type: string
          enum:
          - QUEUED
          - RUNNING
          - SUCCEEDED
          - FAILED
          - DELETED
          description: Current status of the model.
        progress:
          type: number
          description: Training progress (0.0 to 1.0).
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the model was created.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the model was last updated.
        learningRate:
          type: number
          description: Learning rate used for training.
        epochs:
          type: integer
          description: Number of training epochs.
        object:
          type: string
        modelType:
          type: string
          description: Type of model.
        failureMsg:
          type: string
          description: Failure message if training failed.
    TrainResponse_2:
      type: object
      properties:
        modelId:
          type: string
          description: ID of the model being trained.
        datasetId:
          type: integer
        datasetVersionId:
          type: integer
        name:
          type: string
        status:
          type: string
        progress:
          type: number
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        epochs:
          type: integer
        learningRate:
          type: number
        object:
          type: string
    LearningCurve:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              epoch:
                type: integer
              metricsData:
                type: object
                properties:
                  f1:
                    type: array
                    items:
                      type: number
                  testAccuracy:
                    type: array
                    items:
                      type: number
                  trainingLoss:
                    type: array
                    items:
                      type: number
        object:
          type: string
  parameters:
    ModelId:
      name: modelId
      in: path
      required: true
      description: Unique identifier for the model.
      schema:
        type: string
    ModelId_2:
      name: modelId
      in: path
      required: true
      description: Unique identifier for the generative AI model.
      schema:
        type: string
    DatasetId:
      name: datasetId
      in: path
      required: true
      description: Unique identifier for the dataset.
      schema:
        type: integer
  responses:
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Bad request. Invalid parameters or missing required fields.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_2'
    Unauthorized_2:
      description: Unauthorized. Invalid or missing bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_2'
    BadRequest_2:
      description: Bad request. Invalid parameters or missing required fields.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_3'
    Unauthorized_3:
      description: Unauthorized. Invalid or missing bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_3'
  securitySchemes:
    oauth2:
      type: oauth2
      description: Salesforce OAuth 2.0 authentication.
      flows:
        authorizationCode:
          authorizationUrl: https://login.salesforce.com/services/oauth2/authorize
          tokenUrl: https://login.salesforce.com/services/oauth2/token
          scopes:
            api: Full access to Salesforce APIs
            wave_api: Access to Analytics APIs
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth 2.0 Bearer token. Generate a token using your Einstein Platform Services private key.
x-refined-from:
- salesforce-einstein-discovery-openapi.yml
- salesforce-einstein-gpt-openapi.yml
- salesforce-einstein-language-openapi.yml
- salesforce-einstein-vision-openapi.yml