Skip to content

Conversation

@vdimarco
Copy link

@vdimarco vdimarco commented Nov 19, 2025

Summary

This PR adds support for Gatewayz as an LLM provider in the Zen API system. Gatewayz is a universal AI gateway that provides access to 50+ models across 13+ providers with circuit breakers, load balancing, and comprehensive monitoring.

Key Features

  • OpenAI-Compatible API: Seamlessly integrates with existing OpenAI-compatible endpoints
  • Universal Inference Gateway: Access to Claude, GPT, Llama, and 50+ other models
  • Advanced Monitoring: Real-time health checks, error detection, and automatic fallback routing
  • Token Usage Tracking: Full support for usage statistics and billing

Changes Made

  • Added gatewayz.ts provider helper with OpenAI-compatible format support
  • Updated provider registry to export Gatewayz helper for future customizations
  • Provider will automatically route through oa-compat format in the Zen handler

API Compatibility

  • Base URL: https://api.gatewayz.ai
  • Auth: Bearer token (X-API-Key header)
  • Endpoints:
    • /v1/chat/completions - Main inference endpoint
    • /v1/models - List available models
    • /health/* - System and provider health monitoring
  • Response Format: OpenAI-compatible JSON

Testing

Providers can be configured in the ZenData system by specifying:

  • id: Provider identifier (e.g., "gatewayz")
  • api: Base URL (https://api.gatewayz.ai)
  • format: "oa-compat"
  • apiKey: Bearer token from Gatewayz account

Add support for Gatewayz AI gateway as a provider in the Zen API system.
Gatewayz uses OpenAI-compatible API format and integrates seamlessly with
the existing provider infrastructure.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
toOaCompatibleRequest,
toOaCompatibleResponse,
} from "./openai-compatible"
import { gatewayzHelper } from "./gatewayz"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Gatewayz helper imported but never used

The gatewayzHelper is imported but never used or exported, meaning Gatewayz providers will incorrectly fall back to oaCompatHelper in the handler. This causes Gatewayz API calls to use the wrong endpoint path (/chat/completions instead of /v1/chat/completions), resulting in failed requests since Gatewayz requires the /v1 prefix according to the PR description.

Fix in Cursor Fix in Web

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 23 to 27
toOaCompatibleRequest,
toOaCompatibleResponse,
} from "./openai-compatible"
import { gatewayzHelper } from "./gatewayz"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Wire gatewayzHelper into provider selection

The new helper is imported but never used, so selectProvider still returns oaCompatHelper for every provider whose format is "oa-compat". When a Gatewayz provider is configured (base URL https://api.gatewayz.ai), requests will still call modifyUrl from oaCompatHelper and hit /chat/completions instead of the /v1/chat/completions endpoint defined in gatewayz.ts, and any future Gatewayz‑specific header logic will also be skipped. As a result the new provider will 404 or fail auth. This helper needs to be explicitly selected when the provider ID is Gatewayz.

Useful? React with 👍 / 👎.

@vdimarco vdimarco merged commit f017721 into dev Nov 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants