- Convert files to markdown using Microsoft's markitdown via REST API
- OpenAI integration with customizable host and model
- Authentication with API key
Variable | Description |
---|---|
API_KEY | Your secret API key for authentication |
ALLOWED_ORIGINS | Comma-separated list of allowed origins |
OPENAI_API_BASE | Base URL for OpenAI API (optional) |
OPENAI_API_KEY | Your OpenAI API key (optional) |
OPENAI_MODEL | The model to use for OpenAI API (optional) |
DOCS_ENABLED | Enable Swagger/ReDoc docs (default: true) |
Copy .env.example to .env and set your values if you're doing this locally.
python generate_api_key.py
docker pull ghcr.io/climactic/markitdown-api:latest
docker run -d -p 8000:8000 -e API_KEY=<your_api_key> ghcr.io/climactic/markitdown-api:latest
Or use the docker-compose.prod.yml file to start the container.
- Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Run the application:
python run.py
The API will be available at http://localhost:8000
.
- Build and start the Docker container:
docker-compose up -d
The API will be available at http://localhost:8000
.
POST /convert
Request:
- Upload a markdown file
Headers:
- X-API-Key: your_api_key (if authentication is enabled)
GET /health
Response:
{
"status": "healthy"
}
When the API is running, you can access the interactive API documentation at:
- Swagger UI:
http://localhost:8000/docs
- ReDoc:
http://localhost:8000/redoc
Sponsors are welcome to support the development of this project.
You can sponsor us on GitHub Sponsors.
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.