DINGJIAI
DINGJIAI
Quick start in 5 minutesWhat is DINGJIAI?

Popular Agents

Codex SetupClaude Code SetupOne-Click Setup

API Reference

Billing

Model pricingOpens in a new window

One-Click Setup

Use npx to connect your installed Codex or Claude Code to DINGJIAI in one command.

Install the client first, then run the setup command

dingjiai is a gateway configurator, not a client installer. It only configures a Codex or Claude Code that is already installed on this machine. It does not install Node.js, Codex, or Claude Code, and it never asks for administrator privileges.

Recommended command

With Node.js 18 or later installed, open a terminal and run:

npx -y dingjiai

Enter your DINGJIAI user API Key when prompted. You can also pass the key directly:

npx -y dingjiai -k sk-your-user-api-key

On shared machines prefer the interactive prompt; -k may end up in shell history and is briefly visible as a local subprocess argument.

Configure only one tool:

npx -y dingjiai -k sk-your-user-api-key --only codex
npx -y dingjiai -k sk-your-user-api-key --only claude

Preview first, without writing any configuration:

npx -y dingjiai -k sk-your-user-api-key --only claude,codex --dry-run

What it solves

Codex and Claude Code differ in local configuration locations, protocol entries, and model fields. When wiring them up by hand, it is easy to get the Base URL, API Key, model name, or protocol path wrong.

dingjiai does something deliberately narrow:

detect the Codex / Claude Code installed on this machine
-> read your DINGJIAI user API Key once
-> request the DINGJIAI model list to verify the key and available models
-> pick a default model by built-in priority
-> call zcf to write the matching client configuration

Without --only, it only configures the clients it detects as installed. With --only claude,codex, it processes exactly the clients you named; if one of them turns out not to be installed at write time, that client fails with a message.

What it writes

dingjiai currently writes configuration through a pinned zcf@3.6.8. The targets it hands to zcf are:

ClientBase URLLocal config it may modify
Claude Codehttps://dingjiai.com/anthropic~/.claude/settings.json
Codexhttps://dingjiai.com/v1~/.codex/config.toml, ~/.codex/auth.json

What gets written mainly includes:

  • Your DINGJIAI user API Key.
  • The DINGJIAI Base URL.
  • The default model.
  • Claude Code's primary, haiku, sonnet, and opus model slots.

dingjiai asks zcf to skip MCP, workflows, output styles, and status-line tooling. zcf is still an external tool, so the actual write behavior follows the current zcf version; if you care deeply about your existing local configuration, run --dry-run first, inspect the plan, and then decide.

What it will not do

  • It does not install Codex or Claude Code.
  • It does not install system dependencies such as Node.js, Git, or Python.
  • It does not modify system-level environment variables.
  • It does not ask for administrator privileges.
  • It does not delete your client configuration.
  • It does not print your full API Key in the summary.

Note: the API Key is passed as an argument to the local zcf subprocess and written into the matching client configuration files; the client needs it for subsequent DINGJIAI calls.

How the model is chosen

On a real write without --skip-verify, the command first requests the model lists:

GET https://dingjiai.com/v1/models
Authorization: Bearer sk-your-user-api-key

GET https://dingjiai.com/anthropic/v1/models
x-api-key: sk-your-user-api-key
anthropic-version: 2023-06-01

It then picks the default model only from the models those endpoints return. The built-in priority comes from model-priority.json inside the npm package; if none of the prioritized models are available, it uses the first available model from the API response.

You can also pick models manually:

npx -y dingjiai -k sk-your-user-api-key --codex-model gpt-5.5
npx -y dingjiai -k sk-your-user-api-key --claude-model claude-sonnet-4-6

The model names above are examples; the console and the model list responses are authoritative. A manually specified model must be available in the matching model list, otherwise the command refuses to write.

Confirmation before writing

In a normal interactive terminal, the command shows a configuration preview and asks before writing:

Write the configuration above? (y/N)

Only y makes it call zcf to write the configuration. --dry-run only prints the planned command; it neither requests the model list nor writes any file.

Common troubleshooting

  • No client detected: install Codex or Claude Code first, then rerun.
  • API Key verification failed: make sure you copied a DINGJIAI user API Key, not an upstream provider key.
  • No available models: sign in to the console and check your account's available models, balance, and permissions.
  • The tool still uses the old address after configuration: restart Codex or Claude Code so it reloads its configuration.
  • Want to see the underlying zcf output: add --verbose.
npx -y dingjiai -k sk-your-user-api-key --verbose

This page describes the behavior of the currently published dingjiai npm package. For the actually supported flags, run:

npx -y dingjiai --help

Last updated on

Claude Code SetupBase URL and authentication

On this page

Recommended commandWhat it solvesWhat it writesWhat it will not doHow the model is chosenConfirmation before writingCommon troubleshooting