~/.kimi/config.toml file.
Flow:
Kimi Code CLI -> GoModel -> upstream model provider
You do not need an api.json URL
Kimi’s Custom registry (api.json) option imports a models.dev-shaped
provider catalog. It is optional and is not the normal OpenAI-compatible setup
path.
GoModel exposes its model catalog at /v1/models, but that response uses the
OpenAI model-list format rather than Kimi’s custom-registry format. Do not paste
http://localhost:8080/v1/models into Kimi’s api.json prompt. Exit that
prompt and use the direct configuration below instead.
If you searched for
pi.json, the file name shown by Kimi is api.json.
Neither file is required for this setup.Before you start
- Install Kimi Code CLI.
- Choose a GoModel master key for gateway administration, for example
change-me. - Make sure GoModel has an upstream credential for the model you want to use.
1. Run GoModel
Start GoModel with a master key and at least one upstream provider. This example uses OpenAI:GOMODEL_MASTER_KEY is the gateway’s bootstrap and administrator credential.
Do not put it in Kimi’s persistent configuration. OPENAI_API_KEY belongs to
GoModel and is used only for the upstream request.
2. Create a dedicated Kimi API key
Open the GoModel dashboard at http://localhost:8080/admin/dashboard and sign in withGOMODEL_MASTER_KEY. Go to
API Keys -> Create API Key, then:
- Name the key
kimi-code. - Set User Path to
/agents/kimi. - Leave Dashboard access disabled.
- Create the key and copy the
sk_gom_...value. It is shown only once.
/agents/kimi.
3. Choose a model
List the models visible through GoModel:openai/gpt-5-mini, with a 400,000-token context window and a
128,000-token output limit. Prefer a provider-qualified ID from this
response so GoModel routes the request to the intended provider.
4. Configure Kimi Code CLI
Open~/.kimi/config.toml and add:
gomodel/gpt-5-mini is local to Kimi. The model value is the
exact selector Kimi sends to GoModel.
Use the context_window value returned by GoModel as max_context_size when
you configure a different model. The thinking capability and
default_thinking = true match the reasoning model used here. Adjust Kimi’s
capabilities to match another model.
If GoModel runs on another host, replace localhost:8080. Keep /v1 in the
base URL; do not append /chat/completions.
5. Validate the setup
Check the installed Kimi version:6. Check the traffic in GoModel
Open the GoModel dashboard audit logs: http://localhost:8080/admin/dashboard/audit Use the audit trail to confirm that Kimi is sending streaming requests toPOST /v1/chat/completions and that GoModel is routing them to the selected
provider. Sign in with the master key or a separate managed key that has
dashboard access; the Kimi key intentionally cannot open this page.
Troubleshooting
Kimi asks for an api.json URL
You selected Kimi’s custom-registry import flow. Cancel it and edit
~/.kimi/config.toml as shown above. GoModel does not need a registry
endpoint for Kimi to work.
401 Unauthorized
Make sure Kimi’s api_key matches the active sk_gom_... managed key created
for Kimi. Do not put the master key or upstream provider key in Kimi’s config.
reasoning_effort is rejected
Use a model that accepts reasoning effort, declare the thinking capability,
and enable default_thinking, as in the tested example. Kimi CLI 1.49.0 sends
an explicit reasoning_effort value through openai_legacy; non-reasoning
models can reject it.
Model not found
Copy the exact model ID from/v1/models. If more than one provider exposes
the same model, use the provider-qualified ID, such as
openai/gpt-5-mini.
References
- Kimi Code CLI: Getting started
- Kimi Code CLI: Providers and models
- Kimi Code CLI: Configuration files
Validated on August 8, 2026
This guide was validated against:- a local GoModel instance on
http://localhost:8080 - Kimi Code CLI
1.49.0 openai/gpt-5-minithrough GoModel’s OpenAI-compatible Chat Completions API
- Kimi accepted the documented TOML configuration with a dedicated managed key
that had
/agents/kimias its user path and no dashboard access kimi --quiet -preturnedokthroughKimi Code CLI -> GoModel -> OpenAI- Kimi invoked its Shell tool and returned
tool-okthrough the same route - the Kimi key could list and call models but received
403from the admin API - no GoModel application change or
api.jsonendpoint was required