LOCK

ex_openai with Meridian

Route Elixir AI calls through Meridian's unified API gateway. Drop-in compatible with the ex_openai library — just point api_url at your Meridian endpoint.

config/config.exs

config :openai,
  api_key: System.get_env("MERIDIAN_API_KEY"),
  api_url: "https://api.meridian.example.com/v1"

Set MERIDIAN_API_KEY in your environment or runtime config. All chat completions, embeddings, and audio endpoints flow through Meridian automatically.

Usage

{:ok, %{choices: [%{message: msg}]}} =
  OpenAI.chat_completion(
    model: "meridian-gpt-4",
    messages: [%{role: "user", content: "Hello"}]
  )