Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

AICP Python SDK

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.

Installation

pip install aicp

Requires Python 3.9+.

Quick start

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"])

Streaming

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)

Async client

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!"}],
    )

Authentication

result = client.auth.login(email="you@example.com", password="...")
client.set_api_key(result["token"])

Documentation

Full SDK documentation: aicp.dev/docs

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages