Stateless document conversion API

Genflows API

Convert procedure PDFs and images to V1 - VLM JSON or V2 - CaptureGraph DAG. Provider keys are request-only and are not stored.

Interactive Request

Choose a version and provider. Upload a PDF or image, or use the bundled sample.

Prompt Optional

Request Examples


          

Response

No request sent yet.

API Reference

Shared request fields apply to both conversion versions.

JSON Request Shape

{
  "provider": "openai",
  "api_key": "$OPENAI_API_KEY",
  "filename": "document.pdf",
  "mime_type": "application/pdf",
  "document_base64": "<base64 file bytes>",
  "prompt": "Extract procedural steps."
}

Shared Fields

provideropenai, gemini, anthropic
api_keyrequest-only provider key
filemultipart PDF, PNG, JPG, or JPEG
document_base64JSON request file bytes
promptoptional extraction instructions
modeloptional provider model override

Errors return JSON with error and docs_url. Typical requests take 10 seconds to 4 minutes depending on file size and provider.

Conversion Endpoints

POST /api/convert V1 - VLM JSON

Returns procedures, sections, and steps. Accepts multipart uploads or JSON with base64 file bytes.

curl -X POST https://genflows-api.vercel.app/api/convert \
  -F provider=openai \
  -F api_key="$OPENAI_API_KEY" \
  -F file=@/path/to/document.pdf \
  -o result.json

Version-Agnostic Endpoints

GET /api/health

Dependency health and stateless mode.

GET /api/sample

Bundled V2 CaptureGraph sample for the viewer.

Release history

Changelog

Newest first. Expand an update for changes and JSON DAG migration guidance.

Local Python test environment configuration

What changed

  • Added workspace Python settings that select .venv/bin/python and enable pytest discovery for the tests directory.
  • The local virtual environment now installs both production and development requirements so editor analysis can resolve pytest and application imports.

Existing JSON DAG compatibility

  • No JSON DAG changes are required for this development-environment update.
Vercel production routing recovery

What changed

  • Removed the catch-all Vercel rewrite that replaced every incoming path with /api/index.py and caused the homepage, viewer, and API routes to return JSON 404 responses.
  • Vercel now uses its native FastAPI routing so the application receives the original requested path.
  • Added regression tests for the Vercel entrypoint, homepage, viewer, health endpoint, content types, and deployment configuration.

Existing JSON DAG compatibility

  • No JSON DAG changes are required for this deployment-only fix.
  • Existing v2 files, including SwitchString branches and optional button_text settings, remain compatible.
Multiple-choice routing and instruction action labels

What changed

  • Multiple-choice steps now support any number of options, with every option routed to its own next step or nested sequence through SwitchString.
  • Instruction buttons accept optional settings.button_text, such as Start or Continue.
  • The instruction button default changed from Got it to Next.

Existing JSON DAG compatibility

  • No change is required for existing DAGs that use IfThenElse, non-branching UserInputSelectString, or ShowInstructions. Missing button_text automatically displays Next.
  • To retain a different instruction label, add "button_text": "Your label" to that ShowInstructions.settings object.
  • To make an existing select branch, add a SwitchString node whose inputs.selection points to the UserInputSelectString. Copy the ordered choices to SwitchString.settings.options, place the matching branch node IDs in SwitchString.substeps in the same order, and have the parent reference the switch node.
  • The option and branch arrays must remain the same length and order: option at index 0 follows branch at index 0, and so on.