Skip to content

DevEverything01/cli-anything-new-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cli-anything-new-api

A CLI harness for managing New API instances — the AI API gateway that aggregates 40+ upstream providers behind a unified API.

Built with the cli-anything methodology.

What's Included

Path Description
cli_anything/new_api/ Python CLI tool (Click-based) with --json output
skills/new-api-manager/ Claude Code skill for agent-driven management
skills/new-api-manager.skill Packaged skill (ready to install)
AGENT_PROMPT.md System prompt for teaching agents to use the CLI

Quick Start

Install the CLI

pip install -e .

Authenticate

# Environment variables (recommended for agents)
export NEW_API_BASE_URL="https://your-server.com"
export NEW_API_TOKEN="sk-your-admin-token"

# Or interactive
cli-anything-new-api auth set-url https://your-server.com
cli-anything-new-api auth set-token sk-your-admin-token

Use

# System health
cli-anything-new-api --json system status

# List channels (provider integrations)
cli-anything-new-api --json channel list --status enabled

# Create a channel
cli-anything-new-api --json channel create \
  --name "GPT-4o" --type 1 --key "sk-xxx" --models "gpt-4o,gpt-4o-mini"

# Test connectivity
cli-anything-new-api --json channel test 1

# List API tokens
cli-anything-new-api --json token list

# Model pricing
cli-anything-new-api --json model pricing

All commands support --json for machine-readable output.

Install the Claude Code Skill

# From the packaged file
claude skill install skills/new-api-manager.skill

# Or point Claude Code at the skill directory
claude skill install skills/new-api-manager/

Once installed, Claude Code will automatically manage your New API instance when you ask about channels, tokens, models, or system settings.

Command Groups

Group Description
auth Login, logout, set URL/token
channel Provider integrations (CRUD, test, balance)
token API key management
user User administration
model Model registry, pricing, sync
log Request logs and statistics
system Health check
performance Runtime metrics, GC
option System settings
group User groups
redemption Redemption codes
subscription Subscription plans
deployment Model deployments
vendor Vendor metadata
data Quota dashboard

Channel Type IDs

ID Provider
1 OpenAI
3 Azure OpenAI
14 Anthropic (Claude)
24 Google Gemini
33 AWS Bedrock
40 SiliconFlow
43 DeepSeek
48 xAI (Grok)

See skills/new-api-manager/references/channel-types.md for the full list of 29 provider types.

Tests

pip install pytest
python -m pytest cli_anything/new_api/tests/ -v

49 tests covering core modules, CLI commands, and realistic workflows. See cli_anything/new_api/tests/TEST.md for details.

License

MIT

About

CLI harness + Claude Code skill for managing New API (AI API gateway) — 15 command groups, 49 tests, agent-ready

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages