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

# Run Web Extract

> Reads the exact supplied URLs and returns their content and provider sources. Failed resources can use an extraction fallback.



## OpenAPI

````yaml /api-reference/openapi.json post /wrapped/credits/router/web-extract
openapi: 3.1.0
info:
  title: Locus Pro API
  description: >-
    Access paid tools, manage prepaid balances, and build usage billing. Send
    money as exact decimal strings and reuse Idempotency-Key on retries.
    Management routes require a scoped server key or authorized dashboard
    session. Sensitive workspace changes require an owner or admin with recent
    MFA or passkey verification, except where an operation documents a stricter
    boundary. Interactive agents use MCP OAuth; unattended agents use scoped
    Agent Connections. Browser widgets use end-user tokens.
  version: 0.7.0
servers:
  - url: https://api.paywithlocus.com/api
    description: Production
  - url: https://api.stage.paywithlocus.com/api
    description: Stage — evaluation and integration testing
security:
  - secretKey: []
tags:
  - name: Authentication
    description: Email-verified self-serve account creation and dashboard identity
  - name: Tenants
    description: Tenant profile, keys, and settings (dashboard session or secret key)
  - name: Workspace members
    description: Invite-only human workspace membership and role administration
  - name: Catalog
    description: Enable/disable APIs and set markups
  - name: Custom APIs
    description: Feature-gated enterprise BYOK providers and schema-backed custom actions
  - name: End users
    description: End-user accounts, tokens, and allocations
  - name: Top-ups
    description: Locus-hosted checkout top-ups and quotes
  - name: Ledger
    description: Burn/top-up history and earnings
  - name: Webhooks
    description: Signed events, delivery inspection, and replay
  - name: Burn
    description: Metered pay-per-use calls
  - name: MCP
    description: Stateless Streamable HTTP transport and MCP tool-result contracts
  - name: Okibi Identity
    description: >-
      Feature-gated Okibi identity verification and scoped native CLI credential
      bootstrap
  - name: Widget
    description: End-user JWT surface; a matching publishable key is optional
  - name: Agent-native onboarding
    description: >-
      Self-registration, human Stripe funding handoff, and restricted account
      setup for headless agents
  - name: Hosted Workflows
    description: >-
      Tenant-private TypeScript Workflow definitions, immutable versions,
      bounded runs, artifacts, and recovery
  - name: Agent connections
    description: Scoped, expiring, revocable credentials for agent execution
  - name: Recipes
    description: >-
      Search, research, extraction, enrichment, and travel outcomes across
      providers
paths:
  /wrapped/credits/router/web-extract:
    post:
      tags:
        - Recipes
      summary: Run Web Extract
      description: >-
        Reads the exact supplied URLs and returns their content and provider
        sources. Failed resources can use an extraction fallback.
      parameters:
        - $ref: '#/components/parameters/SessionBindingHeader'
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 255
          description: Reuse the same value only when retrying the same logical request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocusWebExtractRequest'
      responses:
        '200':
          description: Result, sources, and billing receipt
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocusWebExtractResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '402':
          description: Insufficient credits
        '403':
          description: Capability, provider, policy, or spend limit denied the request
        '409':
          description: The aggregate tenant-aware estimate exceeds maxCredits
      security:
        - secretKey: []
        - endUserToken: []
        - agentConnection: []
