Everything you need to integrate AutoDocs into your workflow. From quick starts to advanced API usage.
Welcome to AutoDocs! Generate professional documentation for your code in seconds.
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
AutoDocs supports 50+ programming languages including:
Learn how to authenticate with the AutoDocs API
All API requests require authentication using your API key. You can find your API key in your account dashboard after signing up.
Include your API key in the Authorization header:
Authorization: Bearer your-api-key-here
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}`
}
Complete reference for all AutoDocs API endpoints
Generate documentation from code text (demo endpoint - no auth required)
| Parameter | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | The source code to generate documentation for |
| language | string | No | Programming language (auto-detected if not provided) |
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"
}'
{
"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 documentation from uploaded files (requires authentication)
Requires Bearer token authentication
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) |
Understanding AutoDocs usage limits and quotas
| 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 |
We implement smart rate limiting to prevent abuse:
Practical examples for integrating AutoDocs into your workflow
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);
});
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 (
);
}
import requests
class AutoDocsClient:
def __init__(self, api_key):
self.api_key = api_key
self.base_url = 'https://techwrite.lozz-riot.workers.dev'
def generate_docs(self, code, language='python'):
"""Generate documentation for code"""
response = requests.post(
f'{self.base_url}/generate-docs',
json={'code': code, 'language': language},
headers={'Authorization': f'Bearer {self.api_key}'}
)
response.raise_for_status()
return response.json()['documentation']
# Usage
client = AutoDocsClient('your-api-key')
code = '''
def calculate_total(items):
"""Calculate total price of items"""
return sum(item['price'] for item in items)
'''
docs = client.generate_docs(code, 'python')
print(docs)
curl -X POST https://techwrite.lozz-riot.workers.dev/generate-docs \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-api-key" \
-d '{
"code": "function hello(name) { return \"Hello \" + name; }",
"language": "javascript"
}'
curl -X POST https://techwrite.lozz-riot.workers.dev/generate-files \
-H "Authorization: Bearer your-session-token" \
-F "files=@main.js" \
-F "files=@utils.js"
Common issues and how to resolve them
Cause: Invalid or missing API key
Solution: Check your API key is correct and included in the Authorization header
Cause: Too many requests
Solution: Wait for the rate limit to reset or upgrade your plan
Cause: Code file too large
Solution: Reduce file size or split into smaller files
Cause: Server-side issue
Solution: Try again later or contact support
If you're still having issues:
Latest updates and improvements to AutoDocs