Skip to main content

Installation

Requires React 18+.

OpenModexProvider

Wrap your app with OpenModexProvider to set global configuration for all hooks:
When using the provider, individual hooks inherit the global apiKey, baseURL, and model values. You can still override them per-hook.

useChat

Full-featured chat hook with streaming, message history, abort support, and smart routing.

Options

Returns

useCompletion

Single-turn completion with streaming and routing support.

Options

useModels

Fetch and filter available models.

Options

Returns

useModelCompare

Compare models side by side with pricing, performance, and quality scores.

Options

Returns

useEmbedding

Create text embeddings.

Options

Returns