Official Python SDK for the codai AI gateway — chat, streaming, agents, feedback, models.
Project description
codai-sdk — Python SDK
Official Python client for the codai AI gateway. Zero dependencies (stdlib only), Python 3.9+.
pip install codai-sdk
You need a codai API key. Get one at codai.ro. The import name stays
codai:
from codai import Codai
client = Codai(api_key="ck-...", session_id="my-project")
# Chat (OpenAI-compatible, smart-routed)
result = client.chat([{"role": "user", "content": "Explain asyncio.gather"}])
print(result.content)
print(result.routed_to) # which model actually served
# Streaming
for delta in client.chat_stream([{"role": "user", "content": "hi"}]):
print(delta, end="", flush=True)
# Server-side agent loop
run = client.agents_run("Find and summarize the TODOs in this codebase")
print(run.result)
# Feedback (improves routing for everyone)
client.feedback(result.request_id, 1)
codai extensions
| Option | Effect |
|---|---|
session_id |
Session memory + routing stickiness |
agent_mode=True |
Plan-and-execute loop (Pro+) |
compact="auto" |
Server-side context compaction |
best_of=0/3 |
Disable / force best-of-N ensembling |
MIT © codai
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codai_sdk-0.1.0.tar.gz.
File metadata
- Download URL: codai_sdk-0.1.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69392ae42f6746c0805e10df3157a2af653eaeb1a377cb79b7e76a82d42dfc30
|
|
| MD5 |
65b76b92e0b5c3a7f2c82bd390c15fc5
|
|
| BLAKE2b-256 |
b62576b91513d9aaf169a6144de858890ce8050653fd2ee06128a7962bdc63f4
|
Provenance
The following attestation bundles were made for codai_sdk-0.1.0.tar.gz:
Publisher:
publish.yml on dragoscv/codai-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codai_sdk-0.1.0.tar.gz -
Subject digest:
69392ae42f6746c0805e10df3157a2af653eaeb1a377cb79b7e76a82d42dfc30 - Sigstore transparency entry: 1920407669
- Sigstore integration time:
-
Permalink:
dragoscv/codai-sdk-python@842e42243ff359a3658fd542441109c7828d1e45 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dragoscv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@842e42243ff359a3658fd542441109c7828d1e45 -
Trigger Event:
push
-
Statement type:
File details
Details for the file codai_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: codai_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38aaf07c635be179114eada843cb62b2f247a3ba880724b8cdf9670b60641738
|
|
| MD5 |
d6ba3ec59713310cae0e7abed83af620
|
|
| BLAKE2b-256 |
8d20cf943eb3439458dcec5d2a88cf36cc960aa7a7e8294462ba789133bb78d0
|
Provenance
The following attestation bundles were made for codai_sdk-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on dragoscv/codai-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codai_sdk-0.1.0-py3-none-any.whl -
Subject digest:
38aaf07c635be179114eada843cb62b2f247a3ba880724b8cdf9670b60641738 - Sigstore transparency entry: 1920407751
- Sigstore integration time:
-
Permalink:
dragoscv/codai-sdk-python@842e42243ff359a3658fd542441109c7828d1e45 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dragoscv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@842e42243ff359a3658fd542441109c7828d1e45 -
Trigger Event:
push
-
Statement type: