Replicate is a platform for building and running machine learning models.Replicate does not have a standarized JSON body format for their inference API, hence it is not possible to use unified API to interact with Replicate.
Portkey instead provides a proxy to Replicate, allowing you to manage auth on Portkey and log all Replicate requests.
To use Replicate with Portkey, get your Replicate API key from here, then add it to Portkey to create your Replicate virtual key.
Copy
Ask AI
import Portkey from 'portkey-ai'const portkey = new Portkey({ apiKey: "PORTKEY_API_KEY", // defaults to process.env["PORTKEY_API_KEY"] provider:"@PROVIDER" // Your Replicate Virtual Key})
from portkey_ai import Portkeyportkey = Portkey( api_key="PORTKEY_API_KEY", # Replace with your Portkey API key provider="@REPLICATE_PROVIDER",)response = portkey.post( url="predictions", # Replace with the endpoint you want to call)print(response)