fix: point openzoo at the local x402 proxy; hosted endpoint needs a subscription key

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
staccDOTsol 2026-09-02 11:43:47 -04:00 • committed by Cursor Agent
parent 1200f0f49e
commit d2379c4877
No known key found for this signature in database
4 changed files with 13 additions and 13 deletions

View file

@ -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
]

View file

@ -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": {

View file

@ -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,

View file

@ -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