components:
  parameters:
    SessionBindingHeader:
      name: X-Locus-Session-Id
      in: header
      required: false
      schema:
        type: string
        minLength: 16
        maxLength: 128
        pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]{15,127}$
      description: >-
        Required only when the end-user JWT carries sid. Send the original
        high-entropy session value; sid is its SHA-256 fingerprint. Ignored for
        secret-key authentication.
  schemas:
    LocusWebExtractRequest:
      type: object
      properties:
        urls:
          type: array
          minItems: 1
          maxItems: 20
          uniqueItems: true
          items:
            type: string
            format: uri
            pattern: ^[Hh][Tt][Tt][Pp][Ss]?://
            maxLength: 2048
          description: >-
            Exact public HTTP(S) resources to read. The router never substitutes
            another URL.
        objective:
          type: string
          minLength: 1
          maxLength: 400
          description: >-
            Optional focus within each supplied resource; it does not authorize
            discovery.
        maxCharactersPerUrl:
          type: integer
          minimum: 1000
          maximum: 100000
          default: 50000
        maxAgeSeconds:
          type: integer
          minimum: 600
          maximum: 2592000
          description: Maximum accepted cache age. Omit to use each extractor default.
        maxCredits:
          oneOf:
            - type: string
              pattern: >-
                ^\s*(?=[0-9.]{1,100}\s*$)0*(?:(?:[1-9]\d{0,11})(?:\.\d{1,6})?|1000000000000(?:\.0{1,6})?|0\.(?=\d{0,5}[1-9])\d{1,6})\s*$
            - type: number
              exclusiveMinimum: 0
              maximum: 1000000000000
          description: >-
            Aggregate hard charge ceiling in workspace credits. Decimal strings
            support up to six fractional digits; numeric values are rounded down
            to six digits.
        externalUserId:
          type: string
          minLength: 1
          pattern: \S
          description: Optional end-user billing attribution for a tenant secret key.
        attribution:
          type: object
          additionalProperties: true
          description: Optional JSON ledger metadata such as a task or customer identifier.
      required:
        - urls
      additionalProperties: false
    LocusWebExtractResponse:
      type: object
      properties:
        object:
          const: locus.web_extract
        capability:
          const: web.extract
        routerVersion:
          const: 2026-09-14.v28
        partial:
          type: boolean
        resources:
          type: array
          items:
            type: object
            properties:
              requestedUrl:
                type: string
                format: uri
              url:
                type: string
                format: uri
              status:
                type: string
                enum:
                  - succeeded
                  - failed
              title:
                type: string
              content:
                type: string
              contentType:
                const: text/markdown
              publishedAt:
                type: string
              retrievedAt:
                type: string
                format: date-time
              truncated:
                type: boolean
              coverage:
                type: string
                enum:
                  - full_content
                  - excerpt
                  - none
              source:
                type: object
                properties:
                  providerId:
                    type: string
                  providerName:
                    type: string
                required:
                  - providerId
                  - providerName
                additionalProperties: false
              errorCode:
                type: string
            required:
              - requestedUrl
              - url
              - status
              - retrievedAt
              - truncated
              - coverage
              - source
            additionalProperties: false
        route:
          type: object
          properties:
            strategy:
              const: exact_resource_fallback
            primary:
              const: parallel/extract
            fallback:
              const: firecrawl/scrape
            fallbackUsed:
              type: boolean
          required:
            - strategy
            - primary
            - fallback
            - fallbackUsed
          additionalProperties: false
        billing:
          type: object
          properties:
            chargedCredits:
              type: string
              pattern: ^\d+(?:\.\d+)?$
            successfulResources:
              type: integer
              minimum: 0
            attemptedResources:
              type: integer
              minimum: 1
            providerCalls:
              type: integer
              minimum: 1
          required:
            - chargedCredits
            - successfulResources
            - attemptedResources
            - providerCalls
          additionalProperties: false
      required:
        - object
        - capability
        - routerVersion
        - partial
        - resources
        - route
        - billing
      additionalProperties: false
  responses:
    BadRequest:
      description: >-
        The request is malformed or fails local validation before any provider
        or payment action.
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: Tenant secret key (lcr_…). Server-side only.
    endUserToken:
      type: http
      scheme: bearer
      description: >-
        60-3600 second end-user JWT minted via /credits/end-users/{id}/token. If
        the JWT has sid, send the original session value in X-Locus-Session-Id;
        sid contains only its SHA-256 fingerprint. Bearer tokens are replayable
        until expiry; use short TTLs, optional session binding, and
        Idempotency-Key on operations.
    agentConnection:
      type: http
      scheme: bearer
      description: >-
        Scoped lcac_ credential. Tenant-managed Agent Connections authorize only
        their bound MCP and wrapped execution surfaces. A bootstrap connection
        for a self-registered agent additionally authorizes the explicit
        /credits/agent/* self-service routes for its own account; neither form
        authorizes general tenant management.

````