Replicate
Use Replicate's clients with the Platform. Every model, one generic API: create a prediction, wait with Prefer, read the result.
Base URL:
https://platform-api.invideo.io/replicateUse the owner invideo for Platform models:
invideo/<model id>.
import os, replicate
client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate")
output = client.run("invideo/nano-banana-2-1", input={"prompt": "A red fox in fresh snow"})
print(output)curl -X POST https://platform-api.invideo.io/replicate/v1/models/invideo/nano-banana-2-1/predictions \
-H "Authorization: Bearer $INVIDEO_API_KEY" \
-H "Prefer: wait=60" \
-H "Content-Type: application/json" \
-d '{"input": {"prompt": "A red fox in fresh snow"}}'inputis the model's own input object (seeGET /v1/models/{id});image_url,audio_urlandvideo_urlgo to the model's file input.Prefer: wait(orwait=N, 1 to 60 seconds) returns when the run ends. Without it the prediction isstarting; read it withGET /v1/predictions/{id}untilsucceededorfailed.outputis a link of ours (a list for several files). Links last one hour; read the prediction again for a fresh one.- Webhooks and cancelling are not supported yet.