/v1/chat/completions endpoint works with it directly. You don’t need middleware.
With Portkey in between, Salesforce can use any model in your Model Catalog, and every request shows up in Portkey logs with cost, latency and token counts.
Prerequisites
- Portkey API key
- Provider configured in Model Catalog
- Salesforce org with Data Cloud and Einstein generative AI enabled, and permission to use Model Builder
Setup
1
Configure Portkey
- Go to Model Catalog → Add Provider.
- Select your provider (OpenAI, Anthropic, Bedrock, etc.), enter its credentials, and set a slug like
openai-prod. - Go to API Keys → Create new key → Save.
@<provider-slug>/<model>, for example @openai-prod/gpt-5.2
Test the endpoint
Salesforce sends a request like this one. Run it first to confirm the key and model work:
3
Add Portkey as a foundation model
- In Salesforce, open Einstein Studio (in the Data Cloud app) and go to Model Builder.
- Click Add Foundation Model, then choose to connect your own LLM with the LLM Open Connector.
- Fill in the connection:
- Save the connection.
Salesforce sends one auth header and nothing else, so you can’t add other
x-portkey-* headers here. To route or add fallbacks, attach a default config to the API key (see below).4
Create a configured model
- Select the new model in the Model Library and click New Configuration.
- Send a prompt in the Model Playground.
- Check that the request appears in Portkey Logs.
- Save the configuration.
Use the model in Salesforce
Once saved, the configured model is available wherever Salesforce lets you pick a generative model:- Prompt Builder: select it as the model for a prompt template.
- Agentforce: add a prompt template that uses the model to an agent as an action.
- Models API: call it by its API name from Apex or REST. Find the API name on the configured model’s detail page.
The LLM Open Connector supports text chat only. It doesn’t send tool definitions, images or streaming requests. Use the Portkey model for prompt templates and Models API calls, not for features that need tool calling.
Add fallbacks and routing
Salesforce can’t sendx-portkey-config, so attach a default config to the API key you entered in Model Builder. Every request from Salesforce then uses that config.
Example: try OpenAI first, fall back to Anthropic on errors:
- Create the config in Configs and copy its ID.
- Go to API Keys, edit the key Salesforce uses, and select the config.
override_params rewrites the model in each request, so the Model Name in Salesforce becomes a label. Keep it in @slug/model form anyway so the connection still works if the config is removed.
To cap spend or rate for Salesforce traffic, set budget and rate limits on the provider in Model Catalog, or give Salesforce its own provider slug.
Troubleshooting
Resources
- LLM Open Connector API specification
- LLM Open Connector FAQ
- Bring Your Own Large Language Model in Einstein 1 Studio
Portkey is now PRISMA AIRS AI Gateway. See it in action.
Contact Us

