Skip to main content

Providers

Providers are adapters around external APIs. The catalog describes capabilities, costs, and auth requirements. The planner resolves candidates per step. The executor runs strategies with automatic fallback.

Supported providers

ProviderCapabilityBest for
OpenRouterGateway for multimodal vision modelsFlexibility, model switching
Mistral OCROCR engine for image and PDF text extractionHigh-accuracy text extraction from documents
MockDeterministic local responsesCI testing, offline development

Internal model catalogue

Docex keeps model selection internal. The catalogue is used by the planner for OpenRouter and Mistral OCR routing, default model selection, capability checks, timeouts, and pricing hints. It is not exposed as a public model marketplace.

Provider catalog

The catalog (catalog.js) defines each provider’s:
  • Capabilities — supported input types, output formats, max file size
  • Cost model — per-request or per-token pricing
  • Auth requirements — API key, OAuth, or none
  • Defaults — which model to try first for each provider class

Automatic fallback

If a provider fails (network error, rate limit, invalid response), the executor automatically retries with the next candidate in the plan. This happens transparently to the caller.

Mock provider

The mock provider is enabled by default in development and testing. It returns deterministic fixture responses based on file name patterns without calling external APIs or deducting wallet balance.
In NODE_ENV=production or when DOCEX_PROVIDER_MODE=managed, the mock provider is disabled unless DOCEX_ALLOW_MOCK_PROVIDER=1 is explicitly set.

Provider mode

ModeBehavior
defaultMock provider available, real providers used if configured
managedMock provider disabled, only authenticated real providers are routed
Set via the DOCEX_PROVIDER_MODE environment variable.