aimux API reference

August 13, 2026 · View on GitHub

Lookup index for the public API surface. Rust is the source of truth; TypeScript declarations in bindings/node/src/types/ are generated by ts-rs and mirror the JSON shapes that flow through the FFI boundary (all bindings use the same shapes). Full provider list: providers.md.

Types

TypeRust sourceTS declarationNotes
GenerateTextOptionsgenerate.rsGenerateTextOptions.tsper-call text options (temperature, tools, reasoning, timeout, …)
CallOptionsoptions.rsCallOptions.tsbase options for all modalities
TimeoutConfigurationoptions.rsTimeoutConfiguration.tstotal_ms / first_chunk_ms / chunk_ms
ResponseFormatoptions.rsResponseFormat.tstext / json_object / json_schema
ReasoningEfforttypes.rsReasoningEffort.ts7 levels, passed through verbatim
AbortSignalshared.rs— (runtime handle)Rust: options field; Node: AbortBridge + JS AbortSignal
ProviderOptionsprovider.rsProviderConfig (per binding)base_url / headers / organization / project / max_retries / body_overrides
ProviderNameprovider_name.rsProviderName.tsone constant per registry provider (251); also generated for Go / Python / Java / Kotlin / Swift / Dart (scripts/gen_provider_names.py)
GenerateTextResultgenerate.rsGenerateTextResult.tstext, tool_calls, usage, warnings, raw
StreamTextResultgenerate.rsuse StreamPart while iterating
StreamPartstream_part.rsStreamPart.tsTextDelta / ToolCallDelta / Finish / …
Usage / TokenUsagetypes.rsUsage.tsinput/output/reasoning tokens
FinishReason / FinishReasonUnifiedtypes.rsFinishReason.ts
Warningtypes.rsWarning.tsnon-fatal provider notices
AiMuxErrorerror.rsAiMuxError.tstyped error with error_type + status_code
ModelMessage / Role / MessageContent / ModelPromptmessage.rsModelMessage.tschat message shapes
LanguageModelPromptMessagelanguage_model_message.rsLanguageModelPromptMessage.tscanonical prompt message
ContentPartcontent.rsContentPart.tsText / Reasoning / ToolResult / …
Tool / FunctionTool / ProviderTooltool.rsTool.tstool definitions
ToolCall / ToolResult / ToolChoicetool.rsToolCall.tstool invocation plumbing
Embedding typesembedding_model.rsEmbedding*.tsEmbeddingCallOptions / EmbeddingResult / EmbeddingResponse
Image typesimage_model.rsImage*.tsImageCallOptions / ImageResult / ImageResponse / ImageFile
Speech typesspeech_model.rsSpeech*.tsSpeechCallOptions / SpeechResult / AudioData
Transcription typestranscription_model.rsTranscription*.tsTranscriptionCallOptions / TranscriptionResult / TranscriptionSegment
Video typesvideo_model.rsVideo*.tsVideoCallOptions / VideoResult / VideoData
Reranking typesreranking_model.rsReranking*.tsRerankingCallOptions / RerankingResult / RerankingRank
Search typessearch_model.rsSearch*.tsSearchCallOptions / SearchResult / SearchResultItem
Files typesfiles_model.rsUploadFile*.tsUploadFileCallOptions / UploadFileResult
Sharedshared.rsFileBytes.ts / FileData.ts / Size.ts / AspectRatio.ts

Functions

Native protocols

ProviderRustNode / PythonGo / JavaKotlin / Swift / FlutterC ABI
OpenAIOpenAIProvider::new(OpenAIConfig::new(key))openai(apiKey, model, baseUrl?)NewOpenAI(...) / Model.openai(...)Model.openai(...) / Aimux.openai(apiKey:modelId:)aimux_openai_new
AnthropicAnthropicProvider::new(AnthropicConfig::new(key))anthropic(apiKey, model, baseUrl?)NewAnthropic(...) / Model.anthropic(...)Model.anthropic(...) / Aimux.anthropic(apiKey:modelId:)aimux_anthropic_new
GoogleGoogleProvidergoogle(apiKey, model, baseUrl?)
DeepSeek (registry)provider("deepseek", ...)deepseek(...)NewDeepSeek(...) / Model.deepseek(...)aimux_provider_new("deepseek", ...)
CohereCohereProvidercohere(apiKey, model, baseUrl?)NewCohere(...) / Model.cohere(...)Model.cohere(...) / Aimux.cohere(...)aimux_cohere_new
MistralMistralProvidermistral(apiKey, model, baseUrl?)NewMistral(...) / Model.mistral(...)Model.mistral(...) / Aimux.mistral(...)aimux_mistral_new
xAIXAIProviderxai(apiKey, model, baseUrl?)NewXai(...) / Model.xai(...)Model.xai(...) / Aimux.xai(...)aimux_xai_new
BedrockBedrockProviderbedrock(accessKeyId, secretKey, region, model, baseUrl?)NewBedrock(...) / Model.bedrock(...)Model.bedrock(...) / Aimux.bedrock(...)aimux_bedrock_new
VertexVertexProvidervertex(accessToken, project, location, model, baseUrl?)NewVertex(...) / Model.vertex(...)Model.vertex(...) / Aimux.vertex(...)aimux_vertex_new
Anthropic-AWSAnthropicAwsProvideranthropicAws(apiKey, region, model, baseUrl?)NewAnthropicAws(...) / Model.anthropicAws(...)Model.anthropicAws(...) / Aimux.anthropicAws(...)aimux_anthropic_aws_new
AzureAzureProviderazure(apiKey, resource, deployment, apiVersion?, baseUrl?)NewAzure(...) / Model.azure(...)Model.azure(...) / Aimux.azure(...)aimux_azure_new

