For now, the Summarization API must be installed, set up, and hosted by whoever wants to use it. We have not yet deployed a publicly accessible hosted version. Developers need to run their own instance following the steps below.
- Prerequisites
- Installation**
- Configuration
- Running the API (Self-Hosting Required)
- Verifying the Setup
- Providing API Keys in Requests
- Next Steps
Before using the Summarization API, ensure you have the following:
- Node.js v20+ installed
- pnpm v10+ installed (pnpm installation guide)
git clone https://github.com/letssummarize/api.git
cd lets-summarize-apiUsing pnpm:
pnpm installCreate a .env file in the project root and add the following configuration:
# OpenAI API Key for summarization (Optional if provided in request headers)
OPENAI_API_KEY=
# DeepSeek API Key for summarization (Optional if provided in request headers)
DEEPSEEK_API_KEY=
# Origins that are allowed to use the AI models keys provided by the API, seperate them using a comma
# instead of need to provide them as Authorization in each request from client
ALLOWED_ORIGINS=http://localhost:3001,http://localhost:3000
# Max Tokens (Limit the response length)
OPENAI_MAX_TOKENS=500
DEEPSEEK_MAX_TOKENS=1000
# AWS S3 Configuration (Optional to store text-to-speech audio files)
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=us-east-1
AWS_S3_BUCKET=
USE_S3=falseNote: API keys (
OPENAI_API_KEYandDEEPSEEK_API_KEY) are not required in.envif the client application provides one of them in theAuthorizationheader of API requests.
Below is a breakdown of the .env variables and their functions:
| Variable | Description | Required? | Default Value |
|---|---|---|---|
NODE_ENV |
Node.js environment (development, production, etc.) | ❌ No | None |
OPENAI_API_KEY |
API key for using OpenAI GPT-4o, Whisper, and TTS-1 models. Only works if the origin is listed in the ALLOWED_ORIGINS. (can be provided in request headers instead) |
❌ No | None |
DEEPSEEK_API_KEY |
API key for using DeepSeek Chat (DeepSeek-V3). Only works if the origin is listed in the ALLOWED_ORIGINS. (can be provided in request headers instead) |
❌ No | None |
ALLOWED_ORIGINS |
Specifies the allowed frontend origins that can access API-provided keys | ❌ No | http://localhost:3001 |
OPENAI_MAX_TOKENS |
Maximum token limit for OpenAI-generated responses | ❌ No | 500 |
DEEPSEEK_MAX_TOKENS |
Maximum token limit for DeepSeek-generated responses | ❌ No | 1000 |
AWS_ACCESS_KEY_ID |
AWS Access Key for S3 storage (for text-to-speech audio files) | USE_S3 is true |
None |
AWS_SECRET_ACCESS_KEY |
AWS Secret Key for S3 storage | USE_S3 is true |
None |
AWS_REGION |
AWS region where the S3 bucket is located | USE_S3 is true |
us-east-1 |
AWS_S3_BUCKET |
S3 bucket name for storing generated audio files | USE_S3 is true |
None |
USE_S3 |
Whether to store text-to-speech audio files on AWS S3 | USE_S3 is true |
false |
Summary:
- If using only OpenAI, provide
OPENAI_API_KEYin.envor in the request headers.- If using only DeepSeek, provide
DEEPSEEK_API_KEYin.envor in the request headers.- If both are provided, the API allows selection between models.
- If
USE_S3istrue, ensure all AWS credentials are correctly set.
pnpm run start:devBy default, the API will be available at:
http://localhost:3000
pnpm run build
pnpm startReminder: Since there is no hosted version available yet, you need to deploy this API on your own server, cloud service, or containerized environment.
Once the API is running, you can test the health check endpoint:
curl -X GET http://localhost:3000/Response:
{ "message": "Hello there." }If you don't want to store API keys in .env, you can pass them dynamically in the request headers:
curl -X POST http://localhost:3000/summarize/text \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "content": { "text": "This is a test." } }'Now that your API is running, proceed with:
- Authentication – Secure API access with keys
- API Endpoints – Learn how to use the API
- Summarization Customization – Fine-tune summaries