Skip to content

Configure AI Providers

Configure API Access

To run pipelines with LLMs, you need to configure API access. You have three options - choose what works best for you:

Option 1: Pipelex Gateway — Easiest and most Powerful for Getting Started

Get free credits for testing and development with a single API key for LLMs, document extraction, and image generation across all major providers (OpenAI, Anthropic, Google, Azure, open-source, and more). New models added constantly.

Benefits:

  • No credit card required
  • Access to OpenAI, Anthropic Claude, Google Gemini, xAI Grok, and more
  • New models added constantly
  • Perfect for development and testing
  • Single API key for all models

Setup:

  1. Get your API key at app.pipelex.com

  2. Create a .env file in your project root:

    PIPELEX_GATEWAY_API_KEY=your-key-here
    
  3. Run pipelex init and accept the Gateway terms of service when prompted.

That's it! Your pipelines can now access any supported LLM. See Gateway Available Models for the full list.

Terms of Service & Telemetry

When using Pipelex Gateway, you'll be prompted to accept our terms of service. By using the Gateway, identified telemetry is automatically enabled (tied to your hashed API key) to help us monitor service quality and enforce fair usage.

We collect only technical data (model names, token counts, latency, error rates). We do NOT collect your prompts, completions, or business data. See Telemetry for details and trade-offs, and our Privacy Policy for more.

Option 2: Bring Your Own API Keys

Use your existing API keys from LLM providers. This is ideal if you:

  • Already have API keys from providers
  • Need to use specific accounts for billing
  • Have negotiated rates or enterprise agreements
  • Prefer not to send any telemetry to Pipelex servers

Setup:

Create a .env file in your project root with your provider keys:

# OpenAI
OPENAI_API_KEY=sk-...

# Anthropic
ANTHROPIC_API_KEY=sk-ant-...

# Google
GOOGLE_API_KEY=...

# Mistral
MISTRAL_API_KEY=...

# FAL (for image generation)
FAL_API_KEY=...

# XAI
XAI_API_KEY=...

# Azure OpenAI
AZURE_API_KEY=...
AZURE_API_BASE=...
AZURE_API_VERSION=...

# Amazon Bedrock
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
AWS_REGION=...

You only need to add keys for the providers you plan to use.

Enable Your Providers:

When using your own keys, enable the corresponding backends:

  1. Initialize configuration:

    pipelex init
    
  2. Edit ~/.pipelex/inference/backends.toml (or .pipelex/inference/backends.toml in your project root if you have a project-local config — the project file fully overrides the global one):

    [google]
    enabled = true
    
    [openai]
    enabled = true
    
    # Enable any providers you have keys for
    

See Inference Backend Configuration for all options.

Option 3: Local AI (No API Keys Required)

Run AI models locally without any API keys. This is perfect if you:

  • Want complete privacy and control
  • Have capable hardware (GPU recommended)
  • Need offline capabilities
  • Want to avoid API costs

Supported Local Options:

Ollama (Recommended):

  1. Install Ollama
  2. Pull a model from Pipelex's Ollama catalog: ollama pull gemma3:4b
  3. No API key needed! Configure Ollama backend in ~/.pipelex/inference/backends.toml

Other Local Providers:

  • vLLM: High-performance inference server
  • LM Studio: User-friendly local model interface
  • llama.cpp: Lightweight C++ inference

Configure these in ~/.pipelex/inference/backends.toml. See our Inference Backend Configuration for details.


Backend Configuration Files

To set up Pipelex configuration files, run:

pipelex init

By default, this creates the global ~/.pipelex/ directory with:

~/.pipelex/
├── pipelex.toml              # Feature flags, logging, cost reporting
├── plxt.toml                 # MTHDS/TOML formatting and linting configuration
├── telemetry.toml            # AI trace destinations (PostHog, Langfuse, OTLP)
└── inference/                # LLM configuration and model presets
    ├── backends.toml         # Enable/disable model providers
    ├── backends/             # Per-provider model catalogs (anthropic.toml, openai.toml, ...)
    ├── deck/
    │   ├── 1_llm_deck.toml            # LLM presets and aliases
    │   ├── 2_img_gen_deck.toml        # Image generation config
    │   ├── 3_extract_deck.toml        # Document extraction config
    │   ├── 4_search_deck.toml         # Search config
    │   ├── x_custom_llm_deck.toml     # Custom LLM configurations
    │   └── x_custom_extract_deck.toml # Custom extract configurations
    └── routing_profiles.toml # Model routing configuration

To keep the configuration inside a project instead, run pipelex init --local: it creates the same structure in a .pipelex/ directory at your project root, which takes precedence over the global ~/.pipelex/.

Learn more in our Inference Backend Configuration guide.


Next Steps

Now that you have your backend configured:

  1. Learn the concepts: MTHDS Language Tutorial
  2. Explore examples: Cookbook Repository
  3. Deep dive: Build Reliable AI Methods

Advanced Configuration

For detailed backend configuration options, see Inference Backend Configuration.