= not exposed in that binding yet (Google is Rust / Node / Python only). Every constructor has a base-URL variant (WithBase / baseUrl overload).

The remaining 65 providers (speech, transcription, image, video, local inference, search, standalone OpenAI-compatible, Vertex-hosted) each have a typed Rust constructor — full list, one entry per provider: providers.md. Their per-binding modality factories are in the function tables below.

Core (Rust, aimux_providers / aimux_core)

FunctionSignature (abridged)Notes
providerprovider(name, api_key, model_id, options) -> Box<dyn LanguageModel>registry lookup; unknown name → NoSuchProvider
provider_from_envprovider_from_env(name, model_id, options)key read from the registry entry's env var
provider_registry_entry-> Option<OpenAICompatProfile>inspect a registry profile
generate_text(model, prompt, options) -> GenerateTextResultnon-streaming
stream_text(model, prompt, options) -> StreamTextResultstreaming

Per-modality entry points are trait methods on the model types (EmbeddingModel, ImageModel, SpeechModel, …) — see API.md §Features.

Node (@arcships/aimux)

FunctionNotes
generateText(model, prompt, options?, signal?) / streamText(...)typed wrappers; signal = AbortSignal
openai() / anthropic() / deepseek() / google()native typed path; deepseek() is registry-backed
provider(name, apiKey?, modelId, config?)registry-backed (251); typed ProviderName
openaiEmbedding / cohereEmbedding / googleEmbeddingembeddings
openaiSpeech / openaiTranscriptionspeech / STT
openaiImage / googleImage / googleVideoimage / video
openaiFiles / cohereReranking / tavilySearchfiles / rerank / search
AbortBridgewraps a JS AbortSignal for the raw napi API

Python (aimux)

FunctionNotes
generate_text(model, prompt, options?) / stream_text(...)typed wrappers
openai / anthropic / deepseek / providersame semantics as Node; deepseek registry-backed
openai_embedding / cohere_embedding / google_embeddingembeddings
openai_speech / openai_transcriptionspeech / STT
openai_image / google_image / google_videoimage / video
openai_files / cohere_reranking / tavily_searchfiles / rerank / search

Go (github.com/arcships/aimux/bindings/go)

FunctionNotes
Provider(name, apiKey?, modelId, config?)registry-backed; typed ProviderName
NewOpenAI / NewAnthropic / NewDeepSeeknative typed path (+ WithBase variants)
NewOpenAIEmbedding / NewCohereEmbedding / NewGoogleEmbeddingembeddings
NewOpenAISpeech / NewOpenAITranscriptionspeech / STT
NewOpenAIImage / NewGoogleImage / NewGoogleVideoimage / video
NewOpenAIFiles / NewCohereReranking / NewTavilySearchfiles / rerank / search

Java / Kotlin / Flutter (Model.*) and Swift (Aimux.*)

FunctionNotes
provider(name, apiKey?, modelId, config?)registry-backed
openai(apiKey, modelId) / anthropic(apiKey, modelId)native typed path (+ WithBase/baseUrl variants; Swift: Aimux.openai(apiKey:modelId:))
modality classesEmbeddingModel / SpeechModel / ImageModel / TranscriptionModel / VideoModel / RerankingModel / SearchModel / Files, each with openai / cohere / google … factories

C ABI (aimux-ffi)

All functions communicate via JSON strings. Entry points are declared in aimux-ffi.h: provider_new (registry lookup), model constructors (openai_new, anthropic_new, …), *_generate, *_stream (push-callback), *_embed / *_speech / … per modality, and the *_free family.

Providers

The complete list — 251 registry-backed (name / display / env var / base URL) and 76 typed-factory providers grouped by category — is in providers.md. It is generated from aimux-providers/src/provider_registry.json + aimux-providers/src/lib.rs: python scripts/gen_providers_doc.py.