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

ai() API

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

Most Used

ai

Create a provider client from a provider name and options.

FieldValue
Kindfunction
Ax conceptai
API sectionAxAI
Formai(provider='openai', **options)
ReturnsAI client/service

Important Options

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

Examples

Python
client = ai("openai", api_key=os.environ["OPENAI_API_KEY"])

Full reference

OpenAICompatibleClient

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

FieldValue
Kindtype
Ax conceptOpenAICompatibleClient
API sectionAxAI
FormOpenAICompatibleClient(options=None)
Returnsprovider client

Important Options

  • api key
  • model
  • base URL
  • transport

Full reference

OpenAIResponsesClient

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

FieldValue
Kindtype
Ax conceptOpenAIResponsesClient
API sectionAxAI
FormOpenAIResponsesClient(options=None)
Returnsprovider client

Important Options

  • api key
  • model
  • audio
  • realtime

Full reference

GoogleGeminiClient

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

FieldValue
Kindtype
Ax conceptGoogleGeminiClient
API sectionAxAI
FormGoogleGeminiClient(options=None)
Returnsprovider client

Important Options

  • api key
  • model
  • embed model

Full reference

AnthropicClient

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

FieldValue
Kindtype
Ax conceptAnthropicClient
API sectionAxAI
FormAnthropicClient(options=None)
Returnsprovider client

Important Options

  • api key
  • model
  • thinking
  • cache control

Full reference

AxBalancer

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

FieldValue
Kindtype
Ax conceptAxBalancer
API sectionAxAI
FormAxBalancer(services, options=None)
ReturnsAI service

Important Options

  • services
  • retry policy
  • capability requirements

Full reference

MultiServiceRouter

Choose a service by capability or model routing policy.

FieldValue
Kindtype
Ax conceptMultiServiceRouter
API sectionAxAI
FormMultiServiceRouter(services)
ReturnsAI service

Important Options

  • services
  • routing

Full reference

ProviderRouter

Route provider requests to registered provider clients.

FieldValue
Kindtype
Ax conceptProviderRouter
API sectionAxAI
FormProviderRouter(providers, routing=None, processing=None)
ReturnsAI service

Important Options

  • providers
  • routing
  • processing

Full reference

Full Reference

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

Docs