Automated tool for fetching the latest AI model lists from multiple platforms and updating them to your API service channels.
config.ini file or environment variablesFirst, create a config.ini file with your settings (see Configurationโ section for details).
Then run the container:
docker run -d --name new-api-channel-updater --restart=unless-stopped \
-v $(pwd)/config.ini:/app/config.ini \
-v $(pwd)/logs:/app/logs \
jerryin/new-api-channel-updater
services:
new-api-channel-updater:
image: jerryin/new-api-channel-updater
container_name: new-api-channel-updater
restart: unless-stopped
volumes:
- ./config.ini:/app/config.ini
- ./logs:/app/logs
Create a config.ini file with the following structure:
[api]
base_url = http://your-api:3000/api
token = your_api_token
new_api_user = 1
[openrouter]
enabled = true
channel_id = 1
api_key = your_openrouter_api_key # Optional, can be empty
free_model_mapping = false
token_threshold = 10000000 # Minimum total tokens threshold (prompt + completion)
fixed_models = openai/gpt-4.5,anthropic/claude-3.7 # Comma-separated fixed model IDs (optional)
[gemini]
enabled = true
channel_id = 2
api_key = your_gemini_api_key
excluded_keywords = # Comma-separated keywords to exclude (optional)
[nvidia]
enabled = true
channel_id = 3
api_token = your_nvidia_api_token # Optional, can be empty
excluded_models = # Comma-separated model IDs to exclude (optional)
# Enable the model availability test for this module only (overrides global [model_test])
model_test_enabled = false
[cloudflare]
enabled = true
channel_id = 4
account_id = your_cloudflare_account_id
api_token = your_cloudflare_api_token # Bearer token for Cloudflare API
[dingtalk]
access_token = your_dingtalk_access_token
secret = your_dingtalk_secret
[schedule]
cron = 30 */4 * * *
[log]
loglevel = INFO
keep_days = 7
[model_test]
# Model availability test: send one minimal request to verify a model really works
enabled = false
api_key =
base_url =
concurrency = 8
timeout = 30
max_tokens = 16
retries = 1
cache_hours = 24
cache_dir = logs/model_test
test_types = auto
on_error = keep
on_all_failed = keep_all
prompt = hi
embedding_input = hello
All configuration options can also be set via environment variables with the format SECTION_OPTION (e.g., API_BASE_URL, OPENROUTER_ENABLED).
Model lists returned by providers often contain models that cannot actually be invoked (deprecated, not deployed, vision/embedding-only, ...). When enabled, every model is probed with a minimal request before the channel is updated:
chat models: POST {base_url}/chat/completions with the configured max_tokens;embeddings models: POST {base_url}/embeddings;test_types: with auto it is inferred from the model ID, and models that cannot be
probed (e.g. rerank / reward models) are skipped and kept.| Option | Default | Description |
|---|---|---|
enabled | false | Master switch; when disabled no module runs any test |
api_key | empty | API key used for probing; falls back to the module credential (e.g. nvidia.api_token) |
base_url | empty | Probe endpoint; falls back to the module built-in URL |
concurrency | 8 | Number of models probed in parallel |
timeout | 30 | Timeout (seconds) of a single probe request |
max_tokens | 16 | Max tokens for the chat probe, keep it small to lower the cost |
retries | 1 | Retries per model (4xx responses fail fast without retrying) |
cache_hours | 24 | How long a probe result stays cached; 0 disables the cache |
cache_dir | logs/model_test | Directory of the result cache |
test_types | auto | auto / chat / embeddings |
on_error | keep | Per-model failure: keep (log only) or drop (remove from the list) |
on_all_failed | keep_all | When every model fails (bad key / network outage): keep_all keeps the current models and skips the update, error does the same but marks the module run as failed |
prompt | hi | Prompt used for the chat probe |
embedding_input | hello | Input used for the embeddings probe |
Any module section can override the global settings with the model_test_ prefix, e.g. enable it for NVIDIA only:
[model_test]
enabled = false
timeout = 30
on_error = keep
[nvidia]
enabled = true
channel_id = 3
api_token = your_nvidia_api_token
model_test_enabled = true
model_test_timeout = 90
on_errordefaults tokeep(log only, no removal). Run a round first, check the failure list inlogs/nvidia_nim.log, then switch todroponce it looks correct. Results are cached forcache_hours, so transient network errors will not immediately change the channel.
Execute modules manually using the CLI tool:
# View CLI tool help information
docker exec new-api-channel-updater python cli.py --help
# List available modules
docker exec new-api-channel-updater python cli.py --list
# Execute a specific module
docker exec new-api-channel-updater python cli.py openrouter
# Execute all modules
docker exec new-api-channel-updater python cli.py all
This project is licensed under the MIT License - see the LICENSEโ file for details.
Content type
Image
Digest
sha256:3d7c63349โฆ
Size
50.3 MB
Last updated
13 days ago
docker pull jerryin/new-api-channel-updater