> ## Documentation Index
> Fetch the complete documentation index at: https://docs.docex.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Docex

> Agent-first vision and OCR infrastructure for evidence-backed image and PDF runs.

# 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

<CardGroup cols={2}>
  <Card title="Task-agnostic" icon="brain">
    Not limited to "documents." Analyze any image or PDF for any purpose — security scanning, data extraction, content moderation, visual QA.
  </Card>

  <Card title="Provider abstraction" icon="route">
    Automatic routing across OpenRouter, Mistral OCR, and mock providers with fallback if a provider fails.
  </Card>

  <Card title="Transparent billing" icon="receipt">
    Pay a 2× markup on actual upstream AI cost. No flat rates, no hidden fees. Estimates provided before execution.
  </Card>

  <Card title="Agent-first" icon="bot">
    The entire onboarding flow is designed for AI agents. Human approval is only required at the payment boundary.
  </Card>
</CardGroup>

## Get started in minutes

<Steps>
  <Step title="Install">
    ```bash theme={null}
    npm install docexdev
    ```
  </Step>

  <Step title="Setup">
    ```bash theme={null}
    npx docex setup --use-case "vision analysis" --top-up 5
    ```
  </Step>

  <Step title="Run">
    ```js theme={null}
    import { createDocex } from "docexdev";
    const docex = createDocex({ apiKey, baseUrl });
    const result = await docex.run({ file: "image.png", prompt: "company name, number" });
    ```
  </Step>
</Steps>

## Explore the docs

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Go from zero to your first vision analysis in under 5 minutes.
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/runs">
    Full reference for uploads, runs, errors, and authentication.
  </Card>

  <Card title="Concepts" icon="lightbulb" href="/concepts/pipeline">
    Understand the pipeline, providers, billing model, and schemas.
  </Card>

  <Card title="Integrations" icon="plug" href="/integration/nextjs">
    Scaffold Docex into Next.js, Express, or any Node framework.
  </Card>
</CardGroup>

## 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
```
