Skip to main content
This guide covers everything you need to integrate Muxx with your OpenAI-powered application.

Choose Your Integration

Option 1: Gateway Only (Quickest)

Just change your base URL:
Pros: Zero code changes, caching, rate limiting Cons: Request-level logging only

Option 2: SDK Only (Deep Tracing)

Wrap your client:
Pros: Trace/span hierarchy, decorators, async batching Cons: No caching or rate limiting

Option 3: SDK + Gateway (Full Power)

Combine both:
Pros: Everything Cons: Slightly more setup

Common Patterns

Chat Application

RAG Application

Function Calling

Streaming

Both gateway and SDK support streaming:

Error Handling

Cost Optimization

  1. Use gpt-4o-mini for simple tasks (20x cheaper)
  2. Enable caching for repeated queries
  3. Set max_tokens to limit output length
  4. Monitor in dashboard to identify expensive patterns