Skip to main content

Docex

Agent-first vision and OCR infrastructure. Route any image or PDF through evidence capture, provider fallback, structured output, and cost visibility.
Docex accepts a file (image or PDF) plus a user prompt, classifies the task, selects an execution strategy, runs it through one or more AI providers, and returns structured JSON with confidence scores and usage-based billing.

Why Docex

Task-agnostic

Not limited to “documents.” Analyze any image or PDF for any purpose — security scanning, data extraction, content moderation, visual QA.

Provider abstraction

Automatic routing across OpenRouter, Mistral OCR, and mock providers with fallback if a provider fails.

Transparent billing

Pay a 2× markup on actual upstream AI cost. No flat rates, no hidden fees. Estimates provided before execution.

Agent-first

The entire onboarding flow is designed for AI agents. Human approval is only required at the payment boundary.

Get started in minutes

1

Install

npm install docexdev
2

Setup

npx docex setup --use-case "vision analysis" --top-up 5
3

Run

import { createDocex } from "docexdev";
const docex = createDocex({ apiKey, baseUrl });
const result = await docex.run({ file: "image.png", prompt: "company name, number" });

Explore the docs

Quickstart

Go from zero to your first vision analysis in under 5 minutes.

API Reference

Full reference for uploads, runs, errors, and authentication.

Concepts

Understand the pipeline, providers, billing model, and schemas.

Integrations

Scaffold Docex into Next.js, Express, or any Node framework.

Connect with AI

Add the Docex MCP server to Claude, Cursor, or VS Code to search docs directly from your IDE:
https://docs.docex.dev/mcp