A Python starter for projects using AI APIs (OpenAI, Gemini, Anthropic, HuggingFace). Perfect for AI/ML, data, or backend-focused hacks.
- Python 3.10+
- FastAPI — quick REST API backend
- python-dotenv — for managing API keys safely
- Pre-configured for OpenAI / Gemini / Anthropic
git clone https://github.com/knighthacks/hackathon-starter-python
cd hackathon-starter-python
python -m venv venv
source venv/bin/activate # Mac/Linux
venv\Scripts\activate # Windows
pip install -r requirements.txt
cp .env.example .env # add your API keys here
python main.pyServer runs at http://localhost:8000
main.py ← FastAPI app entry point
routes/
chat.py ← example AI chat endpoint
services/
ai.py ← AI API calls live here
.env.example ← copy to .env, fill in your keys
requirements.txt
In .env:
OPENAI_API_KEY=sk-...
GEMINI_API_KEY=...
ANTHROPIC_API_KEY=sk-ant-...
- Push to GitHub
- Go to railway.app → New Project → Deploy from GitHub
- Add your
.envvariables in the Railway dashboard - Done — live URL ready to go!