2026-06-13 10:08:37 -04:00
|
|
|
import { CLAUDE_API_HEADERS, KIMI_CODING_BASE_URL } from "../shared.js";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
id: "kimi-coding",
|
2026-06-15 00:38:43 -04:00
|
|
|
hidden: true,
|
|
|
|
|
priority: 120,
|
2026-06-13 10:08:37 -04:00
|
|
|
alias: "kmc",
|
2026-06-14 03:32:59 -04:00
|
|
|
display: {
|
|
|
|
|
name: "Kimi Coding",
|
|
|
|
|
icon: "psychology",
|
|
|
|
|
color: "#1E40AF",
|
|
|
|
|
textIcon: "KC",
|
|
|
|
|
website: "https://kimi.moonshot.cn",
|
|
|
|
|
notice: {
|
|
|
|
|
signupUrl: "https://kimi.moonshot.cn",
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-06-14 02:15:48 -04:00
|
|
|
category: "oauth",
|
2026-06-13 10:08:37 -04:00
|
|
|
transport: {
|
2026-06-14 03:32:59 -04:00
|
|
|
baseUrl: "https://api.kimi.com/coding/v1/messages",
|
2026-06-13 10:08:37 -04:00
|
|
|
format: "claude",
|
2026-06-13 11:00:57 -04:00
|
|
|
urlSuffix: "?beta=true",
|
2026-06-19 23:09:50 -04:00
|
|
|
headers: { ...CLAUDE_API_HEADERS },
|
2026-06-13 10:08:37 -04:00
|
|
|
clientId: "17e5f671-d194-4dfb-9706-5516cb48c098",
|
|
|
|
|
tokenUrl: "https://auth.kimi.com/api/oauth/token",
|
2026-06-14 02:15:48 -04:00
|
|
|
refreshUrl: "https://auth.kimi.com/api/oauth/token",
|
2026-06-14 03:32:59 -04:00
|
|
|
auth: {
|
|
|
|
|
combined: true,
|
|
|
|
|
header: "x-api-key",
|
|
|
|
|
scheme: "raw",
|
|
|
|
|
hooks: [
|
|
|
|
|
"kimiHeaders",
|
|
|
|
|
],
|
|
|
|
|
},
|
2026-06-13 10:08:37 -04:00
|
|
|
},
|
2026-06-19 23:09:50 -04:00
|
|
|
// Multi-endpoint: pick the transport matching client sourceFormat to skip translation.
|
|
|
|
|
transports: [
|
|
|
|
|
{
|
|
|
|
|
format: "openai",
|
|
|
|
|
baseUrl: "https://api.kimi.com/coding/v1/chat/completions",
|
|
|
|
|
auth: { combined: true, header: "Authorization", scheme: "bearer", hooks: ["kimiHeaders"] },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
format: "claude",
|
|
|
|
|
baseUrl: "https://api.kimi.com/coding/v1/messages",
|
|
|
|
|
urlSuffix: "?beta=true",
|
|
|
|
|
headers: { ...CLAUDE_API_HEADERS },
|
|
|
|
|
auth: { combined: true, header: "x-api-key", scheme: "raw", hooks: ["kimiHeaders"] },
|
|
|
|
|
},
|
|
|
|
|
],
|
2026-06-13 10:08:37 -04:00
|
|
|
models: [
|
|
|
|
|
{ id: "kimi-k2.6", name: "Kimi K2.6" },
|
|
|
|
|
{ id: "kimi-k2.5", name: "Kimi K2.5" },
|
|
|
|
|
{ id: "kimi-k2.5-thinking", name: "Kimi K2.5 Thinking" },
|
2026-06-14 03:32:59 -04:00
|
|
|
{ id: "kimi-latest", name: "Kimi Latest" },
|
2026-06-14 02:15:48 -04:00
|
|
|
],
|
2026-06-14 03:32:59 -04:00
|
|
|
oauth: {
|
|
|
|
|
deviceCodeUrl: "https://auth.kimi.com/api/oauth/device_authorization",
|
|
|
|
|
tokenUrl: "https://auth.kimi.com/api/oauth/token",
|
|
|
|
|
refreshLeadMs: 300000,
|
|
|
|
|
},
|
|
|
|
|
features: {
|
|
|
|
|
usage: true,
|
|
|
|
|
},
|
2026-06-13 10:08:37 -04:00
|
|
|
};
|