---
title: "Deploy Unstructured API | (Just Updated) Document Parsing API for RAG, Key-Locked From Boot"
description: "Unstructured API. Key-locked from boot, no fields to fill, public URL"
category: "AI/ML"
url: https://railway.com/deploy/unstructured-api-or-just-updated-documen
---

# Deploy Unstructured API | (Just Updated) Document Parsing API for RAG, Key-Locked From Boot

Unstructured API. Key-locked from boot, no fields to fill, public URL

**[Deploy Unstructured API | (Just Updated) Document Parsing API for RAG, Key-Locked From Boot on Railway](https://railway.com/template/unstructured-api-or-just-updated-documen)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/unstructured-api-or-just-updated-documen/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** AI/ML

## Template content

### unstructured-api

- **Image:** quay.io/unstructured-io/unstructured-api:0.1.11@sha256:b1f0eb6be87dbb15edff568a99f6dd2e57072240faff04729e8d91d283f5b86b
- **Start command:** `/bin/sh -c 'q=$(cut -d" " -f1 /sys/fs/cgroup/cpu.max 2>/dev/null); p=$(cut -d" " -f2 /sys/fs/cgroup/cpu.max 2>/dev/null); if [ -n "$q" ] && [ "$q" != max ]; then n=$(( (q + p - 1) / p )); else n=$(nproc); fi; export OMP_NUM_THREADS=$n MKL_NUM_THREADS=$n OPENBLAS_NUM_THREADS=$n; echo "[railway] unstructured threads=$n uid=$(id -u) port=$PORT key=$([ -n "$UNSTRUCTURED_API_KEY" ] && echo set || echo MISSING)"; [ -n "$UNSTRUCTURED_API_KEY" ] || { echo "[railway] refusing to start without UNSTRUCTURED_API_KEY"; exit 1; }; exec scripts/app-start.sh'`
- **Health check:** /healthcheck
- **Public domain:** Yes

## Documentation

# Deploy and Host Unstructured API on Railway

Unstructured API is a REST service that turns PDFs, Word and PowerPoint files, HTML, emails and
images into clean, typed elements (titles, narrative text, tables, list items) with metadata. It is
the document-partitioning step in front of RAG, search and LLM pipelines: send a file, get JSON
back.

This template runs the official Unstructured API image as one service, pinned by digest, with a
public Railway domain and an API key generated for every deploy.

## About Hosting Unstructured API

- **The API is key-protected from the first request.** Upstream only enables authentication when
  `UNSTRUCTURED_API_KEY` is set; without it the endpoint is open to anyone who finds the URL. Here
  the key is generated for your deploy and the container refuses to start without it. Calls without
  the `unstructured-api-key` header get 401. `/healthcheck` stays open so Railway can check the
  service.
- **Nothing to fill in.** There are no required fields on the deploy form and no volume: the API
  keeps nothing between requests.
- **Thread count matches your plan.** The start command reads the container's CPU limit and caps
  the OpenMP, MKL and OpenBLAS thread pools to it, so layout and OCR work does not oversubscribe the
  shared host.
- **Size and memory.** The image is large (about 10 GB compressed), so the first deploy spends
  several minutes pulling it. The `hi_res` strategy loads layout models and uses much more memory
  than `fast`, so give the service room if you parse scanned or layout-heavy PDFs.
- **Long requests.** Railway's edge closes requests after about five minutes. Keep individual files
  small enough to finish inside that, or split large PDFs before sending.

## Common Use Cases

- Preparing PDFs, slides and Word files for a RAG or vector-search ingestion pipeline
- Extracting text, tables and titles from scanned documents and images with OCR
- Normalising emails, HTML and Markdown into one JSON schema for an LLM agent
- Giving no-code and automation tools (n8n, Flowise, Dify) a document-parsing endpoint

## Dependencies for Unstructured API Hosting

- None. A single service, no database and no volume.

### Deployment Dependencies

- Unstructured API: https://github.com/Unstructured-IO/unstructured-api
- Documentation: https://docs.unstructured.io/open-source/introduction/overview

### Implementation Details

| Variable | Purpose |
| --- | --- |
| `UNSTRUCTURED_API_KEY` | Key required in the `unstructured-api-key` header on every call except `/healthcheck`, generated per deploy. |

```sh
curl -X POST https:///general/v0/general \
  -H "unstructured-api-key: " \
  -F files=@report.pdf \
  -F strategy=hi_res
```

Strategies are `auto`, `fast`, `hi_res` and `ocr_only`. Interactive API docs are at
`/general/docs`. Inside the same Railway project use `http://unstructured-api.railway.internal:8080`
with the same header.

## Why Deploy Unstructured API on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your
infrastructure so you don't have to deal with configuration, while allowing you to vertically and
horizontally scale it.

By deploying Unstructured API on Railway, you are one step closer to supporting a complete
full-stack application with minimal burden. Host your servers, databases, AI agents, and more on
Railway.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/unstructured-api-or-just-updated-documen
