Popular Model API
Number of APIs: 4
The Models REST API connects your application to Large Language Models (LLMs) through the Einstein Trust Layer. It let's you: - run AI prompts either as standalone or as part of conversations - create embeddings - provide feedback on the generated responses.
⚠️ Disclaimers:
this collection is not covered by Salesforce support and SLAs.
rate limits apply when using the API.
Setup
The Models API requires access to Einstein Generative AI on your Salesforce Org. If you don't have an Org with this feature, you can get an Einstein AI Playground org from Trailhead to experiment.
[Fork] this collection.
Follow Step 1 (yes, only step 1!) of these instructions to create a Connected App in your Salesforce Org.
Copy the Consumer Key and Consumer Secret values from your Connected App and paste them respectively in the
clientId
andclientSecret
collection variables.From Setup, go to
My Domain
, and then copy the value of Current My Domain URL into theauthDomain
collection variable.Optional: pick a model from the list of supported models, grab it's API name and save it in the
modelName
collection variable. If you don't enter a new value,sfdc_ai__DefaultGPT35Turbo
(GPT 3.5 Turbo) is used by default.Save your collection variables.
Open the Authorization tab of the Qodex collection and click Get New Access Token at the bottom of the screen.
Click Use Token.
Select the Generate text request and click Send it to ensure that the collection is properly set up.
Variables Reference
The collection relies on the following required variables:
Variable | Description |
---|---|
authDomain | Salesforce Org domain without https:// . See My Domain in Salesforce Setup for value. |
clientId | Connected App Consumer Key. |
clientSecret | Connected App Consumer Secret. |
modelName | API name of one of the supported Gen AI models. |
_baseUrl | The Models API base URL. Do not modify this value. |
-
Generate text POST {{_baseUrl}}/models/:modelName/generations
-
Generate chat POST {{_baseUrl}}/models/:modelName/chat-generations
-
Generate embeddings POST {{_baseUrl}}/models/:modelName/embeddings
-
Submit feedback POST {{_baseUrl}}/feedback