{"id":21646155,"url":"https://github.com/dehyabi/textor-ai","last_synced_at":"2026-02-13T10:15:23.586Z","repository":{"id":264416702,"uuid":"893314119","full_name":"dehyabi/textor-ai","owner":"dehyabi","description":"A powerful Speech-to-Text API built with Django REST Framework and AssemblyAI. Textor-AI provides enterprise-grade transcription capabilities with advanced features like multi-language support, real-time status tracking, and comprehensive transcription management.","archived":false,"fork":false,"pushed_at":"2024-11-24T08:47:27.000Z","size":165,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T15:35:17.229Z","etag":null,"topics":["ai","api","assemblyai","containerization","django","django-application","django-rest-framework","docker","dockerfile","heroku","heroku-app","heroku-deployment","python3","pythonanywhere","render","render-deployment","speech-recognition","speech-to-text","textor-ai","textorai"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dehyabi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-24T05:11:53.000Z","updated_at":"2024-12-31T06:21:38.000Z","dependencies_parsed_at":"2025-03-19T21:39:25.968Z","dependency_job_id":"2fc19013-d967-41d7-b741-c985acb9cd03","html_url":"https://github.com/dehyabi/textor-ai","commit_stats":null,"previous_names":["dehyabi/textor-ai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dehyabi/textor-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dehyabi%2Ftextor-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dehyabi%2Ftextor-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dehyabi%2Ftextor-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dehyabi%2Ftextor-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dehyabi","download_url":"https://codeload.github.com/dehyabi/textor-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dehyabi%2Ftextor-ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272527446,"owners_count":24949840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","api","assemblyai","containerization","django","django-application","django-rest-framework","docker","dockerfile","heroku","heroku-app","heroku-deployment","python3","pythonanywhere","render","render-deployment","speech-recognition","speech-to-text","textor-ai","textorai"],"created_at":"2024-11-25T06:37:49.957Z","updated_at":"2026-02-13T10:15:18.551Z","avatar_url":"https://github.com/dehyabi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Textor-AI\n\nA powerful Speech-to-Text API built with Django REST Framework and AssemblyAI. Textor-AI provides enterprise-grade transcription capabilities with advanced features like multi-language support, real-time status tracking, and comprehensive transcription management.\n\n## Features\n\n- 🎯 High-accuracy speech-to-text conversion\n- 🌍 Multi-language transcription support\n- 📊 Real-time transcription status tracking\n- 🔄 Automatic synchronization with AssemblyAI\n- 🔐 Secure token-based authentication\n- 📱 RESTful API with comprehensive documentation\n- 📂 Support for multiple audio formats\n- 📋 Grouped transcription listing with pagination\n- ⚡ Rate limiting and error handling\n\n## Setup\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/dehyabi/textor-ai.git\ncd textor-ai\n```\n\n2. Create and activate a virtual environment:\n```bash\npython3 -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n\n3. Install dependencies:\n```bash\npip install -r requirements.txt\n```\n\n4. Create a `.env` file in the project root and add your AssemblyAI API key:\n```\nASSEMBLYAI_API_KEY=your_api_key_here\n```\n\n5. Run migrations:\n```bash\npython3 manage.py migrate\n```\n\n6. Create a superuser:\n```bash\npython3 manage.py createsuperuser\n```\n\n7. Run the server:\n```bash\npython3 manage.py runserver\n```\n\n## Deployment\n\n### Prerequisites\n- Heroku CLI installed\n- Git repository initialized\n- AssemblyAI API key\n- PostgreSQL installed locally (for testing)\n\n### Local Deployment Testing\nBefore deploying to Heroku, test your deployment locally:\n\n1. Install all requirements:\n```bash\npip install -r requirements.txt\n```\n\n2. Create a .env file with required variables:\n```bash\nDJANGO_SECRET_KEY=your-secret-key\nDJANGO_DEBUG=True\nASSEMBLYAI_API_KEY=your-assemblyai-api-key\nDJANGO_ALLOWED_HOSTS=localhost,127.0.0.1\n```\n\n3. Test with gunicorn locally:\n```bash\ngunicorn speech_to_text_api.wsgi:application\n```\n\n### Heroku Deployment\n\n1. Install the Heroku CLI and login:\n```bash\ncurl https://cli-assets.heroku.com/install.sh | sh\nheroku login\n```\n\n2. Create a new Heroku app:\n```bash\nheroku create textor-ai\n```\n\n3. Add PostgreSQL addon:\n```bash\nheroku addons:create heroku-postgresql:mini\n```\n\n4. Configure environment variables:\n```bash\n# Generate a secure secret key\npython -c \"from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())\"\n\n# Set environment variables\nheroku config:set DJANGO_SECRET_KEY=\u003cgenerated-secret-key\u003e\nheroku config:set DJANGO_DEBUG=False\nheroku config:set ASSEMBLYAI_API_KEY=your-assemblyai-api-key\nheroku config:set DJANGO_ALLOWED_HOSTS=your-app-name.herokuapp.com\nheroku config:set CORS_ALLOWED_ORIGINS=https://your-frontend-domain.com\n```\n\n5. Deploy to Heroku:\n```bash\n# Add Heroku remote\nheroku git:remote -a your-app-name\n\n# Push to Heroku\ngit push heroku main\n```\n\n6. Run migrations and create superuser:\n```bash\nheroku run python manage.py migrate\nheroku run python manage.py createsuperuser\n```\n\n7. Verify deployment:\n```bash\n# Open the app in browser\nheroku open\n\n# Check logs for any errors\nheroku logs --tail\n```\n\n### Render Deployment\n\n#### Quick Deploy\n\n1. Fork this repository to your GitHub account.\n\n2. Visit [Render.com](https://render.com) and create an account if you haven't already.\n\n3. Click the \"New +\" button and select \"Blueprint\" from the dropdown.\n\n4. Connect your GitHub account and select your forked repository.\n\n5. Render will automatically detect the `render.yaml` configuration and set up your services.\n\n6. Set your AssemblyAI API key in the environment variables:\n   - Go to your web service settings\n   - Click on \"Environment\"\n   - Add `ASSEMBLYAI_API_KEY` with your API key\n\n7. Your app will be deployed automatically. The URL will be: `https://textor-ai.onrender.com`\n\n#### Manual Deployment\n\n1. Visit [Render.com](https://render.com) and create an account.\n\n2. Click the \"New +\" button and select \"Web Service\".\n\n3. Connect your GitHub repository.\n\n4. Fill in the following settings:\n   - **Name**: textor-ai\n   - **Environment**: Python\n   - **Region**: Oregon (or your preferred region)\n   - **Branch**: main\n   - **Build Command**: `pip install -r requirements.txt`\n   - **Start Command**: `gunicorn speech_to_text_api.wsgi:application --bind 0.0.0.0:$PORT --workers 4 --threads 2`\n\n5. Add the following environment variables:\n   ```\n   PYTHON_VERSION=3.10.12\n   DJANGO_DEBUG=False\n   DJANGO_ALLOWED_HOSTS=.onrender.com\n   DJANGO_SETTINGS_MODULE=speech_to_text_api.settings\n   ASSEMBLYAI_API_KEY=your-api-key\n   ```\n\n6. Create a PostgreSQL database:\n   - Click \"New +\" and select \"PostgreSQL\"\n   - Choose the \"Starter\" plan\n   - Note the internal database URL\n\n7. Add the database URL to your web service:\n   - Go back to your web service settings\n   - Add `DATABASE_URL` with the internal database URL\n\n#### Post-Deployment\n\n1. Run migrations:\n   ```bash\n   # Using Render Shell\n   python manage.py migrate\n   ```\n\n2. Create a superuser:\n   ```bash\n   # Using Render Shell\n   python manage.py createsuperuser\n   ```\n\n#### Monitoring\n\n1. View logs:\n   - Go to your web service dashboard\n   - Click on \"Logs\" in the left sidebar\n\n2. Monitor metrics:\n   - Click on \"Metrics\" in the left sidebar\n   - View CPU, Memory, and Network usage\n\n#### Troubleshooting\n\n1. If static files are not serving:\n   ```bash\n   # Using Render Shell\n   python manage.py collectstatic --noinput\n   ```\n\n2. If you need to restart the service:\n   - Go to your web service dashboard\n   - Click \"Manual Deploy\" \u003e \"Deploy latest commit\"\n\n3. Check application logs for errors:\n   - Go to your web service dashboard\n   - Click on \"Logs\"\n   - Select \"All\" to view all log types\n\n### Container Deployment\n\nTextor-AI supports both traditional and containerized deployment on Heroku.\n\n#### Option 1: Traditional Deployment\n\nFollow the standard Heroku deployment steps mentioned above.\n\n#### Option 2: Container Deployment\n\n1. Install the Heroku CLI and login:\n```bash\ncurl https://cli-assets.heroku.com/install.sh | sh\nheroku login\nheroku container:login\n```\n\n2. Create a new Heroku app:\n```bash\nheroku create textor-ai\n```\n\n3. Set stack to container:\n```bash\nheroku stack:set container\n```\n\n4. Configure environment variables:\n```bash\nheroku config:set DJANGO_SECRET_KEY=$(python -c \"from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())\")\nheroku config:set DJANGO_DEBUG=False\nheroku config:set ASSEMBLYAI_API_KEY=your-assemblyai-api-key\nheroku config:set DJANGO_ALLOWED_HOSTS=your-app-name.herokuapp.com\n```\n\n5. Push and release the container:\n```bash\n# Build and push the container\nheroku container:push web\n\n# Release the container\nheroku container:release web\n```\n\n6. Run migrations:\n```bash\nheroku run python manage.py migrate\n```\n\n#### Container Development\n\nFor local development with Docker:\n\n1. Build the container:\n```bash\ndocker build -t textor-ai .\n```\n\n2. Run the container:\n```bash\ndocker run -p 8000:8000 \\\n  -e PORT=8000 \\\n  -e DJANGO_SECRET_KEY=your-secret-key \\\n  -e DJANGO_DEBUG=True \\\n  -e ASSEMBLYAI_API_KEY=your-api-key \\\n  -e DJANGO_ALLOWED_HOSTS=localhost \\\n  textor-ai\n```\n\n3. Run tests in container:\n```bash\ndocker run textor-ai python manage.py test\n```\n\n#### Container Configuration\n\nThe container is configured with:\n- Python 3.10.12 slim base image\n- Non-root user for security\n- Optimized gunicorn settings\n- Static file collection\n- Health checks\n- Environment variable configuration\n\nKey container features:\n- Multi-stage builds for smaller images\n- Security best practices\n- Performance optimizations\n- Health monitoring\n- Automatic migrations\n- Static file handling\n\n#### Container Scaling\n\n1. Scale horizontally:\n```bash\nheroku ps:scale web=3\n```\n\n2. Scale vertically:\n```bash\nheroku ps:resize web=standard-2x\n```\n\n3. Enable auto-scaling:\n```bash\nheroku addons:create adept-scale:basic\n```\n\n#### Container Monitoring\n\n1. View container metrics:\n```bash\n# View container status\nheroku container:status\n\n# View container logs\nheroku logs --tail\n\n# View process metrics\nheroku ps:metrics\n```\n\n2. Container health checks:\n```bash\n# Check container health\ncurl https://your-app-name.herokuapp.com/health/\n\n# View detailed metrics\nheroku ps:metrics --json\n```\n\n### PythonAnywhere Deployment\n\n### Prerequisites\n- A PythonAnywhere account ([Sign up here](https://www.pythonanywhere.com/))\n- Git repository with your code\n- AssemblyAI API key\n\n### Deployment Steps\n\n1. Log in to PythonAnywhere and open a Bash console.\n\n2. Clone your repository:\n```bash\ngit clone https://github.com/yourusername/textor-ai.git\ncd textor-ai\n```\n\n3. Create and activate a virtual environment:\n```bash\nmkvirtualenv --python=/usr/bin/python3.10 textor-ai\nworkon textor-ai\n```\n\n4. Install dependencies:\n```bash\npip install -r requirements.txt\n```\n\n5. Create a new web app:\n   - Go to the Web tab\n   - Click \"Add a new web app\"\n   - Choose \"Manual configuration\"\n   - Select Python 3.10\n   - Note your domain name (e.g., yourusername.pythonanywhere.com)\n\n6. Configure the virtual environment:\n   - In the Web tab, under \"Virtualenv:\"\n   - Enter: `/home/yourusername/.virtualenvs/textor-ai`\n\n7. Configure WSGI file:\n   - Click on the WSGI configuration file link\n   - Delete everything\n   - Copy content from `pythonanywhere_wsgi.py`\n   - Update `path` variable with your username\n   - Save the file\n\n8. Set up static files:\n   - In the Web tab, add:\n     ```\n     URL: /static/\n     Directory: /home/yourusername/textor-ai/staticfiles\n     ```\n\n9. Create and configure environment variables:\n   - Go to the Web tab\n   - Under \"Environment variables\", add:\n     ```\n     DJANGO_SECRET_KEY=your-secret-key\n     DJANGO_DEBUG=False\n     DJANGO_ALLOWED_HOSTS=yourusername.pythonanywhere.com\n     ASSEMBLYAI_API_KEY=your-assemblyai-api-key\n     ```\n\n10. Set up the database:\n    ```bash\n    # In PythonAnywhere console\n    python manage.py migrate\n    python manage.py createsuperuser\n    ```\n\n11. Collect static files:\n    ```bash\n    python manage.py collectstatic --noinput\n    ```\n\n12. Configure CORS:\n    - Add your domain to `ALLOWED_HOSTS` in settings.py\n    - Add your frontend domain to `CORS_ALLOWED_ORIGINS` if needed\n\n13. Reload the web app:\n    - Go to the Web tab\n    - Click the \"Reload\" button\n\n### File Permissions\n\nMake sure files have correct permissions:\n```bash\nchmod 755 /home/yourusername/textor-ai\nchmod 755 /home/yourusername/textor-ai/be\nchmod 644 /home/yourusername/textor-ai/be/db.sqlite3\n```\n\n### Database Setup\n\nPythonAnywhere provides MySQL by default. To use it:\n\n1. Go to the Databases tab\n2. Initialize MySQL and set a password\n3. Create a new database:\n```sql\nCREATE DATABASE textor_ai CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\n```\n\n4. Update your environment variables with the database URL:\n```\nDATABASE_URL=mysql://yourusername:password@yourusername.mysql.pythonanywhere-services.com/textor_ai\n```\n\n### Scheduled Tasks\n\nSet up database backups:\n1. Go to the Tasks tab\n2. Add a daily task:\n```bash\nmysqldump -u yourusername -p'password' textor_ai \u003e /home/yourusername/backups/textor_ai_$(date +%Y%m%d).sql\n```\n\n### SSL/HTTPS\n\nFor SSL (PythonAnywhere Business accounts):\n1. Go to the Web tab\n2. Enable \"Force HTTPS\"\n3. Update your ALLOWED_HOSTS and CORS settings accordingly\n\n### Troubleshooting\n\n1. Check error logs:\n   - Go to the Web tab\n   - Click \"Error log\" link\n\n2. Check access logs:\n   - Go to the Web tab\n   - Click \"Access log\" link\n\n3. Common issues:\n   - **Static files not loading**: Check paths in Web tab\n   - **502 Bad Gateway**: Check error logs and WSGI file\n   - **Database errors**: Check database URL and migrations\n   - **Import errors**: Check virtual environment and requirements\n\n4. Reload after changes:\n   - Always click \"Reload\" in Web tab after making changes\n   - Some changes require server restart\n\n### Updating the Application\n\n1. Pull latest changes:\n```bash\ncd ~/textor-ai\ngit pull origin main\n```\n\n2. Update dependencies:\n```bash\nworkon textor-ai\npip install -r requirements.txt\n```\n\n3. Run migrations:\n```bash\npython manage.py migrate\n```\n\n4. Collect static files:\n```bash\npython manage.py collectstatic --noinput\n```\n\n5. Reload the web app in the Web tab\n\n### Production Checklist\n\n- [ ] Generate new Django secret key\n- [ ] Set DEBUG to False\n- [ ] Configure allowed hosts\n- [ ] Set up CORS properly\n- [ ] Configure SSL/HTTPS\n- [ ] Set up proper database backup\n- [ ] Configure rate limiting\n- [ ] Set up monitoring\n- [ ] Configure error logging\n\n### Production Configuration\n\n#### Monitoring and Error Tracking\n\n1. Set up Sentry for error tracking:\n```bash\nheroku config:set SENTRY_DSN=your-sentry-dsn\n```\n\n2. Enable application monitoring:\n```bash\n# Add New Relic\nheroku addons:create newrelic:wayne\n# Add Papertrail for log management\nheroku addons:create papertrail:choklad\n```\n\n#### Performance Optimization\n\n1. Configure Redis caching:\n```bash\n# Add Redis\nheroku addons:create heroku-redis:mini\n\n# Set cache configuration\nheroku config:set REDIS_URL=$(heroku config:get REDIS_TLS_URL)\n```\n\n2. Set up AWS S3 for file storage:\n```bash\nheroku config:set AWS_ACCESS_KEY_ID=your-access-key\nheroku config:set AWS_SECRET_ACCESS_KEY=your-secret-key\nheroku config:set AWS_STORAGE_BUCKET_NAME=your-bucket-name\nheroku config:set AWS_S3_REGION_NAME=your-region\n```\n\n#### Security Configuration\n\n1. Enable SSL:\n```bash\nheroku config:set SECURE_SSL_REDIRECT=True\nheroku config:set SECURE_PROXY_SSL_HEADER=True\n```\n\n2. Set security headers:\n```bash\nheroku config:set SECURE_HSTS_SECONDS=31536000\nheroku config:set SECURE_HSTS_INCLUDE_SUBDOMAINS=True\nheroku config:set SECURE_HSTS_PRELOAD=True\n```\n\n#### Scaling\n\n1. Scale web dynos:\n```bash\n# Scale to 2 dynos\nheroku ps:scale web=2:basic\n\n# Enable auto-scaling\nheroku addons:create adept-scale:basic\n```\n\n2. Database maintenance:\n```bash\n# Enable automatic backups\nheroku pg:backups:schedule DATABASE_URL --at '02:00 UTC'\n\n# Manual backup\nheroku pg:backups:capture\n\n# Download latest backup\nheroku pg:backups:download\n```\n\n#### Health Checks\n\nThe application includes Django Health Check. Access health status at:\n- `/health/`: Overall health status\n- `/health/db/`: Database connectivity\n- `/health/cache/`: Cache service status\n- `/health/storage/`: Storage service status\n\n#### Maintenance Mode\n\nTo enable maintenance mode:\n```bash\nheroku maintenance:on\n```\n\nTo disable:\n```bash\nheroku maintenance:off\n```\n\n#### Logging and Debugging\n\nView application logs:\n```bash\n# View recent logs\nheroku logs --tail\n\n# Filter logs\nheroku logs --source app --tail\nheroku logs --source heroku --tail\n\n# Search logs\nheroku logs --grep \"Error|Exception\" --tail\n```\n\n#### Performance Monitoring\n\n1. View application metrics:\n```bash\n# View dyno status\nheroku ps\n\n# View resource usage\nheroku ps:utilization\n\n# View response times\nheroku logs:router --tail\n```\n\n2. Database monitoring:\n```bash\n# View database status\nheroku pg:info\n\n# View database connections\nheroku pg:ps\n\n# View slow queries\nheroku pg:outliers\n```\n\n#### Backup and Recovery\n\n1. Database backups:\n```bash\n# Create manual backup\nheroku pg:backups:capture\n\n# Download backup\nheroku pg:backups:download\n\n# List backups\nheroku pg:backups\n\n# Restore from backup\nheroku pg:backups:restore b101 DATABASE_URL\n```\n\n2. Application rollback:\n```bash\n# View release history\nheroku releases\n\n# Rollback to previous release\nheroku rollback v102\n```\n\n## Environment Variables\n\nThe following environment variables are required:\n\n- `DJANGO_SECRET_KEY`: Django secret key\n- `DJANGO_DEBUG`: Set to 'False' in production\n- `ASSEMBLYAI_API_KEY`: Your AssemblyAI API key\n- `DJANGO_ALLOWED_HOSTS`: Comma-separated list of allowed hosts\n- `CORS_ALLOWED_ORIGINS`: Comma-separated list of allowed CORS origins\n- `DATABASE_URL`: Set automatically by Heroku PostgreSQL addon\n\n## Authentication\n\nAuthentication is optional but recommended for higher rate limits. The API uses token-based authentication.\n\n**With Authentication:**\n```bash\ncurl -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  http://localhost:8000/api/transcribe/\n```\n\n**Without Authentication:**\n```bash\ncurl http://localhost:8000/api/transcribe/\n```\n\nSee [Rate Limiting](#rate-limiting) section for details on request limits.\n\n### Obtaining an Authentication Token\n\nTo get higher rate limits, you can obtain an authentication token:\n\n1. Create a user account through the Django admin interface\n2. Generate a token for your user\n3. Include the token in your API requests using the Authorization header\n\n## API Endpoints\n\n### 1. Upload Audio for Transcription\n- **URL:** `/api/transcribe/upload/`\n- **Method:** `POST`\n- **Authentication:** Optional\n- **Content-Type:** `multipart/form-data`\n- **Constraints:**\n  - Maximum file size: 5MB\n  - Supported formats: MP3, WAV, M4A, AAC, OGG, FLAC\n- **Parameters:**\n  - `file`: Audio file (required)\n  - `language_code`: ISO language code (optional)\n  - `auto_detect`: Boolean to enable language auto-detection (optional, default: true)\n- **Example:**\n```bash\ncurl -X POST \\\n  -H \"Authorization: Bearer your_token\" \\\n  -F \"file=@audio.mp3\" \\\n  -F \"language_code=en\" \\\n  http://localhost:8000/api/transcribe/upload/\n```\n- **Response:**\n```json\n{\n    \"message\": \"File uploaded and transcription started\",\n    \"transcript_id\": \"abc123xyz\",\n    \"status\": \"queued\"\n}\n```\n\n### 2. List Transcriptions\n\n**Endpoint:** `GET /api/transcribe/`\n\nList all transcriptions for the authenticated user, grouped by status. Results are paginated.\n\n**Parameters:**\n- `page`: Page number (default: 1)\n- `page_size`: Number of items per page (default: 10, max: 100)\n\n**Example Request:**\n```bash\ncurl -X GET \\\n  'http://localhost:8000/api/transcribe/?page=1\u0026page_size=10' \\\n  -H 'Authorization: Bearer YOUR_TOKEN'\n```\n- **Response:**\n```json\n{\n    \"count\": 15,\n    \"next\": \"http://localhost:8000/api/transcribe/?page=2\u0026page_size=10\",\n    \"previous\": null,\n    \"current_page\": 1,\n    \"total_pages\": 2,\n    \"total_count\": 3,\n    \"status_counts\": {\n        \"queued\": 1,\n        \"processing\": 1,\n        \"completed\": 1,\n        \"error\": 0\n    },\n    \"transcriptions\": {\n        \"queued\": [{\n            \"id\": \"abc123\",\n            \"text\": null,\n            \"audio_url\": \"https://example.com/audio1.mp3\",\n            \"language_code\": \"en\",\n            \"created_at\": \"2024-01-24T10:30:00Z\",\n            \"completed_at\": null,\n            \"error\": null,\n            \"status\": \"queued\"\n        }],\n        \"processing\": [{\n            \"id\": \"def456\",\n            \"text\": null,\n            \"audio_url\": \"https://example.com/audio2.mp3\",\n            \"language_code\": \"es\",\n            \"created_at\": \"2024-01-24T10:35:00Z\",\n            \"completed_at\": null,\n            \"error\": null,\n            \"status\": \"processing\"\n        }],\n        \"completed\": [{\n            \"id\": \"ghi789\",\n            \"text\": \"Your transcribed text here...\",\n            \"audio_url\": \"https://example.com/audio3.mp3\",\n            \"language_code\": \"en\",\n            \"created_at\": \"2024-01-24T10:25:00Z\",\n            \"completed_at\": \"2024-01-24T10:27:00Z\",\n            \"error\": null,\n            \"status\": \"completed\"\n        }],\n        \"error\": []\n    }\n}\n```\n\nThe response includes:\n- `count`: Total number of transcriptions across all pages\n- `next`: URL for the next page (null if on last page)\n- `previous`: URL for the previous page (null if on first page)\n- `current_page`: Current page number\n- `total_pages`: Total number of pages available\n- `total_count`: Number of transcriptions in the current response\n- `status_counts`: Counts for each status in the current response\n- `transcriptions`: Grouped transcriptions for the current page\n\n### 3. Get Transcription Status\n- **URL:** `/api/transcribe/{transcript_id}/`\n- **Method:** `GET`\n- **Authentication:** Optional\n- **Example:**\n```bash\ncurl -H \"Authorization: Bearer your_token\" \\\n  http://localhost:8000/api/transcribe/abc123/\n```\n- **Response:**\n```json\n{\n    \"id\": \"abc123\",\n    \"status\": \"completed\",\n    \"text\": \"Your transcribed text here...\",\n    \"audio_url\": \"https://example.com/audio.mp3\",\n    \"language_code\": \"en\",\n    \"created_at\": \"2024-01-24T10:30:00Z\",\n    \"completed_at\": \"2024-01-24T10:32:00Z\"\n}\n```\n\n### 4. Get All Transcriptions (Flat List)\n- **URL:** `/api/transcribe/`\n- **Method:** `GET`\n- **Authentication:** Optional\n- **Description:** Returns all transcriptions in a single flat list, sorted by creation date (newest first)\n- **Example:**\n```bash\ncurl -H \"Authorization: Bearer your_token\" \\\n  http://localhost:8000/api/transcribe/\n```\n- **Response:**\n```json\n{\n    \"count\": 3,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": \"abc123\",\n            \"text\": \"Your transcribed text here...\",\n            \"audio_url\": \"https://example.com/audio1.mp3\",\n            \"language_code\": \"en\",\n            \"created_at\": \"2024-01-24T10:30:00Z\",\n            \"completed_at\": \"2024-01-24T10:32:00Z\",\n            \"status\": \"completed\",\n            \"error\": null\n        },\n        {\n            \"id\": \"def456\",\n            \"text\": null,\n            \"audio_url\": \"https://example.com/audio2.mp3\",\n            \"language_code\": \"es\",\n            \"created_at\": \"2024-01-24T10:35:00Z\",\n            \"completed_at\": null,\n            \"status\": \"processing\",\n            \"error\": null\n        }\n    ]\n}\n```\n\n## Rate Limiting\n\nThe API implements rate limiting to ensure fair usage:\n\n- **Authenticated Users:**\n  - 25 requests per day\n  - Resets at midnight UTC\n  - Access to all transcriptions\n  - Full pagination support\n  - Rate limit headers included in response\n\n- **Anonymous Users:**\n  - 5 requests per day\n  - Resets at midnight UTC\n  - Limited to viewing 5 most recent transcriptions\n  - Same upload capabilities as authenticated users\n  - Consider authentication for full access\n\n**Rate Limit Response Headers:**\n```\nX-RateLimit-Limit: 25\nX-RateLimit-Remaining: 24\nX-RateLimit-Reset: 1706745600\n```\n\nWhen rate limit is exceeded, the API returns:\n```json\n{\n    \"detail\": \"Request limit exceeded. Please try again tomorrow.\"\n}\n```\n\n## Status Definitions\n\n- **Queued**: The file has been uploaded and is waiting to be processed\n- **Processing**: AssemblyAI is currently transcribing the audio\n- **Completed**: Transcription is finished and text is available\n- **Error**: An error occurred during transcription\n\n## Error Handling\n\nThe API returns appropriate HTTP status codes and error messages:\n\n- 400: Bad Request (invalid input)\n- 401: Unauthorized (invalid or missing token)\n- 403: Forbidden (insufficient permissions)\n- 404: Not Found\n- 500: Internal Server Error\n\nError responses include detailed messages:\n```json\n{\n    \"error\": \"Error message here\",\n    \"details\": \"Additional error details if available\"\n}\n```\n\n## File Requirements\n\n- Maximum file size: 5MB\n- Supported formats: MP3, WAV, M4A, and other common audio formats\n- Clear audio quality recommended for best results\n\n## Security Features\n\n- Token-based authentication required for all endpoints\n- File size validation\n- Automatic temporary file cleanup\n- Rate limiting on transcription requests\n- Secure handling of API keys and tokens\n\n## Development\n\nTo run tests:\n```bash\npython3 manage.py test\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\nThe MIT License is a permissive license that is short and to the point. It lets people do anything they want with your code as long as they provide attribution back to you and don't hold you liable.\n\n### Key Points:\n- ✓ Commercial use\n- ✓ Modification\n- ✓ Distribution\n- ✓ Private use\n- ✓ Liability limitations\n- ✓ Warranty limitations\n\n### Requirements:\n- License and copyright notice must be included with the code\n- The same license must be used for derivatives\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdehyabi%2Ftextor-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdehyabi%2Ftextor-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdehyabi%2Ftextor-ai/lists"}