The official Python SDK for AI Inference Control Plane — a provider-agnostic LLM gateway that lets you route, monitor, and control inference requests across OpenAI, Anthropic, Google, and more.
pip install aicpRequires Python 3.9+.
from aicp import AICPClient
client = AICPClient(
api_key="aicp-...",
base_url="https://your-aicp-gateway",
)
response = client.chat.complete(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response["choices"][0]["message"]["content"])for chunk in client.chat.stream(
model="claude-3-5-haiku-20241022",
messages=[{"role": "user", "content": "Tell me a story"}],
):
print(chunk, end="", flush=True)from aicp import AsyncAICPClient
async with AsyncAICPClient(api_key="aicp-...", base_url="https://your-aicp-gateway") as client:
response = await client.chat.complete(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello!"}],
)result = client.auth.login(email="you@example.com", password="...")
client.set_api_key(result["token"])Full SDK documentation: aicp.dev/docs
MIT