tokenopen-config
v0.1.1
Published
One-click TokenOpen configuration for Claude Code, Codex, OpenClaw, Hermes, and OpenAI-compatible developer tools.
Maintainers
Readme
tokenopen-config
TokenOpen one-click client configuration plan for Claude Code, Codex, OpenClaw, Hermes, and other OpenAI-compatible developer tools.
Target host:
https://www.tokenopen.aiKey behavior:
- Connectivity verification uses
GET {host}/v1/modelswithAuthorization: Bearer sk-xxx. - Model and pricing discovery uses
GET {host}/api/pricing. - Claude Code uses the root host as its Anthropic base URL:
{host}. - Codex, OpenClaw, Hermes, Factory Droid, Crush, OpenCode, Oh My Pi, CodeBuddy, and most other clients use OpenAI-compatible base URL:
{host}/v1. - Codex model auto-selection prefers models from
/api/pricingwhere:tagscontainsLLM;supported_endpoint_typesis empty or includesopenai;- model name starts with
gpt-5; - non-small variants are preferred over
mini,nano,small,lite, ortiny.
- Codex fallback model is
gpt-5.5.
Compatibility
The current codebase already provides the required server-side endpoints:
GET /v1/modelsPOST /v1/messagesPOST /v1/chat/completionsPOST /v1/responsesGET /api/pricing
Authentication compatibility:
- OpenAI-compatible clients can use
Authorization: Bearer sk-xxx. - Claude/Anthropic-compatible clients can use
x-api-key: sk-xxx; maps it to Bearer auth for/v1/messagesand/v1/models.
Pricing compatibility:
/api/pricingalready returns fields consumed by tokenopen:model_nametagsmodel_ratiocompletion_ratiocache_ratiosupported_endpoint_types
TokenOpen Configuration
Use this host everywhere:
https://www.tokenopen.aiUse this root URL for Claude Code:
https://www.tokenopen.aiUse this OpenAI-compatible URL for Codex and most other clients:
https://www.tokenopen.ai/v1Use this pricing endpoint for model discovery:
https://www.tokenopen.ai/api/pricingUse this model verification endpoint:
https://www.tokenopen.ai/v1/modelsManual Client Setup
Until tokenopen-config is implemented, use zcf directly.
Claude Code:
npx -y zcf init -s -T cc -f -r merge -t api_key \
-u https://www.tokenopen.ai \
-k sk-your-token \
-m skip -w skip -o skip -x falseCodex:
npx -y zcf init -s -T codex -f -r merge -t api_key \
-u https://www.tokenopen.ai/v1 \
-k sk-your-token \
-M gpt-5.4 \
-m skip -w skip -o skip -x falseClaude Code environment variables:
export ANTHROPIC_BASE_URL="https://www.tokenopen.ai"
export ANTHROPIC_API_KEY="sk-your-token"
export ANTHROPIC_AUTH_TOKEN="sk-your-token"OpenAI-compatible tools:
base_url = https://www.tokenopen.ai/v1
api_key = sk-your-token
model = gpt-5.4Hermes provider shape:
providers:
tokenopen:
base_url: https://www.tokenopen.ai/v1
key_env: TOKENOPEN_API_KEY
kind: openai
model:
default: tokenopen/gpt-5.4
provider: tokenopenServer Requirements
For best compatibility, TokenOpen should ensure:
/v1/modelsis reachable with a valid user API token./api/pricingis public or accessible without browser session auth.- Target coding models have pricing configured.
- Target coding models are available in user groups.
- Target coding models include
LLMin their tags. - OpenAI-compatible models include
openaiinsupported_endpoint_types, or leave the field empty. - Claude Code models support
/v1/messages.
Recommended model metadata for coding models:
{
"tags": "LLM",
"endpoints": {
"openai": "/v1/chat/completions"
}
}tokenopen-config Implementation Plan
Required defaults:
PRIMARY_HOST = "https://www.tokenopen.ai"
FALLBACK_HOSTS = []
DEFAULT_PROVIDER_NAME = "TokenOpen"
DEFAULT_ENV_KEY = "TOKENOPEN_API_KEY"Required CLI options:
-k, --api-key <key>
--only <client-list>
--model <model>
--base-url <url>
--skip-verify
-v, --verbose
-h, --help
-V, --versionBase URL rules:
- Claude Code:
{host} - Codex:
{host}/v1 - OpenClaw:
{host}/v1 - Hermes:
{host}/v1 - Factory Droid:
{host}/v1 - Copilot CLI:
{host}/v1 - nanobot:
{host}/v1 - Crush:
{host}/v1 - OpenCode:
{host}/v1 - Oh My Pi:
{host}/v1 - CodeBuddy:
{host}/v1/chat/completions
Verification:
GET https://www.tokenopen.ai/v1/models
Authorization: Bearer sk-your-tokenModel discovery:
GET https://www.tokenopen.ai/api/pricingRecommended model selection order:
- Explicit
--model. - Best
gpt-5*LLM with OpenAI endpoint and non-small tier. - Any
gpt-5*LLM with OpenAI endpoint. - Any LLM with OpenAI endpoint and non-small tier.
- Configured fallback model.
Recommended fallback model:
gpt-5.4Usage
Install or run directly with npx:
npx -y tokenopen-config -k sk-your-token --only claude
npx -y tokenopen-config -k sk-your-token --only codex
npx -y tokenopen-config -k sk-your-token --only openclaw
npx -y tokenopen-config -k sk-your-token --only hermes
npx -y tokenopen-config -k sk-your-token --only allIf you already installed the package globally, use this format:
tokenopen-config -k sk-your-token --only claude
tokenopen-config -k sk-your-token --only codex
tokenopen-config -k sk-your-token --only openclaw
tokenopen-config -k sk-your-token --only hermes
tokenopen-config -k sk-your-token --only all
tokenopen-config -k sk-your-token --only claude,codex
tokenopen-config -k sk-your-token --only all --model gpt-5.4Supported --only values:
claude
codex
openclaw
hermes
allNon-goals
- Do not modify protected project identity, package paths, or existing branding.
- Do not require changes relay routing unless a TokenOpen deployment disables
/api/pricingor omits model metadata needed by client discovery.
Current Implementation
This repository now contains a working zero-dependency Node.js CLI.
Local checks:
npm run check
node ./bin/tokenopen-config.js --helpLocal usage:
node ./bin/tokenopen-config.js -k sk-your-token
node ./bin/tokenopen-config.js -k sk-your-token --only claude,codex
node ./bin/tokenopen-config.js -k sk-your-token --only all --model gpt-5.4Supported clients in this initial implementation:
claude: useszcffor Claude Code and writes Anthropic environment variables.codex: useszcffor Codex withhttps://www.tokenopen.ai/v1.openclaw: calls localopenclaw onboardwith TokenOpen OpenAI-compatible settings.hermes: callshermes config setwhen available, otherwise writes~/.hermes/config.yamland~/.hermes/.env.
