From c7e4e67b74fdf3840e50b71bfaca7c5da3dcea0f Mon Sep 17 00:00:00 2001 From: staccDOTsol Date: Tue, 1 Sep 2026 04:33:50 -0400 Subject: [PATCH 1/3] Add OpenZoo integration page --- integrations/openzoo.md | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 integrations/openzoo.md diff --git a/integrations/openzoo.md b/integrations/openzoo.md new file mode 100644 index 00000000..cd5d119c --- /dev/null +++ b/integrations/openzoo.md @@ -0,0 +1,68 @@ +--- +layout: integration +name: OpenZoo +description: Use OpenZoo's signup-free, pay-per-call OpenAI-compatible API in Haystack +authors: + - name: OpenZoo + socials: + github: staccDOTsol +pypi: https://pypi.org/project/haystack-ai/ +repo: https://github.com/staccDOTsol/openzoo-mcp-server +type: Model Provider +report_issue: https://github.com/staccDOTsol/openzoo-mcp-server/issues +version: Haystack 2.0 +toc: true +--- + +### **Table of Contents** + +- [Overview](#overview) +- [Usage](#usage) + +## Overview + +[OpenZoo](https://openzoo.fun) is an OpenAI-compatible inference provider with +no account or signup: any API key value is accepted, and usage is paid per +request — by card, or automatically via the x402 protocol when running the +local gateway (`npx openzoo`, serving `http://localhost:8402/v1`). + +Because the API is OpenAI-compatible, it works with Haystack's built-in +`OpenAIGenerator` and `OpenAIChatGenerator` — no extra package is needed. + +The model catalog at +[`https://api.openzoo.fun/v1/models`](https://api.openzoo.fun/v1/models) is +free to fetch and includes per-model pricing and context metadata. Model ids +are namespaced, e.g. `z-ai/glm-5.3-flash`. + +## Usage + +Install Haystack: + +```bash +pip install haystack-ai +``` + +Use OpenZoo with `OpenAIChatGenerator` by pointing `api_base_url` at the +endpoint. The API key can be any value (there is no signup): + +```python +from haystack.components.generators.chat import OpenAIChatGenerator +from haystack.dataclasses import ChatMessage +from haystack.utils import Secret + +generator = OpenAIChatGenerator( + api_key=Secret.from_token("sk-openzoo"), # any value works + api_base_url="https://api.openzoo.fun/v1", + model="z-ai/glm-5.3-flash", +) + +response = generator.run(messages=[ChatMessage.from_user("Explain x402 in one sentence.")]) +print(response["replies"][0].text) +``` + +For a fully local setup, run `npx openzoo` and set +`api_base_url="http://localhost:8402/v1"` — the gateway pays per call from a +local burner wallet. + +Streaming works through the standard `streaming_callback` parameter, since the +endpoint supports SSE. From 164474e0c2e1907a3bfbded7fc33fd1f7c0565c9 Mon Sep 17 00:00:00 2001 From: staccDOTsol Date: Wed, 2 Sep 2026 01:52:28 -0400 Subject: [PATCH 2/3] =?UTF-8?q?docs:=20openzoo=20=E2=80=94=20local=20proxy?= =?UTF-8?q?=20is=20the=20setup=20path;=20hosted=20endpoint=20needs=20a=20s?= =?UTF-8?q?ubscription=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- integrations/openzoo.md | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/integrations/openzoo.md b/integrations/openzoo.md index cd5d119c..8142aab3 100644 --- a/integrations/openzoo.md +++ b/integrations/openzoo.md @@ -1,7 +1,7 @@ --- layout: integration name: OpenZoo -description: Use OpenZoo's signup-free, pay-per-call OpenAI-compatible API in Haystack +description: Use OpenZoo's pay-per-call OpenAI-compatible API in Haystack via the local npx openzoo proxy authors: - name: OpenZoo socials: @@ -22,28 +22,32 @@ toc: true ## Overview [OpenZoo](https://openzoo.fun) is an OpenAI-compatible inference provider with -no account or signup: any API key value is accepted, and usage is paid per -request — by card, or automatically via the x402 protocol when running the -local gateway (`npx openzoo`, serving `http://localhost:8402/v1`). +no account or signup: a small local proxy (`npx openzoo`, serving +`http://localhost:8402/v1`) pays for each request via the x402 protocol from a +local burner wallet. The proxy ignores the API key, so any non-empty value +works. Because the API is OpenAI-compatible, it works with Haystack's built-in `OpenAIGenerator` and `OpenAIChatGenerator` — no extra package is needed. -The model catalog at -[`https://api.openzoo.fun/v1/models`](https://api.openzoo.fun/v1/models) is -free to fetch and includes per-model pricing and context metadata. Model ids -are namespaced, e.g. `z-ai/glm-5.3-flash`. +The model catalog at `http://localhost:8402/v1/models` is free to fetch and +includes per-model pricing and context metadata. Model ids are namespaced, +e.g. `z-ai/glm-5.3-flash`. ## Usage -Install Haystack: +Install Haystack and start the OpenZoo proxy: ```bash pip install haystack-ai +npx openzoo # serves http://localhost:8402/v1 ``` +`npx openzoo address` prints the proxy's wallet — fund it with USDC on Solana +or Base; `npx openzoo balance` shows what is left. + Use OpenZoo with `OpenAIChatGenerator` by pointing `api_base_url` at the -endpoint. The API key can be any value (there is no signup): +proxy. The API key can be any non-empty value (the proxy ignores it): ```python from haystack.components.generators.chat import OpenAIChatGenerator @@ -51,8 +55,8 @@ from haystack.dataclasses import ChatMessage from haystack.utils import Secret generator = OpenAIChatGenerator( - api_key=Secret.from_token("sk-openzoo"), # any value works - api_base_url="https://api.openzoo.fun/v1", + api_key=Secret.from_token("sk-openzoo"), # ignored by the proxy + api_base_url="http://localhost:8402/v1", model="z-ai/glm-5.3-flash", ) @@ -60,9 +64,9 @@ response = generator.run(messages=[ChatMessage.from_user("Explain x402 in one se print(response["replies"][0].text) ``` -For a fully local setup, run `npx openzoo` and set -`api_base_url="http://localhost:8402/v1"` — the gateway pays per call from a -local burner wallet. +The hosted endpoint `https://api.openzoo.fun/v1` answers HTTP 402 unless the +caller pays x402 or presents an OpenZoo subscription key (`ozk_live_…`); +Haystack cannot pay x402 itself, so use the local proxy. Streaming works through the standard `streaming_callback` parameter, since the endpoint supports SSE. From 5a143bf5b15a65c7d0aec0769c9c8b0549046ebf Mon Sep 17 00:00:00 2001 From: Jarett Dunn Date: Sat, 5 Sep 2026 11:04:14 +0000 Subject: [PATCH 3/3] docs: use bare model ids and the auto router in the OpenZoo example The OpenZoo catalog (GET /v1/models on the local proxy and on api.openzoo.fun) now publishes bare model ids such as claude-sonnet-5 and gpt-4o-mini plus an `auto` router; the OpenRouter-style `z-ai/glm-5.3-flash` id used here is no longer listed. Point the example at `auto` and describe the ids as they are served today. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01EzonbkWvkoz39cugD42AiH --- integrations/openzoo.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/integrations/openzoo.md b/integrations/openzoo.md index 8142aab3..77021b5d 100644 --- a/integrations/openzoo.md +++ b/integrations/openzoo.md @@ -31,8 +31,9 @@ Because the API is OpenAI-compatible, it works with Haystack's built-in `OpenAIGenerator` and `OpenAIChatGenerator` — no extra package is needed. The model catalog at `http://localhost:8402/v1/models` is free to fetch and -includes per-model pricing and context metadata. Model ids are namespaced, -e.g. `z-ai/glm-5.3-flash`. +includes per-model pricing and context metadata. Model ids are bare model +names, e.g. `claude-sonnet-5` or `gpt-4o-mini`; `auto` lets the proxy pick a +model per request. ## Usage @@ -57,7 +58,7 @@ from haystack.utils import Secret generator = OpenAIChatGenerator( api_key=Secret.from_token("sk-openzoo"), # ignored by the proxy api_base_url="http://localhost:8402/v1", - model="z-ai/glm-5.3-flash", + model="auto", ) response = generator.run(messages=[ChatMessage.from_user("Explain x402 in one sentence.")])