Python SDK

The official Python client for the inference API, installed with pip and generated from the OpenAPI spec.

For authentication, resources, errors and the other shared concepts, see all SDKs.

Install

Python, via pip (Python 3.9+):

pip install akumi

Quickstart

import os
from akumi import Akumi

client = Akumi.from_api_key(os.environ["AKUMI_API_KEY"])

response = client.chat.create(params={
    "model": "mistral/mistral-small-2603",
    "messages": [{"role": "user", "content": "Summarize this contract."}],
})

Python also ships an asynchronous client, AsyncAkumi, with the same methods behind await.

Streaming

Call client.chat.create_streamed(params={...}) for a streamed variant of the chat call that yields chunks as they arrive; AsyncAkumi exposes the same as an async iterator. Pass "stream": true in the request alongside it.

Source

The Python SDK lives in its own repository and is generated, not hand-written. When the API changes, it is regenerated from the spec.