Skip to content

About

OpenAI-compatible Python and Node.js starter, production migration checklist, and AI workflow cost calculator.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

WoofAPI OpenAI-Compatible Starter

Minimal Python and Node.js examples for testing an OpenAI-compatible endpoint, plus a small workflow-cost calculator.

Live 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.

Migration guide and community

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.

Why this repository exists

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.

API endpoint

https://api.woofapi.com/v1

Never commit API keys. All examples read keys from environment variables.

Python quick start

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.py

PowerShell:

$env:WOOFAPI_API_KEY="your-key"
$env:WOOFAPI_MODEL="your-model-name"
python python/chat.py

Node.js quick start

npm install
export WOOFAPI_API_KEY="your-key"
export WOOFAPI_MODEL="your-model-name"
npm run chat

Calculate workflow cost

python tools/workflow_cost.py --total-cost 18 --successful 82 --attempted 100 --retries 34

Example output:

Success rate: 82.00%
Cost per successful workflow: 0.2195
Retries per attempted workflow: 0.3400

Pricing note

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.

Disclosure

This starter is maintained for WoofAPI users and examples.

License

MIT

About

OpenAI-compatible Python and Node.js starter, production migration checklist, and AI workflow cost calculator.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages