Connections Overview

Quick Access: Manage Connections | Connection Pools

Connections are the bridge between LangMart and AI providers like OpenAI, Anthropic, Groq, and others. They allow you to use your own API keys to access AI models through LangMart's unified interface.

What Are Connections?

A connection links your AI provider account (via API key) to LangMart. Once configured, you can:

  • Access all models from that provider through a single LangMart API
  • Track usage and costs across all your providers in one place
  • Switch between providers without changing your application code
  • Use advanced features like connection pools, fallback routing, and rate limiting

Why You Need Connections

1. Use Your Own API Keys

LangMart does not provide API keys for AI providers. You bring your own keys from:

  • OpenAI
  • Anthropic
  • Google (Gemini / Vertex AI)
  • Groq
  • Together AI
  • Mistral AI
  • And more...

This gives you full control over billing, rate limits, and terms of service with each provider.

2. Unified API Access

Instead of managing different SDKs and API formats for each provider, use a single OpenAI-compatible API for all:

# Same code works for any provider
from openai import OpenAI

client = OpenAI(
    api_key="your-langmart-api-key",
    base_url="https://api.langmart.ai/v1"
)

# Use OpenAI
response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)

# Or Anthropic (same API!)
response = client.chat.completions.create(
    model="anthropic/claude-3-5-sonnet-20241022",
    messages=[{"role": "user", "content": "Hello!"}]
)

3. Centralized Cost Tracking

View all your AI spending in one dashboard, regardless of which provider you're using.

Connection Types

LangMart supports two types of connections based on where your API keys are stored:

Type 2: Cloud Gateway (Managed)

Your API keys are securely stored (encrypted) in LangMart's registry. This is the simplest option:

Feature Description
API Key Storage Encrypted in LangMart
Setup Complexity Simple - just add your key
Use Case Standard production usage
Gateway LangMart's cloud infrastructure

Best for: Most users who want a quick, managed solution.

Type 3: Self-Hosted Gateway (Private)

Your API keys stay on your own infrastructure. Run a private gateway that connects to LangMart:

Feature Description
API Key Storage Your local vault (never leaves your network)
Setup Complexity Requires running a gateway service
Use Case Enterprise, compliance, or air-gapped environments
Gateway Your own server or Docker container

Best for: Organizations with strict security requirements or compliance needs (HIPAA, SOC2, etc.).

Connection Scope

Connections can be scoped to individual users or entire organizations:

Individual Connections

  • Created by and visible only to you
  • Bills to your personal account
  • Perfect for personal projects or testing

Organization Connections

  • Created by organization admins
  • Shared across all organization members
  • Bills to the organization account
  • Enables team-wide access to AI models

Quick Start

Ready to add your first connection? Head to the Adding Connections guide.