ai-providers

Mule supports configuring multiple AI providers. These are used to provide the models that will be used by Agents.

Mule uses pi as its AI runtime, which supports a wide range of providers:

Subscription Providers (OAuth)

Use /login in interactive mode for OAuth-based authentication:

  • Claude Pro/Max
  • ChatGPT Plus/Pro (Codex)
  • GitHub Copilot
  • Google Gemini CLI
  • Google Antigravity

API Key Authentication

Configure via environment variables:

ProviderEnvironment Variable
OpenAIOPENAI_API_KEY
AnthropicANTHROPIC_API_KEY
Google GeminiGEMINI_API_KEY
MistralMISTRAL_API_KEY
GroqGROQ_API_KEY
CerebrasCEREBRAS_API_KEY
xAIXAI_API_KEY
OpenRouterOPENROUTER_API_KEY
Vercel AI GatewayAI_GATEWAY_API_KEY
ZAIZAI_API_KEY
OpenCode ZenOPENCODE_API_KEY
Hugging FaceHF_TOKEN
Kimi For CodingKIMI_API_KEY
MiniMaxMINIMAX_API_KEY

Cloud Providers

Azure OpenAI:

export AZURE_OPENAI_API_KEY=...
export AZURE_OPENAI_BASE_URL=https://your-resource.openai.azure.com
export AZURE_OPENAI_API_VERSION=2024-02-01

Amazon Bedrock:

export AWS_PROFILE=your-profile
# Or IAM keys
export AWS_ACCESS_KEY_ID=AKIA...
export AWS_SECRET_ACCESS_KEY=...
# Optional region
export AWS_REGION=us-west-2

Google Vertex AI:

gcloud auth application-default login
export GOOGLE_CLOUD_PROJECT=your-project
export GOOGLE_CLOUD_LOCATION=us-central1

Local Models

For local models, configure via models.json:

{
  "providers": {
    "ollama": {
      "baseUrl": "http://localhost:11434/v1",
      "api": "openai-completions",
      "apiKey": "ollama",
      "models": [
        { "id": "llama3.1:8b" },
        { "id": "qwen2.5-coder:7b" }
      ]
    }
  }
}

Also supports LM Studio and vLLM or any provider that speaks OpenAI Completions, OpenAI Responses, Anthropic Messages, or Google Generative AI.

Custom Providers

For custom providers with specific API requirements, you can create a pi extension to register custom provider implementations. See the pi custom provider documentation for details.

All providers support model switching, tool assignment, and dynamic configuration.

Not all fields are required—only the information necessary to interact with your chosen provider must be provided.

Was this page helpful?