Minimal Python and Node.js examples for testing an OpenAI-compatible endpoint, plus a small workflow-cost calculator.
Use the free browser tool: https://zcl97630815-cpu.github.io/woofapi-openai-compatible-starter/
It calculates success rate, retry load, cost per successful workflow, monthly forecast, and an optional same-benchmark route comparison. All calculations run locally in the browser.
- 30-minute production migration guide: https://zcl97630815-cpu.github.io/woofapi-openai-compatible-starter/openai-compatible-api-migration.html
- Stable release: https://github.com/zcl97630815-cpu/woofapi-openai-compatible-starter/releases/tag/v1.0.0
- Benchmark discussion: #1
The discussion is open for compatibility reports, retry behavior, P95 data, and workflow-cost comparisons. Do not post API keys, private prompts, or customer data.
A successful test prompt proves connectivity, not production readiness. Before moving a Dify, RAG, or AI-agent workflow, test:
- streaming and finish reasons;
- JSON output and tool/function calling;
- model-name mappings;
- 401, 404, 429, timeout, and retry handling;
- success rate, P95 latency, and cost per successful workflow.
https://api.woofapi.com/v1
Never commit API keys. All examples read keys from environment variables.
python -m venv .venv
# Windows: .venv\Scripts\activate
# macOS/Linux: source .venv/bin/activate
pip install -r requirements.txt
export WOOFAPI_API_KEY="your-key"
export WOOFAPI_MODEL="your-model-name"
python python/chat.pyPowerShell:
$env:WOOFAPI_API_KEY="your-key"
$env:WOOFAPI_MODEL="your-model-name"
python python/chat.pynpm install
export WOOFAPI_API_KEY="your-key"
export WOOFAPI_MODEL="your-model-name"
npm run chatpython tools/workflow_cost.py --total-cost 18 --successful 82 --attempted 100 --retries 34Example output:
Success rate: 82.00%
Cost per successful workflow: 0.2195
Retries per attempted workflow: 0.3400
Selected WoofAPI GPT routes can be up to about 95% lower in specific official input-price comparisons. Pricing varies by model, input/output billing, and live route. Check the current pricing page and benchmark your own workload before production.
- Website: https://woofapi.com
- API base URL: https://api.woofapi.com/v1
This starter is maintained for WoofAPI users and examples.
MIT