Skip to content
ZHIVEXDocs

Choose and configure a provider

Keep provider construction explicit while the rest of the application uses portable SDK contracts.

TypeScriptMixedPythonMixed
Current release guide · reviewed Sep 18, 2026

Install the SDK once, then add only the provider adapters your application uses. Provider factories create model instances; generation, tools, agents, and workflows consume the shared model contract.

Published TypeScript provider packages

Verified against npm on September 18, 2026 with SDK 1.22.0 and Core 1.19.1.

Package Published version
@zhivex-ai/anthropic 0.11.1
@zhivex-ai/azure-openai 0.7.2
@zhivex-ai/bedrock 2.0.1
@zhivex-ai/deepseek 0.5.5
@zhivex-ai/gemini 0.12.1
@zhivex-ai/kimi 0.7.8
@zhivex-ai/meta 0.2.5
@zhivex-ai/ollama 0.5.4
@zhivex-ai/openai 0.13.1
@zhivex-ai/openrouter 0.5.19
@zhivex-ai/qwen 0.13.0
@zhivex-ai/vertex 1.0.2
@zhivex-ai/xai 0.2.5
@zhivex-ai/zai 0.2.2

The coordinated provider patches use focused Core helper imports while preserving public exports and provider behavior. Qwen 0.13.0 also implements optional realtime interruption through response.cancel. This does not add audio output to Qwen3.8-Omni-Flash HTTP calls: that model remains text-output only.

These versions were published between 13:01 and 13:04 UTC. Publication does not establish live certification for every provider/model. Gateway remains 1.3.0 and was not part of this release batch. See the release notes for the coordinated package list.

TypeScript adapters

bun add @zhivex-ai/sdk @zhivex-ai/openai
bun add @zhivex-ai/anthropic
bun add @zhivex-ai/gemini
bun add @zhivex-ai/openrouter
bun add @zhivex-ai/ollama
import { createOpenAI } from "@zhivex-ai/openai";
import { createAnthropic } from "@zhivex-ai/anthropic";
import { createGemini } from "@zhivex-ai/gemini";

const openai = createOpenAI({ apiKey: process.env.OPENAI_API_KEY });
const anthropic = createAnthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
const gemini = createGemini({ apiKey: process.env.GEMINI_API_KEY });

const model = openai("gpt-6-astra");

The TypeScript packages also include Azure OpenAI, xAI, Meta, Vertex, Qwen, Kimi, DeepSeek, Z.AI, OpenRouter, Bedrock, Ollama, and a policy-based Gateway.

Python factories

The Python package exposes providers from the public zhivex_ai namespace:

from zhivex_ai import create_anthropic, create_gemini, create_meta, create_openai

openai = create_openai()
anthropic = create_anthropic()
gemini = create_gemini()
meta = create_meta()

Hosted-provider credentials are read from server environment variables unless explicitly passed to the factory.

TypeScript 1.13 expands createAnthropic() beyond ANTHROPIC_API_KEY: it can use a Bearer token, select a workspace for personal or service-account keys, rotate credentials through an application callback, resolve a named profile, or obtain cached credentials through Workload Identity Federation. Keep the selected mode and workspace server-side, and verify refresh plus retry behavior with the exact deployment identity.

Adapter availability

This is an adapter map, not a promise that every model supports every feature:

Provider TypeScript Python
OpenAI @zhivex-ai/openai create_openai()
Azure OpenAI @zhivex-ai/azure-openai create_azure_openai()
Anthropic @zhivex-ai/anthropic create_anthropic()
Gemini @zhivex-ai/gemini create_gemini()
Vertex AI @zhivex-ai/vertex create_vertex()
Qwen @zhivex-ai/qwen create_qwen()
Kimi / Moonshot @zhivex-ai/kimi create_kimi()
DeepSeek @zhivex-ai/deepseek create_deepseek()
vLLM — create_vllm()
xAI @zhivex-ai/xai —
Meta @zhivex-ai/meta create_meta() — stable portable Standard scope; native extras beta
Z.AI @zhivex-ai/zai —
Bedrock @zhivex-ai/bedrock create_bedrock() — experimental
Ollama @zhivex-ai/ollama create_ollama() — experimental
OpenRouter @zhivex-ai/openrouter create_openrouter() — experimental

