1

Prerequisites

You need an AgentRouter API key and the API base URL.

  • Create an API key with the Platform API type -- it is shown once, as <keyid>.<secret>. Copy it now.
  • Base URL https://api.tetrate.ai (or your tenant's). Set AGENTROUTER_API_KEY and optionally AGENTROUTER_BASE_URL in your environment.
2

Install

Download the Python SDK from the SDKs page, then install the sdist directly from the local file (no PyPI). Open the SDKs page

Install
pip install ./agentrouter-python-0.1.1.tar.gz
3

Your first call -- whoami

Resolve the identity behind your API key with a read-only GET /v1/me call. Copy the files below. Run with `python main.py`.

"""Runnable example for the AgentRouter Python SDK.

Set AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then run `python main.py`.
"""
import os

from agentrouter_sdk import Client

client = Client(
    base_url=os.environ["AGENTROUTER_BASE_URL"],
    api_key=os.environ["AGENTROUTER_API_KEY"],
)

# Replace the placeholder values below.
try:
    result = client.me.get()
    print(result)
except Exception as err:
    print("Error:", err)
# Point this at the directory you extracted the downloaded Python SDK tarball
# into. The directory name matches the tarball stem on the Download SDK page.
# To install instead from PyPI once published, replace the line below with:
#   agentrouter-sdk>=0.1.0
agentrouter-sdk @ file:./third_party/agentrouter-python-0.1.1

← All languages · Download SDKs · API reference