Skip to main content

Overview

OpenModex is fully compatible with the OpenAI API. Migration typically requires changing just two lines of code: the base URL and the API key.

Option 1: Use the OpenAI SDK (Fastest)

If you’re already using the OpenAI SDK, just change the configuration:

Option 2: Use the OpenModex SDK

For access to routing, caching, fallbacks, and model comparison:

Option 3: Environment Variable

For zero-code migration, just set environment variables:

What You Gain

After migrating, you get access to:

Compatibility Notes

  • All OpenAI chat completion parameters are supported
  • Streaming works identically (SSE format)
  • Function calling / tool use is fully supported
  • Response format is identical — your parsing code stays the same
  • The openmodex metadata field is additive and won’t break existing code