An em dash means that the SDK does not document a corresponding public adapter. Do not substitute an undocumented deep import.

Compare capability surfaces

Surface TypeScript shared contract Python shared contract
Text and streaming Stable Stable
Structured output Stable; enforcement depends on provider/model Stable; enforcement depends on provider/model
Portable local tools Stable Stable
Embeddings Stable Stable
Audio and generative media Stable high-level APIs; provider/model dependent Native media clients are beta; provider/model dependent
Hosted tools and remote MCP Mixed stable/experimental provider surfaces Beta provider-data and hosted-tool surfaces
Realtime/live agents Stable shared lifecycle; provider/model dependent Experimental

Use the selected model’s runtime capabilities for a real decision. A provider name alone is too coarse: API mode, model family, region, deployment, and account access can all change the available surface. The Stable TypeScript realtime contract covers OpenAI, Azure OpenAI, Gemini, Vertex, and Qwen adapters, but it does not make any provider preview model permanently available.

TypeScript can render a matrix from the actual configured models:

import {
  createProviderSupportMatrix,
  renderProviderSupportMatrix
} from "@zhivex-ai/sdk";

const matrix = createProviderSupportMatrix([
  openai("gpt-6-astra"),
  anthropic("claude-sonnet-4-5")
]);

console.log(renderProviderSupportMatrix(matrix));

Python exposes the selected model’s agent capability metadata:

from zhivex_ai import get_agent_capabilities, get_agent_support_tier

model = create_openai()(model_id)
capabilities = get_agent_capabilities(model)

print(get_agent_support_tier(model))
print(capabilities.remote_mcp, capabilities.hosted_web_search)

The TypeScript matrix helpers are stable. TypeScript 1.7 introduced Beta discriminated capability profiles for provider authors who must distinguish native, prompted, model-dependent, and unsupported behavior while deriving the existing boolean capability shape. TypeScript 1.12 adds Beta provider-conformance reports that keep implemented, offline, installed-package, authenticated-live, skipped, failed, and stale evidence separate. Python 0.19 similarly distinguishes contract-supported from release-certified; Tier-1 membership is not live evidence.

Pin model-catalog decisions

createModelCatalog() and defaultModelCatalog are Stable contracts for provider-scoped identity, aliases, recommendations, and optional versioned pricing metadata. TypeScript 1.7 moves ownership of the release-managed default inventory to the SDK:

import { defaultModelCatalog } from "@zhivex-ai/sdk/catalog";

const model = defaultModelCatalog.find("openai", "gpt-5.6-luna");

Import the default from @zhivex-ai/sdk or @zhivex-ai/sdk/catalog when you want future inventory updates. The deprecated @zhivex-ai/core copy is a frozen compatibility snapshot until the next major; createModelCatalog() remains available for application-owned data. A catalog snapshot is routing metadata, not authenticated capability or billing evidence.

Custom catalogs default to pinned data. Record the SDK version, catalog snapshot and pricing version with a run when reproducibility matters. Treat the built-in catalog as rolling only at package-release boundaries, and verify provider availability, entitlement, region, preview status, and current pricing before live routing or charging users.

The TypeScript 1.13 and Python 0.22 snapshots include current Gemini/Vertex 3.7 Flash, Gemini Omni 1.1 Flash and Transcribe, Qwen 3.8 Flash, current Claude lifecycle metadata, and explicit deprecated or retired records. TypeScript also models Grok 4.6 and DeepSeek V4 Flash Vision Exp. Versions, previews, and separately billed model ids remain distinct catalog entries rather than aliases.

Resolve trusted model identifiers

TypeScript 1.9 adds the Beta createModelResolver() for trusted application configuration that benefits from provider/model identifiers or local aliases:

import { defaultModelCatalog, generateText } from "@zhivex-ai/sdk";
import { createModelResolver } from "@zhivex-ai/sdk/beta";

const resolver = createModelResolver({
  catalog: defaultModelCatalog,
  adapters: { openai, anthropic },
  aliases: [
    { alias: "support-default", target: "openai/gpt-6-astra" }
  ]
});

const result = await generateText({
  model: resolver.model("support-default"),
  prompt: "Summarize the incident."
});

