Developer
Documentation

Everything you need to integrate AutoDocs into your workflow. From quick starts to advanced API usage.

Getting Started

Welcome to AutoDocs! Generate professional documentation for your code in seconds.

🚀 Quick Start

Getting started with AutoDocs is simple. Here's how to generate your first documentation:

// Your JavaScript code function calculateTotal(items) { return items.reduce((sum, item) => sum + item.price, 0); } // Generated documentation: // ## calculateTotal(items) // Calculates the total price of all items in the provided array. // **Parameters:** items - Array of objects with price property // **Returns:** Number representing total price // **Example:** calculateTotal([{price: 10}, {price: 20}]) // Returns: 30

📋 What You Need

  • Code to document - Any programming language we support
  • API key - Get one by signing up for a paid plan
  • Basic HTTP knowledge - For API integration

🎯 Supported Languages

AutoDocs supports 50+ programming languages including:

JavaScript TypeScript Python Java C++ PHP Ruby Go

Authentication

Learn how to authenticate with the AutoDocs API

🔐 API Keys

All API requests require authentication using your API key. You can find your API key in your account dashboard after signing up.

🔒 Security Note: Keep your API key secure and never share it publicly. Rotate your keys regularly for maximum security.

📨 Request Headers

Include your API key in the Authorization header:

Authorization: Bearer your-api-key-here

🎫 Session Tokens

For web applications, use session tokens for authenticated requests:

// After login, store the session token localStorage.setItem('sessionToken', response.session_token); // Use in API requests headers: { 'Authorization': `Bearer ${sessionToken}` }

API Reference

Complete reference for all AutoDocs API endpoints

📝 Generate Documentation

Generate documentation from code text (demo endpoint - no auth required)

POST
/generate-docs

Parameters

Parameter Type Required Description
code string Yes The source code to generate documentation for
language string No Programming language (auto-detected if not provided)

Example Request

curl -X POST https://techwrite.lozz-riot.workers.dev/generate-docs \ -H "Content-Type: application/json" \ -d '{ "code": "function hello(name) { return \"Hello \" + name; }", "language": "javascript" }'

Example Response

{ "documentation": "## hello(name)\n\nReturns a greeting message...\n\n**Parameters:**\n- name: The name to greet\n\n**Returns:** Greeting string\n\n**Example:** hello(\"World\") // Returns: \"Hello World\"" }

📁 Generate from Files

Generate documentation from uploaded files (requires authentication)

POST
/generate-files

Authentication

Requires Bearer token authentication

Parameters

Multipart form data with file uploads

Parameter Type Description
files file[] Code files to analyze (max 10 files, 500KB each)
github string GitHub repository URL (alternative to file upload)

Rate Limits

Understanding AutoDocs usage limits and quotas

📊 Tier Limits

Tier Daily Requests Monthly Requests Features
Free 5 150 Demo only
Individual 50 1,500 Copy/paste interface
Pro 500 15,000 API access, GitHub integration
Enterprise Unlimited Unlimited All features, custom integrations

⚡ Rate Limiting

We implement smart rate limiting to prevent abuse:

  • Per-IP limits: 5 requests per day for demos
  • Burst protection: Max 10 requests per hour
  • Automatic blocking: Temporary blocks for excessive usage
  • Header information: Rate limit headers in responses
🚨 Rate Limit Exceeded: When you exceed limits, you'll receive a 429 status code with retry information.

Code Examples

Practical examples for integrating AutoDocs into your workflow

🚀 JavaScript Integration

Basic Usage

const API_KEY = 'your-api-key-here'; const API_URL = 'https://techwrite.lozz-riot.workers.dev'; async function generateDocs(code, language = 'javascript') { const response = await fetch(`${API_URL}/generate-docs`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${API_KEY}` }, body: JSON.stringify({ code, language }) }); const data = await response.json(); return data.documentation; } // Usage const code = ` function calculateTotal(items) { return items.reduce((sum, item) => sum + item.price, 0); } `; generateDocs(code).then(docs => { console.log(docs); });

React Hook

import { useState } from 'react'; function useAutoDocs() { const [loading, setLoading] = useState(false); const [error, setError] = useState(null); const generateDocs = async (code, language) => { setLoading(true); setError(null); try { const response = await fetch('/api/generate-docs', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ code, language }), }); if (!response.ok) { throw new Error('Failed to generate documentation'); } const data = await response.json(); return data.documentation; } catch (err) { setError(err.message); throw err; } finally { setLoading(false); } }; return { generateDocs, loading, error }; } // Usage in component function CodeEditor() { const { generateDocs, loading } = useAutoDocs(); const [code, setCode] = useState(''); const [docs, setDocs] = useState(''); const handleGenerate = async () => { const result = await generateDocs(code, 'javascript'); setDocs(result); }; return (