From d2379c48778f1b5fd8c004642df4127d1b3b6715 Mon Sep 17 00:00:00 2001 From: staccDOTsol Date: Wed, 2 Sep 2026 11:43:47 -0400 Subject: [PATCH] fix: point openzoo at the local x402 proxy; hosted endpoint needs a subscription key Co-Authored-By: Claude Fable 5.1 --- litellm/constants.py | 2 +- litellm/llms/openai_like/providers.json | 2 +- .../public_endpoints/provider_create_fields.json | 6 +++--- .../llms/openai_like/test_openzoo_provider.py | 16 ++++++++-------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/litellm/constants.py b/litellm/constants.py index cfa68f07535..f4820d9a1dd 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -938,7 +938,7 @@ openai_compatible_endpoints: Final[list] = [ "https://api.cognition.ai/v1", "https://api.scx.ai/v1", "https://gigachat.devices.sberbank.ru/api/v1", - "https://api.openzoo.fun/v1", + "http://localhost:8402/v1", # openzoo: local `npx openzoo` x402 proxy; hosted api.openzoo.fun needs an ozk_live_ key ] diff --git a/litellm/llms/openai_like/providers.json b/litellm/llms/openai_like/providers.json index efce2d1d8cc..653d6d587a5 100644 --- a/litellm/llms/openai_like/providers.json +++ b/litellm/llms/openai_like/providers.json @@ -202,7 +202,7 @@ "supported_endpoints": ["/v1/chat/completions"] }, "openzoo": { - "base_url": "https://api.openzoo.fun/v1", + "base_url": "http://localhost:8402/v1", "api_key_env": "OPENZOO_API_KEY", "api_base_env": "OPENZOO_API_BASE", "param_mappings": { diff --git a/litellm/proxy/public_endpoints/provider_create_fields.json b/litellm/proxy/public_endpoints/provider_create_fields.json index c3859bc90d1..dcc604dc604 100644 --- a/litellm/proxy/public_endpoints/provider_create_fields.json +++ b/litellm/proxy/public_endpoints/provider_create_fields.json @@ -3021,8 +3021,8 @@ { "key": "api_base", "label": "API Base", - "placeholder": "https://api.openzoo.fun/v1", - "tooltip": null, + "placeholder": "http://localhost:8402/v1", + "tooltip": "Defaults to the local npx openzoo proxy. The hosted https://api.openzoo.fun/v1 answers 402 unless the API key is an OpenZoo subscription key (ozk_live_...).", "required": false, "field_type": "text", "options": null, @@ -3032,7 +3032,7 @@ "key": "api_key", "label": "API Key", "placeholder": "sk-openzoo", - "tooltip": "OpenZoo does not require signup. Any key value works; usage is billed per call.", + "tooltip": "The local npx openzoo proxy ignores the key (it pays per call over x402), so any value such as sk-openzoo works. Only the hosted endpoint needs a real ozk_live_ subscription key.", "required": true, "field_type": "password", "options": null, diff --git a/tests/test_litellm/llms/openai_like/test_openzoo_provider.py b/tests/test_litellm/llms/openai_like/test_openzoo_provider.py index d25df7eacdd..db77e105ad8 100644 --- a/tests/test_litellm/llms/openai_like/test_openzoo_provider.py +++ b/tests/test_litellm/llms/openai_like/test_openzoo_provider.py @@ -20,7 +20,7 @@ class TestOpenZooProviderConfig: openzoo = JSONProviderRegistry.get("openzoo") assert openzoo is not None - assert openzoo.base_url == "https://api.openzoo.fun/v1" + assert openzoo.base_url == "http://localhost:8402/v1" assert openzoo.api_key_env == "OPENZOO_API_KEY" assert openzoo.param_mappings.get("max_completion_tokens") == "max_tokens" @@ -41,7 +41,7 @@ class TestOpenZooProviderConfig: assert model == "z-ai/glm-5.3-flash" assert provider == "openzoo" - assert api_base == "https://api.openzoo.fun/v1" + assert api_base == "http://localhost:8402/v1" def test_openzoo_api_base_override(self): from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider @@ -49,13 +49,13 @@ class TestOpenZooProviderConfig: model, provider, api_key, api_base = get_llm_provider( model="openzoo/z-ai/glm-5.3-flash", custom_llm_provider=None, - api_base="http://localhost:8402/v1", - api_key="sk-openzoo", + api_base="https://api.openzoo.fun/v1", + api_key="ozk_live_example", ) assert provider == "openzoo" - assert api_base == "http://localhost:8402/v1" - assert api_key == "sk-openzoo" + assert api_base == "https://api.openzoo.fun/v1" + assert api_key == "ozk_live_example" def test_openzoo_url_autodetection(self): from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider @@ -63,11 +63,11 @@ class TestOpenZooProviderConfig: model, provider, api_key, api_base = get_llm_provider( model="z-ai/glm-5.3-flash", custom_llm_provider=None, - api_base="https://api.openzoo.fun/v1", + api_base="http://localhost:8402/v1", api_key=None, ) assert provider == "openzoo" - assert api_base == "https://api.openzoo.fun/v1" + assert api_base == "http://localhost:8402/v1" def test_openzoo_temperature_passthrough(self): from litellm.llms.openai_like.dynamic_config import create_config_class