The resolver rejects unknown providers and models against the supplied catalog before adapter invocation. It does not discover providers, credentials, endpoints, or routing policy, and direct provider factories remain the canonical reversible path.

Portable first, native when needed

Use the portable surface for messages, generation, streaming, structured output, tools, and normalized usage. Reach for a provider-native namespace or providerOptions only when the feature has no portable equivalent.

Keep that native code behind your own adapter so the rest of the product remains movable.

Capability checks matter

A published provider package does not imply identical support for every model or feature. Before shipping:

  1. choose a model that advertises the required capability;
  2. check the current provider matrix and stability level;
  3. handle unsupported features explicitly;
  4. run an authenticated smoke for the exact provider, model, operation, and release candidate you will deploy.

Offline tests establish contract behavior; they do not prove that credentials, quota, regional availability, or an upstream preview is working in production.

Keep four different statements separate:

  • the adapter accepts a model id;
  • the model advertises a capability in the SDK contract;
  • deterministic tests cover request/response mapping;
  • an authenticated smoke passed for the exact provider, model, operation, artifact, and commit.

Claude on Vertex

Use the Vertex provider with Google bearer authentication and Anthropic publisher routing for supported Claude text, client tools, streaming, reasoning, and native structured output. Direct Anthropic-only features are rejected. Vertex Claude has separate catalog entries; direct Anthropic pricing and recommendations do not carry over automatically.

Vision, live models and compaction

The adapters support DeepSeek V4.1 Flash vision and legacy aliases, removes stale fixed DeepSeek prices, and adds Gemini 3.8 Live catalog entries and background thinking protocol handling. Supply reviewed pricing when a cost ceiling requires it; a removed fixed rate must not be treated as zero cost.

Anthropic compaction preserves signed provider-data blocks and accounts for billed iterations. Keep the returned block unchanged and first in non-system history; replace only the submitted prefix when retaining later turns. Empty or refused summaries must leave original history available. See the versioned Anthropic contract.

Native managed agents are Beta

createOpenAI(options).agents exposes native session creation, event streaming, item listing, event submission and cancellation. It uses provider-owned state. Aborting a stream only closes local consumption; explicitly call cancelTurn to cancel remote work. Recover a disconnected session by retrieving its state and items before resubmitting work. Empty HTTP 202 event acknowledgements may return undefined; idle or subagent events do not establish root-turn success.

createAnthropic(options).managedAgents exposes native agents, environments and sessions, including session event streaming and tool confirmations. Native permission policy auto can execute calls without human review; use always_ask when a human checkpoint is required. These resources do not use Zhivex’s local persistence or approval queues. Automatic request retries are disabled by default.

Review the versioned OpenAI and Anthropic contracts before adoption. Native sessions are separate from runAgent and its external-effect reconciliation. Provider/model/operation certification remains scoped.

Python catalog and certification

Application-owned catalog construction, lookup, defensive copies and typed capability/pricing metadata are Stable. The maintained default_model_catalog snapshot and provider capability discovery remain Beta. Metadata does not establish live availability or current prices.

Provider certification now binds wheel hash, source, workflow identity, target, operations and evidence age. Records older than 30 days become stale. Meta Standard, Meta Contributor and concrete vLLM deployments remain distinct targets. A published 0.24 wheel does not inherit certification from 0.23; consult the artifact-specific support contract.

Qwen multimodal input

TypeScript 1.21.1 and Python 0.25.0 include Qwen3.8-Omni-Flash support. The current TypeScript adapter is @zhivex-ai/qwen 0.13.0. The model accepts text, images, audio, and video and returns text over HTTP. Streaming, callable tools, and hosted web search through Responses are supported. Use prompted structured output with local validation; native JSON Schema and audio output are not supported.

DeepSeek V4.1 Flash adds image input. Gemini 3.8 Live adds catalog and protocol updates, including background thinking. OpenAI managed sessions and Anthropic compaction use native Beta APIs; Python GPT-Live remains Experimental. Model catalog entries are distinct from artifact-specific live certification.

Full provider references

Continue with Gateway routing, MCP and hosted tools, or multimodal features after choosing the portable provider boundary.

Zhivex AI SDKsPortable by default. Native when needed.
Copied