ai() API
LLM provider, model, media, routing, and embedding APIs.
Most Used
axllm.NewAI
Create a provider client from a provider name and options.
| Field | Value |
|---|---|
| Kind | function |
| Ax concept | ai |
| API section | AxAI |
| Form | axllm.NewAI(provider, options) |
| Returns | AIClient |
Important Options
api keymodelapi URLheaderstransport
Examples
client := axllm.NewAI("openai", map[string]axllm.Value{"apiKey": os.Getenv("OPENAI_API_KEY")})axllm.OpenAICompatibleClient
OpenAI-compatible chat, stream, embedding, audio, and realtime provider boundary.
| Field | Value |
|---|---|
| Kind | type |
| Ax concept | OpenAICompatibleClient |
| API section | AxAI |
| Form | axllm.NewOpenAICompatibleClient(options) |
| Returns | provider client |
Important Options
api keymodelbase URLtransport
axllm.OpenAIResponsesClient
OpenAI Responses provider mapping using the same Core-owned request and response contract.
| Field | Value |
|---|---|
| Kind | type |
| Ax concept | OpenAIResponsesClient |
| API section | AxAI |
| Form | axllm.NewOpenAIResponsesClient(options) |
| Returns | provider client |
Important Options
api keymodelaudiorealtime
axllm.GoogleGeminiClient
Gemini provider mapping for chat, streaming, media, tools, embeddings, and usage normalization.
| Field | Value |
|---|---|
| Kind | type |
| Ax concept | GoogleGeminiClient |
| API section | AxAI |
| Form | axllm.NewGoogleGeminiClient(options) |
| Returns | provider client |
Important Options
api keymodelembed model
axllm.AnthropicClient
Anthropic provider mapping for messages, thinking, cache control, streaming, and usage normalization.
| Field | Value |
|---|---|
| Kind | type |
| Ax concept | AnthropicClient |
| API section | AxAI |
| Form | axllm.NewAnthropicClient(options) |
| Returns | provider client |
Important Options
api keymodelthinkingcache control
axllm.AxBalancer
Retry and route requests across multiple provider services while preserving Ax request shape.
| Field | Value |
|---|---|
| Kind | type |
| Ax concept | AxBalancer |
| API section | AxAI |
| Form | axllm.NewAxBalancer(services, options) |
| Returns | AI service |
Important Options
servicesretry policycapability requirements
axllm.MultiServiceRouter
Choose a service by capability or model routing policy.
| Field | Value |
|---|---|
| Kind | type |
| Ax concept | MultiServiceRouter |
| API section | AxAI |
| Form | axllm.MultiServiceRouter |
| Returns | AI service |
Important Options
servicesrouting
axllm.ProviderRouter
Route provider requests to registered provider clients.
| Field | Value |
|---|---|
| Kind | type |
| Ax concept | ProviderRouter |
| API section | AxAI |
| Form | axllm.ProviderRouter |
| Returns | AI service |
Important Options
providersroutingprocessing
Full Reference
Open the full Go reference. This page highlights the ai symbols most relevant to everyday use.