Minimal Python and JavaScript scripts that stream responses from Zeabur AI Hub models.
Zeabur AI Hub is the AI models Hub service in Zeabur, allowing you to access and integrate state-of-the-art AI models from multiple providers (like OpenAI, Anthropic, Google, and more) through a unified API and key. You can easily connect your applications to high-performance LLMs and deploy AI features globally with minimal setup.
Learn more in the official docs: https://zeabur.com/docs/ai-hub
- Grab your
ZEABUR_AI_HUB_API_KEYfrom the Zeabur AI Hub dashboard at https://zeabur.com/ai-hub#api-keys . - Pick the closest endpoint, for example
https://sfo1.aihub.zeabur.ai/, and adjust each script if needed. You can find all available endpoints at https://zeabur.com/ai-hub#api-endpoints .
cd python
python3.13 -m venv venv
pip install -r requirements.txt
ZEABUR_AI_HUB_API_KEY=sk-xxxxxxxx python openai-stream-chat.pycd js
pnpm i
ZEABUR_AI_HUB_API_KEY=sk-xxxxxxxx node openai-stream-chat.jsAll scripts stream responses to stdout; tweak the model, base_url or prompts as needed.