Skip to main content
Every provider configuration file requires a baseline structure to function.
syntax "next-router/0.1";

provider "openai" {
  defaults { ... }

  match api = "chat.completions" stream = true { ... }
  match api = "chat.completions" stream = false { ... }
  match api = "embeddings" { ... }
}

syntax

syntax "next-router/0.1"; is a version marker. The parser currently does not strictly validate it, but it is recommended to keep it for future compatibility.

provider

The provider "<name>" { ... } block encompasses all routing logic for that provider.

defaults and match priority

A provider block typically contains a defaults block and several match blocks. Merge Rule (Important):
  • Configurations defined in defaults are applied first.
  • Configurations from the selected match block are applied afterwards.
  • This means specific match settings will merge or override the generic settings set inside defaults.