cavi-ai/
GitHub ↗

Providers and transports

Provider modules adapt upstream services to RuntimeClient; see provider selection. Standalone core/transport and core/transport/node subpaths are packed in v0.16.0, so transport factories can be imported directly from the published release rather than reached through a provider module.

This client mirrors and verifies upstream-compatible behavior. Upstream runtimes remain the canonical protocol owners.

Referenced examples

Verified example · TypeScript

Runtime registry

examples/runtime-registry.ts

@cavi-ai/api-clientv0.16.048214137
TypeScript · complete source
import { createRuntimeClient, createRuntimeProviderRegistry } from "@cavi-ai/api-client";
import { createClaudeProviderModule } from "@cavi-ai/api-client/providers/claude/messages";
import { createCodexProviderModule } from "@cavi-ai/api-client/providers/codex/runtime";

export function selectRuntime(provider: "claude" | "codex", apiKey: string) {
  const registry = createRuntimeProviderRegistry({
    modules: [createClaudeProviderModule({ apiKey }), createCodexProviderModule({ apiKey })],
  });
  return createRuntimeClient(provider, {
    registry,
    clientOptions: { baseUrl: provider === "claude" ? "https://api.anthropic.com" : "https://api.openai.com" },
  });
}

Package imports

Referenced by

Artifact provenance
Package
@cavi-ai/api-client@0.16.0
Release
v0.16.0
Commit
482141371d7fdb2dd38f7d6eaa5732aec669385a
Source
examples/runtime-registry.ts
Tarball SHA-256
f8ca0ce45d7bf563b1212c708668a5fe788967b8b7d5dbdc9e119e9e09d60167
Content SHA-256
274cf7e926de9581e270ef9bf6120666e7f0595ddf98b6378d7b9921fcff88d3