POST /api/generate
Generates a professional README file for a GitHub repository using AI. The endpoint analyzes the repository structure, files, and content to create comprehensive documentation.Authentication
This endpoint requires authentication. Include valid Clerk authentication credentials in your request.Request queueing
The endpoint implements a request queue system with a maximum of 20 concurrent requests. If the queue is full, the endpoint returns a 429 status code. Requests are processed sequentially to manage server load.Request body
The GitHub repository URL to generate a README for. Must be a valid GitHub repository URL in the format:
https://github.com/username/repositoryResponse
The generated README content in Markdown format
The number of tokens used from the repository content analysis
The number of tokens in the generated README
Any warnings generated during repository analysis
Repository size and token limits
Maximum file size that can be processed
Maximum total repository size
Maximum number of files that can be processed
Maximum directory depth that will be analyzed
Maximum input tokens allowed (default: 900,000)
Position in the request queue (only returned if request is queued)
Queue status message (only returned if request is queued)
Code examples
Response examples
Error responses
Error message describing what went wrong
Status codes
Invalid repository URL, repository not found, or token limit exceededCommon errors:
Invalid repository URL. Please provide a valid GitHub repository URL in the format: https://github.com/username/repositoryRepository content exceeds maximum token limit of 900,000 tokens (estimated X tokens)
Authentication required. User must be signed in.Error message:
Authentication required. Please sign in to generate README files.
Insufficient credits to generate READMEError message:
Insufficient credits. Please purchase more credits to continue.
Server is at maximum capacity. The request queue is full.Error message:
🚦 Server is busy. Please try again in a few moments.
Server error during README generationCommon errors:
OpenRouter API key is not configured. Please set OPENROUTER_API_KEY in your environment variables.Error processing repository. Please check the URL and try again.API rate limit exceeded. Please try again later.Request timed out. Please try a smaller repository.
Credits
Each successful README generation consumes 1 credit from your account. Credits are deducted after the README is successfully generated. If generation fails, no credits are consumed.Repository requirements
- Must be a public GitHub repository
- Repository URL must use HTTPS protocol
- Maximum repository size and file count are enforced (see limits in response)
- Maximum input tokens: 900,000 (approximately 675,000 words)
AI model
README files are generated using Google’s Gemini 2.5 Pro model via OpenRouter. The AI analyzes:- Repository structure and file tree
- Source code content
- Project metadata
- Existing documentation
- Project title and description
- DeepWiki badge for interactive documentation
- Installation instructions
- Usage examples
- API documentation (if applicable)
- Contributing guidelines
- License information