Skip to main content
The dartantic_ai package ships 10 built-in providers. For Flutter apps that use Gemini through Firebase AI Logic, add the optional dartantic_firebase_ai package and register it (see Firebase AI below). Additional OpenAI-compatible endpoints are available via the openai_compat.dart example.

Provider Capabilities

Note: Together AI, Google-OpenAI, and Ollama-OpenAI have been moved to the openai_compat.dart example. You can still use them by registering them with Agent.providerFactories.

Provider Configuration

Firebase AI (Flutter add-on)

Use dartantic_firebase_ai when you want Gemini through the Firebase SDK (Firebase AI Logic), including App Check and Firebase Auth on the Vertex AI path. Pure Dart apps should keep using GoogleProvider with GEMINI_API_KEY instead. Add the package, call Firebase.initializeApp(), then register factories for each backend you need. Provider name is firebase_ai; model strings use the aliases below.
Platforms: iOS, Android, macOS, and Web (Flutter only). Supports chat, streaming, tools, thinking, structured output, and media generation; no embeddings model. See the dartantic_firebase_ai README for dependency versions and setup.

Setup

Usage

Find Providers

Custom Config

Custom Headers

All providers support custom HTTP headers for enterprise scenarios like authentication proxies, request tracing, or compliance logging:
Custom headers flow through to all API calls and can override internal headers when needed. This works consistently across OpenAI, Google, Anthropic, Mistral, Ollama, and xAI providers.

Check Capabilities

Use Provider.listModels() for runtime capability discovery:

Model Kinds

Models are categorized by their kind via ModelKind (a model may report multiple kinds):
  • chat - Chat / completion models
  • embeddings - Text embedding models
  • media - Unified media generation (images, documents, audio, etc.)
  • image - Image generation or vision models
  • video - Video generation models
  • audio - Audio processing (e.g. speech-to-text)
  • tts - Text-to-speech
  • countTokens - Token counting
  • other - Other specialized model types

Typed Output With Tools

The typedOutputWithTools capability indicates a provider can handle both function calling and structured JSON output in the same request: Together AI, Google-OpenAI, and Ollama-OpenAI also support typed output with tools when registered via the openai_compat.dart example. Anthropic’s approach uses the return_result tool pattern. This is a special tool that allows the model to return a structured JSON response. This is handled automatically by the Anthropic provider. Google’s approach uses a transparent two-phase workflow: Phase 1 executes tools, Phase 2 requests structured output. This is handled automatically by the Google provider.

List Models

Examples