Skip to content

About

Give your app a choice of AI agents. TypeScript and Python SDKs for streaming, background jobs, batch processing and runtime control.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

455 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@cavi-ai/api-client

Give your users a choice of agent without rebuilding the app around each backend.

More agents. Less rewiring. One app. A choice of agents.

npm TypeScript SDK downloads per week PyPI Python SDK downloads per week License

Cavi API Client brings shared run, status and stream contracts to applications using multiple agent runtimes. Build your user experience around those contracts while adapters handle the backend's HTTP, SSE or WebSocket connection.

Keep the app. Add the runtime

Your application consumes run IDs, statuses, text, token usage and stream events. The client handles the provider-specific mapping.

  • One progress experience. Handle text, tool activity, approvals and terminal events through shared stream contracts.
  • Background work that stays identifiable. Retain run IDs for retrieval, bounded observation and explicit cancellation.
  • Batches you can collect. Correlate requests by customId and handle each item's result.
  • Features that match the backend. Consult capabilities before offering runtime-specific tools; unsupported operations return structured gaps.

Adapters cover Claude, Codex, AGY, OpenCode, Hermes and OpenClaw. Connect the runtimes and credentials your application uses; models, native tools and persistence stay with their providers. See provider compatibility.

What are you building?

Your application Use the client for
An assistant with a runtime selector Shared progress, tool activity, approvals and outcomes
A service that starts background jobs Run tracking, retrieval, bounded waits and cancellation
A batch processing pipeline Request correlation and per-item results
A gateway dashboard Available sessions, models, usage, tasks and workspace access

Start with your workflow

  1. Install the TypeScript or Python SDK.
  2. Configure the runtime you want to use.
  3. Follow the first-response guide, then add the workflow your application needs.

Keep credentials in your server configuration. Reuse a client within its credential/configuration scope and dispose of it when its owner shuts down.

Runs, streams and background jobs

  • Streaming: render progress and handle terminal events.
  • Background requests: retain run identity and bound local waits.
  • Owned background runs: authorize retrieval and explicit cancellation in your application.
  • Batches: submit work and collect per-item results.
  • Run results: turn completed work into a usable answer with completion helpers.
  • Errors: handle structured gaps and typed execution failures.
  • HTTP integration: expose the workflow through an application endpoint.

Prefer createApiClient for TypeScript applications. Its CapabilityClient returns CapabilityResult<T>. Adapter authors can use the raw RuntimeClient contract.

Project references

Migration · Changelog · Architecture · Contributing · Security

Full documentation · Documentation hosting contract

The npm package includes an offline documentation snapshot at docs/api-client/v<documented version>; see the consumer contract.

TypeScript and Python SDKs

TypeScript

npm install @cavi-ai/api-client

Node.js 20 or later. The package is ESM, includes TypeScript declarations and has no runtime dependencies. React integration is optional.

TypeScript quickstart · Provider setup

Python

pip install cavi-api-client

Python 3.11 or later. Import the native client from cavi_runtime. HTTPX handles native connections; WebSocket providers have their own optional dependency.

Python SDK guide · Runtime lifecycle and bounded polling

License

MIT

About

Give your app a choice of AI agents. TypeScript and Python SDKs for streaming, background jobs, batch processing and runtime control.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages