Create the key
Create a workspace, open Workspace, and generate a key with parse and read scopes. The secret is shown once.
One authenticated endpoint turns the files your users already have into clean Markdown for retrieval and structured DocIR JSON for layout-aware product workflows.
Trial includes 20 text-based documents, 200 MB total, and a 20 MB per-file limit. Model-backed image, Fast AI, and Layout-aware modes require an approved paid workspace.
No connector setup and no SDK required. Create a scoped secret, send a multipart upload from your backend, and take the output your product needs.
Create a workspace, open Workspace, and generate a key with parse and read scopes. The secret is shown once.
Set DOCPARSE_API_KEY in your backend environment. Never commit it or expose it in browser code.
Use ?wait=true for a complete inline response while you prototype.
export DOCPARSE_URL="https://docparse.genedai.me" export DOCPARSE_API_KEY="your_key" curl -fsS -X POST \ "$DOCPARSE_URL/v1/parse?wait=true" \ -H "Authorization: Bearer $DOCPARSE_API_KEY" \ -F "file=@document.pdf" \ -F "mode=both" \ -o result.json jq -r '.result.markdown' result.json
result.markdownReadable content for chunking, search, and model context.result.documentDocIR pages and typed blocks for layout-aware logic.result.manifestRoute, parser versions, warnings, and artifact lineage.These examples call the REST API directly. They do not depend on a DocParse SDK, so the integration stays explicit and portable.
Node.js 20+ · native fetch
import fs from "node:fs";
const file = await fs.openAsBlob("document.pdf");
const form = new FormData();
form.set("file", file, "document.pdf");
form.set("mode", "both");
const response = await fetch(
process.env.DOCPARSE_URL +
"/v1/parse?wait=true",
{
method: "POST",
headers: {
Authorization:
"Bearer " + process.env.DOCPARSE_API_KEY
},
body: form
}
);
if (!response.ok) {
throw new Error(await response.text());
}
const { result } = await response.json();
console.log(result.markdown);
requests · multipart upload
import os
import requests
url = (
os.environ["DOCPARSE_URL"]
+ "/v1/parse?wait=true"
)
headers = {
"Authorization": "Bearer "
+ os.environ["DOCPARSE_API_KEY"]
}
with open("document.pdf", "rb") as file:
response = requests.post(
url,
headers=headers,
files={
"file": (
"document.pdf",
file,
"application/pdf",
)
},
data={"mode": "both"},
)
response.raise_for_status()
result = response.json()["result"]
print(result["markdown"])
The request body stays the same. Choose inline or async delivery based on latency, document complexity, and how your product handles background work.
The response contains the completed job and all three result artifacts.
A 202 response returns a job and result link while processing continues.
links.result or provide x-webhook-url.Idempotency-Key when callers may retry uploads.Choose the transport that matches where your file already lives. Trial uploads accept files up to 20 MB; approved paid workspaces accept up to 100 MB. HTTPS imports use tenant allowlists and tighter fetch limits.
multipart/form-dataUse the file field with optional mode and parsing options. This is the simplest default.
application/octet-streamSend the file body with x-filename and the correct content type.
application/jsonPass a permitted URL, name, MIME type, options, and optional webhook URL.
| Status | What it means |
|---|---|
| 200 | The inline parse completed, or a completed result was returned. |
| 202 | The job is queued, running, or retrying. Follow the returned links. |
| 403 | The workspace or API key is not allowed to use the requested capability. Trial keys cannot request model-backed modes. |
| 409 | An idempotency key conflicts with a different request, or the requested job was canceled. |
| 422 | The parser reached a terminal failure. Read the job errors and lifecycle events. |
| 429 | A tenant quota, concurrency limit, or daily AI capacity boundary was reached. Retry after the returned delay or use deterministic parsing. |
Parse your own files in the console, then create a scoped key and send the same workload through the API.