feat: add GatewayZ provider with Anthropic API support#4
feat: add GatewayZ provider with Anthropic API support#4vdimarco wants to merge 32 commits intonumman-ali:mainfrom
Conversation
Add api.gatewayz.ai/v1 as a new provider supporting the Anthropic /messages API endpoint. Changes: - Add gatewayz provider template with baseUrl, env config, and apiKey auth - Create GatewayZ Portal brand theme (violet/purple palette with cyan accents) - Add provider education content with setup links and feature descriptions - Include gatewayz in fullySupported providers list - Add comprehensive test for gatewayz brand configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…flags in package-lock.json Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
Update documentation to include GatewayZ in: - Intro paragraph - Features list - Quick setup examples - Supported providers table - CLI options - Brand themes list 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add startup ASCII art for GatewayZ provider with: - Purple/violet color gradient (primary, secondary, accent, dim) - Cyan accent for the "Z" in GatewayZ - "Your Portal to Claude" tagline - Diamond separator matching other providers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The base URL was defined in the provider template but not included in the env configuration, causing 404 errors when making API requests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GatewayZ API expects Authorization: Bearer header, not x-api-key. Change authMode to 'authToken' so ANTHROPIC_AUTH_TOKEN is used. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GatewayZ routes through OpenRouter, so it needs model mapping like OpenRouter. Updated: - Added requiresModelMapping: true to provider config - Updated provider education to reflect model mapping requirement - Updated README with correct usage example showing model flags - Moved gatewayz from fullySupported to requiresMapping category 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GatewayZ uses OneRouter, not OpenRouter directly. Updated references in provider config, TUI education content, and README. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updated model IDs to use OneRouter format (e.g., claude-opus-4-5-@20251101) instead of OpenRouter format (anthropic/claude-*). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixed two locations where gatewayz was missing from model mapping support: - WriteConfigStep now uses provider.requiresModelMapping instead of hardcoded 'openrouter' check for model validation warnings - VariantActionsScreen MODEL_MAPPING_PROVIDERS now includes 'gatewayz' so users can configure models from the variant actions menu 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added OneRouter model ID placeholders for GatewayZ provider so users see the correct format when configuring models during setup. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updated features to highlight: - 10,000 models via Gatewayz API - Maximum throughput and lowest latency - Lowest pay-per-use pricing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changed from hardcoded ANTHROPIC_AUTH_TOKEN/ANTHROPIC_API_KEY to use the provider's apiKeyLabel (e.g., "GatewayZ API key") for better UX. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When GatewayZ is selected as provider, the model configuration screen now auto-fills with the correct OneRouter model IDs instead of showing empty fields with placeholders: - Opus: claude-opus-4-5-@20251101 - Sonnet: claude-sonnet-4-@20250514 - Haiku: claude-haiku-3-5-@20241022 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updated GatewayZ model IDs to use direct Anthropic gateway format: - claude-opus-4-5-20251101 - claude-sonnet-4-20250514 - claude-haiku-3-5-20241022 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…provider-lv7bg1 feat: add GatewayZ provider with Anthropic API support and Portal theme
Added PROVIDER_MODEL_DEFAULTS for GatewayZ so CLI quick setup works without requiring --model-* flags. GatewayZ will now automatically use: - claude-sonnet-4-20250514 - claude-opus-4-5-20251101 - claude-haiku-3-5-20241022 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…provider-lv7bg1 Add Anthropic defaults for Gatewayz provider
|
Awesome PR I might not merge immediately as I have some other work I'm doing Do you care if I take the work and commit it myself or would you rather have the contribution stamp? |
There was a problem hiding this comment.
Pull request overview
This PR adds GatewayZ as a new provider for CC-MIRROR, enabling access to 10,000+ AI models through the GatewayZ gateway API using Anthropic-compatible endpoints. The implementation follows the existing provider pattern and includes comprehensive TUI/CLI support, brand theming, and documentation.
Key changes:
- New GatewayZ provider configuration with
authTokenauthentication mode and model mapping requirements - Purple/violet themed brand assets including ASCII splash screen and custom theme colors
- Auto-fill model defaults for seamless CLI/TUI setup experience
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/providers/index.ts |
Adds GatewayZ provider template with base URL, auth mode, and environment configuration |
src/brands/gatewayz.ts |
New brand theme with violet/purple color palette and gateway-themed thinking verbs |
src/brands/index.ts |
Registers GatewayZ brand preset |
src/tui/app.tsx |
Critical bug: Incorrectly uses apiKeyLabel for envVarName parameter; adds model default auto-fill logic |
src/tui/screens/ModelConfigScreen.tsx |
Adds GatewayZ model placeholders for TUI input fields |
src/tui/screens/VariantActionsScreen.tsx |
Includes GatewayZ in model mapping providers list |
src/tui/content/providers.ts |
Adds provider education content with features and setup links |
src/cli/utils/modelOverrides.ts |
Implements provider-specific model defaults for CLI quick setup |
src/core/wrapper.ts |
Adds purple/violet gradient ASCII splash screen for GatewayZ |
src/core/variant-builder/steps/WriteConfigStep.ts |
Generalizes model mapping check to use requiresModelMapping property |
test/core.test.ts |
Adds comprehensive test coverage for GatewayZ variant creation |
README.md |
Documents GatewayZ in provider list, quick start examples, and CLI options |
CHANGELOG.md |
Minor markdown formatting fix (unrelated to GatewayZ feature) |
package-lock.json |
Version bump and peer dependency cleanup (standard maintenance) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/tui/content/providers.ts
Outdated
| headline: 'GatewayZ — Your Gateway to AI', | ||
| tagline: 'Your Gateway to AI', | ||
| features: [ | ||
| 'Access to 10,000 models via Gatewayz API', |
There was a problem hiding this comment.
Inconsistent capitalization: "Gatewayz API" should be "GatewayZ API" to match the brand name used everywhere else in the codebase (e.g., line 81 "GatewayZ — Your Gateway to AI").
| 'Access to 10,000 models via Gatewayz API', | |
| 'Access to 10,000 models via GatewayZ API', |
| const getDefaultModels = (key?: string | null): { opus: string; sonnet: string; haiku: string } => { | ||
| if (key === 'gatewayz') { | ||
| return { | ||
| opus: 'claude-opus-4-5-20251101', | ||
| sonnet: 'claude-sonnet-4-20250514', | ||
| haiku: 'claude-haiku-3-5-20241022', | ||
| }; |
There was a problem hiding this comment.
The GatewayZ model defaults are duplicated in three places: here in getDefaultModels, in ModelConfigScreen.tsx getPlaceholder, and in modelOverrides.ts PROVIDER_MODEL_DEFAULTS. This duplication creates a maintenance burden and risk of inconsistency. Consider centralizing these defaults in a shared constant, possibly in the provider definition itself or in a dedicated constants file.
| const getDefaultModels = (key?: string | null): { opus: string; sonnet: string; haiku: string } => { | |
| if (key === 'gatewayz') { | |
| return { | |
| opus: 'claude-opus-4-5-20251101', | |
| sonnet: 'claude-sonnet-4-20250514', | |
| haiku: 'claude-haiku-3-5-20241022', | |
| }; | |
| const GATEWAYZ_DEFAULT_MODELS: { opus: string; sonnet: string; haiku: string } = { | |
| opus: 'claude-opus-4-5-20251101', | |
| sonnet: 'claude-sonnet-4-20250514', | |
| haiku: 'claude-haiku-3-5-20241022', | |
| }; | |
| const getDefaultModels = (key?: string | null): { opus: string; sonnet: string; haiku: string } => { | |
| if (key === 'gatewayz') { | |
| return GATEWAYZ_DEFAULT_MODELS; |
src/cli/utils/modelOverrides.ts
Outdated
| }; | ||
|
|
||
| /** | ||
| * Ensure model mapping for providers that require it (e.g., OpenRouter, LiteLLM) |
There was a problem hiding this comment.
The comment references "OpenRouter, LiteLLM" as examples but should be updated to include GatewayZ or be more generic since GatewayZ also requires model mapping. Consider updating to "providers that require model mapping" or explicitly listing all applicable providers.
| * Ensure model mapping for providers that require it (e.g., OpenRouter, LiteLLM) | |
| * Ensure model mapping for providers that require explicit model mapping |
README.md
Outdated
| --model-sonnet <name> Map to sonnet model (for OpenRouter) | ||
| --model-opus <name> Map to opus model (for OpenRouter) | ||
| --model-haiku <name> Map to haiku model (for OpenRouter) |
There was a problem hiding this comment.
The comments "(for OpenRouter)" on these model mapping options are outdated. These flags now apply to multiple providers that require model mapping, including GatewayZ. Consider updating to "(for providers requiring model mapping)" or removing the parenthetical entirely since the usage is documented elsewhere.
| --model-sonnet <name> Map to sonnet model (for OpenRouter) | |
| --model-opus <name> Map to opus model (for OpenRouter) | |
| --model-haiku <name> Map to haiku model (for OpenRouter) | |
| --model-sonnet <name> Map to sonnet model (for providers requiring model mapping) | |
| --model-opus <name> Map to opus model (for providers requiring model mapping) | |
| --model-haiku <name> Map to haiku model (for providers requiring model mapping) |
| providerLabel={provider?.label || 'Provider'} | ||
| providerKey={providerKey || undefined} | ||
| envVarName={provider?.authMode === 'authToken' ? 'ANTHROPIC_AUTH_TOKEN' : 'ANTHROPIC_API_KEY'} | ||
| envVarName={provider?.apiKeyLabel || 'API Key'} |
There was a problem hiding this comment.
The envVarName parameter expects an environment variable name (like ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY), but this change passes provider?.apiKeyLabel which contains human-readable text like "GatewayZ API key". This will display incorrectly in the MaskedInput component where envVarName is shown as a label.
The original logic should be preserved: provider?.authMode === 'authToken' ? 'ANTHROPIC_AUTH_TOKEN' : 'ANTHROPIC_API_KEY'
| envVarName={provider?.apiKeyLabel || 'API Key'} | |
| envVarName={provider?.authMode === 'authToken' ? 'ANTHROPIC_AUTH_TOKEN' : 'ANTHROPIC_API_KEY'} |
| providerLabel={provider?.label || 'Provider'} | ||
| providerKey={providerKey || undefined} | ||
| envVarName={provider?.authMode === 'authToken' ? 'ANTHROPIC_AUTH_TOKEN' : 'ANTHROPIC_API_KEY'} | ||
| envVarName={provider?.apiKeyLabel || 'API Key'} |
There was a problem hiding this comment.
The envVarName parameter expects an environment variable name (like ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY), but this change passes provider?.apiKeyLabel which contains human-readable text like "GatewayZ API key". This will display incorrectly in the MaskedInput component where envVarName is shown as a label.
The original logic should be preserved: provider?.authMode === 'authToken' ? 'ANTHROPIC_AUTH_TOKEN' : 'ANTHROPIC_API_KEY'
| envVarName={provider?.apiKeyLabel || 'API Key'} | |
| envVarName={provider?.authMode === 'authToken' ? 'ANTHROPIC_AUTH_TOKEN' : 'ANTHROPIC_API_KEY'} |
- Fix capitalization: 'Gatewayz API' -> 'GatewayZ API' in providers.ts - Update modelOverrides.ts comment to be more generic - Update README model flag comments to mention 'providers requiring model mapping' Note: Keeping apiKeyLabel for envVarName intentionally as it provides better UX by showing "GatewayZ API key" instead of "ANTHROPIC_AUTH_TOKEN" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addressing Copilot Review CommentsFixed ✅
Intentionally Kept
|
- Fix capitalization: 'Gatewayz API' -> 'GatewayZ API' in providers.ts - Update modelOverrides.ts comment to be more generic - Update README model flag comments to mention 'providers requiring model mapping' Note: Keeping apiKeyLabel for envVarName intentionally as it provides better UX by showing "GatewayZ API key" instead of "ANTHROPIC_AUTH_TOKEN" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…provider-lv7bg1 Add Anthropic API support for GatewayZ and update docs
Resolves merge conflicts by integrating GatewayZ provider support alongside the existing mirror provider and team mode functionality: - Add GatewayZ provider with purple/violet theme - Include GatewayZ in provider comparisons and brand themes - Add GatewayZ test coverage for variant creation - Update CLI options to include gatewayz provider - Update model mapping comments for all providers requiring mapping 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Merge Conflicts Resolved 🎉I've resolved the merge conflicts between the GatewayZ provider feature and the existing mirror/team mode features. The changes have been pushed to the branch What was merged:
Copilot Review Comments:All review comments have been addressed as documented in the previous comment:
Tests:287 out of 291 tests pass. The 4 failing tests are pre-existing in the base branch (related to TUI navigation changes from the mirror/team mode features) and are not caused by this merge. Friendly reminder: We're eager to get this merged when you have time! The GatewayZ integration is ready to go 🚀 Let us know if there's anything else needed. |
Integrates GatewayZ provider from upstream with the existing mirror provider and team mode features: - Add GatewayZ provider with purple/violet theme - Include GatewayZ in provider comparisons and brand themes - Add GatewayZ test coverage for variant creation - Update CLI options to include gatewayz provider - Merge team mode, orchestrator skill, and task management features 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update: Merge Conflicts Resolved ✅The merge conflicts have now been fully resolved! The PR status should now show Changes can be cleanly merged. What was resolved:
The GatewayZ provider is now fully integrated with all the existing team mode and mirror provider features. Friendly reminder: We're eager to get this merged when you have time! 🚀 Everything is ready to go. |
Add input validation for the --older-than CLI option in the tasks clean command. Previously, passing a non-numeric value (e.g., --older-than=abc) would result in NaN, causing all tasks to be silently filtered out since any comparison with NaN returns false. This led to confusing "No tasks match" messages instead of a clear error. Now validates that: - The value is a valid number - The value is non-negative 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update package-lock.json to reflect correct version 1.6.2 matching package.json. The lockfile had stale version 1.0.4. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Ready for Merge ✅All commits from Alpaca-Network/cc-mirror are ready to be merged into numman-ali/cc-mirror: Commits included in this PR:
Changes integrated:
The PR is marked as MERGEABLE. Please merge to sync all commits to the source repo. |
Merge fix-merge-conflicts: add Team Mode, Mirror Claude, and Tasks CLI
Similar to the --older-than fix, this adds validation for the --limit option in tasks list command to prevent NaN from silently breaking the limit logic. Also requires positive integer input. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Merge upstream changes including: - Claude Code 2.1.12 upgrade - Windows wrapper improvements - CI/CD workflow and coverage improvements - Team mode gating (now legacy feature) - Maintainer state tracking - Test stabilization and coverage Preserves fork-specific changes: - GatewayZ provider support with purple theme - Model mapping documentation enhancements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Claude Code Action workflows require CLAUDE_CODE_OAUTH_TOKEN secret to be configured. Add conditional check so the step gracefully skips when the secret is not available, instead of failing the entire check. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add escapeRegExp helper to properly escape function names before using them in RegExp constructor to prevent regex failures if the name contains special characters like $, [, ], etc. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
I'm doing a stacked PR here, really appreciate this |
|
Will update and test before releasing |
Sync latest upstream commits and docs (legacy team mode gating)
Summary
Adds GatewayZ as a new provider with direct Anthropic API support via
https://api.gatewayz.ai/v1, enabling access to 10,000+ models through the GatewayZ gateway.Changes
Provider Configuration
authTokenmode andrequiresModelMapping: trueANTHROPIC_BASE_URLset tohttps://api.gatewayz.ai/v1for direct Anthropic messages APIclaude-sonnet-4-20250514,claude-opus-4-5-20251101,claude-haiku-3-5-20241022Brand & Theme
TUI/CLI Improvements
MODEL_MAPPING_PROVIDERSfor variant actions menuWriteConfigStepto useprovider.requiresModelMappinginstead of hardcoded provider checkDocumentation
Test plan
npm testpasses for GatewayZ-related testsnpm run dev -- quick --provider gatewayz --api-key "test" --yesworks without requiring model flagsANTHROPIC_BASE_URL,ANTHROPIC_AUTH_TOKEN, and model defaults🤖 Generated with Claude Code