ZaiProvider
Namespace: Vercel.AI.Zai
public sealed class ZaiProvider : OpenAICompatibleProviderZai provider. OpenAI Chat Completions compatible at https://api.z.ai/api/paas/v4.
Inheritance: object → ProviderBase → OpenAICompatibleProvider
Constructors
Section titled “Constructors”ZaiProvider(HttpClient, OpenAICompatibleOptions?)
Section titled “ZaiProvider(HttpClient, OpenAICompatibleOptions?)”public ZaiProvider(HttpClient httpClient, OpenAICompatibleOptions? options = null)Creates a provider.
Parameters
| Name | Type | Description |
|---|---|---|
httpClient |
HttpClient | |
options |
OpenAICompatibleOptions |
Fields
Section titled “Fields”ApiKeyVariable
Section titled “ApiKeyVariable”public const string ApiKeyVariable = "ZAI_API_KEY"Environment variable for the API key.
Value: string
DefaultBaseUrl
Section titled “DefaultBaseUrl”public const string DefaultBaseUrl = "https://api.z.ai/api/paas/v4"Default API origin.
Value: string
ProviderId
Section titled “ProviderId”public const string ProviderId = "zai"Provider id.
Value: string
Methods
Section titled “Methods”Create(OpenAICompatibleOptions?, HttpMessageHandler?)
Section titled “Create(OpenAICompatibleOptions?, HttpMessageHandler?)”public static ZaiProvider Create(OpenAICompatibleOptions? options = null, HttpMessageHandler? handler = null)Creates a provider. Pass a handler from tests.
Parameters
| Name | Type | Description |
|---|---|---|
options |
OpenAICompatibleOptions | |
handler |
HttpMessageHandler |
Returns: ZaiProvider
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product