import urllib3
import os

chain_id = ""
deployment_id = ""

# Read secrets from environment variables

baseten_api_key = os.environ["BASETEN_API_KEY"]

resp = urllib3.request(
"POST",
f"https://chain
-{chain_id}.api.baseten.co/deployment/{deployment_id}/run_remote",
headers={"Authorization": f"Api-Key {baseten_api_key}"},
json={}, # JSON-serializable chain input
)

print(resp.json())

{}
Use this endpoint to call any deployment of your chain.
https://chain-{chain_id}.api.baseten.co/deployment/{deployment_id}/run_remote

Parameters

chain_id
string
required
The ID of the chain you want to call.
deployment_id
string
required
The ID of the specific deployment you want to call.
Authorization
string
required
Your Baseten API key, formatted with prefix Api-Key (e.g. {"Authorization": "Api-Key abcd1234.abcd1234"}).

Body

Chain input
json
required
JSON-serializable chain input. The input schema corresponds to the signature of the entrypoint’s run_remote method. I.e. The top-level keys are the argument names. The values are the corresponding JSON representation of the types.
import urllib3
import os

chain_id = ""
deployment_id = ""

# Read secrets from environment variables

baseten_api_key = os.environ["BASETEN_API_KEY"]

resp = urllib3.request(
"POST",
f"https://chain
-{chain_id}.api.baseten.co/deployment/{deployment_id}/run_remote",
headers={"Authorization": f"Api-Key {baseten_api_key}"},
json={}, # JSON-serializable chain input
)

print(resp.json())

{}