ai() API Provider, model, routing, media, and embedding APIs. go api api/ai packages/go/axir-api.json api ai() API

ai() API

LLM provider, model, media, routing, and embedding APIs.

Most Used

axllm.NewAI

Create a provider client from a provider name and options.

FieldValue
Kindfunction
Ax conceptai
API sectionAxAI
Formaxllm.NewAI(provider, options)
ReturnsAIClient

Important Options

  • api key
  • model
  • api URL
  • headers
  • transport

Examples

Go
client := axllm.NewAI("openai", map[string]axllm.Value{"apiKey": os.Getenv("OPENAI_API_KEY")})

Full reference

axllm.OpenAICompatibleClient

OpenAI-compatible chat, stream, embedding, audio, and realtime provider boundary.

FieldValue
Kindtype
Ax conceptOpenAICompatibleClient
API sectionAxAI
Formaxllm.NewOpenAICompatibleClient(options)
Returnsprovider client

Important Options

  • api key
  • model
  • base URL
  • transport

Full reference

axllm.OpenAIResponsesClient

OpenAI Responses provider mapping using the same Core-owned request and response contract.

FieldValue
Kindtype
Ax conceptOpenAIResponsesClient
API sectionAxAI
Formaxllm.NewOpenAIResponsesClient(options)
Returnsprovider client

Important Options

  • api key
  • model
  • audio
  • realtime

Full reference

axllm.GoogleGeminiClient

Gemini provider mapping for chat, streaming, media, tools, embeddings, and usage normalization.

FieldValue
Kindtype
Ax conceptGoogleGeminiClient
API sectionAxAI
Formaxllm.NewGoogleGeminiClient(options)
Returnsprovider client

Important Options

  • api key
  • model
  • embed model

Full reference

axllm.AnthropicClient

Anthropic provider mapping for messages, thinking, cache control, streaming, and usage normalization.

FieldValue
Kindtype
Ax conceptAnthropicClient
API sectionAxAI
Formaxllm.NewAnthropicClient(options)
Returnsprovider client

Important Options

  • api key
  • model
  • thinking
  • cache control

Full reference

axllm.AxBalancer

Retry and route requests across multiple provider services while preserving Ax request shape.

FieldValue
Kindtype
Ax conceptAxBalancer
API sectionAxAI
Formaxllm.NewAxBalancer(services, options)
ReturnsAI service

Important Options

  • services
  • retry policy
  • capability requirements

Full reference

axllm.MultiServiceRouter

Choose a service by capability or model routing policy.

FieldValue
Kindtype
Ax conceptMultiServiceRouter
API sectionAxAI
Formaxllm.MultiServiceRouter
ReturnsAI service

Important Options

  • services
  • routing

Full reference

axllm.ProviderRouter

Route provider requests to registered provider clients.

FieldValue
Kindtype
Ax conceptProviderRouter
API sectionAxAI
Formaxllm.ProviderRouter
ReturnsAI service

Important Options

  • providers
  • routing
  • processing

Full reference

Full Reference

Open the full Go reference. This page highlights the ai symbols most relevant to everyday use.

Docs