Skip to main content

Official Python SDK for the codai AI gateway — chat, streaming, agents, feedback, models.

Project description

codai-sdk — Python SDK

PyPI version Python versions license

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codai_sdk-0.1.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codai_sdk-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

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

Hashes for codai_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 69392ae42f6746c0805e10df3157a2af653eaeb1a377cb79b7e76a82d42dfc30
MD5 65b76b92e0b5c3a7f2c82bd390c15fc5
BLAKE2b-256 b62576b91513d9aaf169a6144de858890ce8050653fd2ee06128a7962bdc63f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for codai_sdk-0.1.0.tar.gz:

Publisher: publish.yml on dragoscv/codai-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for codai_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38aaf07c635be179114eada843cb62b2f247a3ba880724b8cdf9670b60641738
MD5 d6ba3ec59713310cae0e7abed83af620
BLAKE2b-256 8d20cf943eb3439458dcec5d2a88cf36cc960aa7a7e8294462ba789133bb78d0

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page