Base URL: {origin}/api/v1 (default local: http://127.0.0.1:8787/api/v1)
OpenAPI: {origin}/api/docs
GET /api/v1/agent-manifest
GET /.well-known/docforge.jsonReturns registration URLs, MCP tools, chunking defaults, documentation links, and example curl commands.
GET /api/v1/health{ "status": "ok", "version": "1.0.0", "timestamp": "…" }POST /api/v1/agents/register
Content-Type: application/json
{
"name": "my-rag-agent",
"description": "Optional",
"capabilities": ["ingest", "chunk", "convert"],
"webhook_url": "https://example.com/hook",
"metadata": { "team": "platform" }
}201 response includes api_key, cursor_config, mcp_env — store immediately.
409 if agent name already exists.
GET /api/v1/agentsPublic metadata only (no API keys).
GET /api/v1/agents/me
X-DocForge-Key: df_YOUR_KEYAll ingest endpoints accept multipart/form-data. Max upload size: 50 MB (configurable via DOCFORGE_MAX_UPLOAD_MB).
Optional auth header: X-DocForge-Key: df_…
POST /api/v1/ingest
X-DocForge-Key: df_YOUR_KEY
Content-Type: multipart/form-data
file=@report.pdf
strategy=headings
max_tokens=512
overlap_tokens=64
min_heading_level=1
max_heading_level=3
include_heading_path=true
token_model=cl100k_baseResponse fields:
| Field | Type | Description |
|---|---|---|
document_id |
UUID | Stable document identifier |
markdown |
string | Clean normalized Markdown |
chunks |
array | Chunk records with token estimates |
chunk_count |
int | Number of chunks |
total_chunk_tokens |
int | Sum of chunk token estimates |
token_estimate |
int | Full document token count |
config |
object | Chunk config used |
POST /api/v1/convert
Content-Type: multipart/form-data
file=@page.htmlPOST /api/v1/chunk
Content-Type: multipart/form-data
markdown=# Title
Body text…
strategy=size
max_tokens=512
overlap_tokens=64| Header | Format |
|---|---|
X-DocForge-Key |
df_<urlsafe-secret> |
Obtain via self-registration. Optional for ingest endpoints; required for /agents/me.
| Code | Meaning |
|---|---|
| 400 | Missing filename or invalid input |
| 401 | Invalid API key |
| 409 | Agent name conflict |
| 413 | File too large |
| 415 | Unsupported format |
Register:
curl -sS -X POST 'http://127.0.0.1:8787/api/v1/agents/register' \
-H 'content-type: application/json' \
-d '{"name":"demo-bot","capabilities":["ingest"]}'Ingest:
curl -sS -X POST 'http://127.0.0.1:8787/api/v1/ingest' \
-H 'X-DocForge-Key: df_YOUR_KEY' \
-F 'file=@document.pdf' \
-F 'strategy=headings' \
-F 'max_tokens=512'