This is a sample project demonstrating how to use the Heurist API, featuring demo code for image generation and LLM conversation capabilities. One API key for various text and image models. Supports dozens of mainstream text-to-text and text-to-image models. Full documentation: Heurist Dev Doc. Official TG: Heurist Ecosystem Builder
- Image Generation (using FLUX.1-dev model) 🖼️
- LLM Conversation (using meta-llama/llama-3.3-70b-instruct model) 💬
- Supports both Python and JavaScript/Node.js implementations 🐍/🟦
- Python 3.6+ or Node.js 12+
- Heurist API key
- Clone the repository:
git clone git@github.com:flashclub/awesome-heurist.git
cd awesome-heurist
- Install dependencies:
For Python:
pip install -r requirements.txt
For Node.js:
npm install
- Configure environment variables:
Create a .env file and add your API key:
HEURIST_API_KEY=your_api_key_here
Using Python:
python image.py
Using Node.js:
node image.js
# or use the SDK version
node image-with-sdk.js
Using Python:
python llm.py
Using Node.js:
node llm.js
The project provides two ways to generate images:
- Direct API calls (image.py/image.js)
- Using Heurist SDK (image-with-sdk.js)
Supports simple conversations with LLM models, using meta-llama/llama-3.3-70b-instruct
model by default.
- got error "Invalid auth_key format": add double quotes in .env file like this API_KEY="abc#123", some systems might recognize # as a code comment and ignore it
- Keep your API key secure 🔒
- API calls may incur charges, please refer to Heurist's pricing policy 💰
- Consider adding error handling and retry mechanisms in production environments 🔄
- Request API key (2,000–10,000 free credits): request form, invite code: ai16z
ISC