@psnext/slingcli 2.5.20260722-2 → 2.5.20260722-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +9 -7
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +25 -23
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +32 -19
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +6 -7
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +75 -26
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.js +6 -17
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +56 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +56 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js +2 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +30 -14
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js +4 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/stream-fn.js +17 -0
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +2 -7
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +14 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +2 -4
- package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.js +249 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +60 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cerebras.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/groq.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/kimi-coding.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/moonshotai-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/moonshotai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.js +10 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-cn.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-cn.models.js +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan.models.js +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius-config.js +18 -14
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +79 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/text.js +10 -0
- package/node_modules/@earendil-works/{pi-agent-core/dist/harness/session → pi-ai/dist/utils}/uuid.js +4 -8
- package/node_modules/@earendil-works/pi-ai/package.json +8 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +72 -57
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js +8 -11
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +63 -26
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js +6 -17
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js +18 -15
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js +26 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +6 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +100 -24
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/usage-totals.js +52 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/client.js +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/index.js +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +5 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +20 -21
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +69 -25
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +16 -31
- package/node_modules/@earendil-works/pi-coding-agent/package.json +4 -4
- package/node_modules/@earendil-works/{pi-orchestrator → pi-server}/dist/cli.js +5 -5
- package/node_modules/@earendil-works/{pi-orchestrator → pi-server}/dist/config.js +9 -9
- package/node_modules/@earendil-works/{pi-orchestrator → pi-server}/dist/ipc/client.js +1 -1
- package/node_modules/@earendil-works/{pi-orchestrator → pi-server}/dist/ipc/server.js +1 -1
- package/node_modules/@earendil-works/{pi-orchestrator → pi-server}/dist/radius.js +8 -8
- package/node_modules/@earendil-works/{pi-orchestrator → pi-server}/dist/rpc-process.js +1 -1
- package/node_modules/@earendil-works/{pi-orchestrator → pi-server}/dist/serve.js +3 -3
- package/node_modules/@earendil-works/{pi-orchestrator → pi-server}/dist/storage.js +7 -7
- package/node_modules/@earendil-works/{pi-orchestrator → pi-server}/dist/supervisor.js +2 -2
- package/node_modules/@earendil-works/{pi-orchestrator → pi-server}/package.json +9 -6
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +16 -10
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +4 -2
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +7 -7
- package/slingshot/index.js +253 -250
- /package/node_modules/@earendil-works/{pi-orchestrator → pi-server}/dist/handler.js +0 -0
- /package/node_modules/@earendil-works/{pi-orchestrator → pi-server}/dist/index.js +0 -0
- /package/node_modules/@earendil-works/{pi-orchestrator → pi-server}/dist/ipc/protocol.js +0 -0
- /package/node_modules/@earendil-works/{pi-orchestrator → pi-server}/dist/types.js +0 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kimi Code (subscription) OAuth flow
|
|
3
|
+
*
|
|
4
|
+
* RFC 8628 device authorization grant against https://auth.kimi.com with JSON
|
|
5
|
+
* responses. The access token authenticates requests to
|
|
6
|
+
* https://api.kimi.com/coding as an `Authorization: Bearer` header.
|
|
7
|
+
*/
|
|
8
|
+
import { getProviderEnvValue } from "../../utils/provider-env.js";
|
|
9
|
+
import { pollOAuthDeviceCodeFlow } from "./device-code.js";
|
|
10
|
+
const CLIENT_ID = "17e5f671-d194-4dfb-9706-5516cb48c098";
|
|
11
|
+
const DEFAULT_OAUTH_HOST = "https://auth.kimi.com";
|
|
12
|
+
const DEVICE_CODE_TIMEOUT_SECONDS = 15 * 60;
|
|
13
|
+
const DEFAULT_POLL_INTERVAL_SECONDS = 5;
|
|
14
|
+
const REQUEST_TIMEOUT_MS = 30 * 1000;
|
|
15
|
+
const REFRESH_MAX_RETRIES = 3;
|
|
16
|
+
function getOauthHost() {
|
|
17
|
+
const override = getProviderEnvValue("KIMI_CODE_OAUTH_HOST") || getProviderEnvValue("KIMI_OAUTH_HOST");
|
|
18
|
+
return (override || DEFAULT_OAUTH_HOST).replace(/\/+$/, "");
|
|
19
|
+
}
|
|
20
|
+
function requestSignal(signal) {
|
|
21
|
+
return AbortSignal.any([AbortSignal.timeout(REQUEST_TIMEOUT_MS), ...(signal ? [signal] : [])]);
|
|
22
|
+
}
|
|
23
|
+
function formUrlEncode(fields) {
|
|
24
|
+
return new URLSearchParams(fields).toString();
|
|
25
|
+
}
|
|
26
|
+
async function readJson(response) {
|
|
27
|
+
try {
|
|
28
|
+
const json = await response.json();
|
|
29
|
+
return json && typeof json === "object" ? json : null;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** The verification URI is opened in the user's browser; only http(s) URLs are trusted. */
|
|
36
|
+
function trustedHttpUrl(value) {
|
|
37
|
+
if (typeof value !== "string" || !value)
|
|
38
|
+
return null;
|
|
39
|
+
try {
|
|
40
|
+
const url = new URL(value);
|
|
41
|
+
if (url.protocol !== "https:" && url.protocol !== "http:")
|
|
42
|
+
return null;
|
|
43
|
+
return url.href;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async function startDeviceAuthorization(oauthHost, signal) {
|
|
50
|
+
const response = await fetch(`${oauthHost}/api/oauth/device_authorization`, {
|
|
51
|
+
method: "POST",
|
|
52
|
+
headers: {
|
|
53
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
54
|
+
Accept: "application/json",
|
|
55
|
+
},
|
|
56
|
+
body: formUrlEncode({ client_id: CLIENT_ID }),
|
|
57
|
+
signal: requestSignal(signal),
|
|
58
|
+
});
|
|
59
|
+
if (!response.ok) {
|
|
60
|
+
const text = await response.text().catch(() => "");
|
|
61
|
+
throw new Error(`Kimi Code device authorization failed with status ${response.status}${text ? `: ${text}` : ""}`);
|
|
62
|
+
}
|
|
63
|
+
const json = await readJson(response);
|
|
64
|
+
const deviceCode = json?.device_code;
|
|
65
|
+
const userCode = json?.user_code;
|
|
66
|
+
const verificationUri = json?.verification_uri;
|
|
67
|
+
const verificationUriComplete = json?.verification_uri_complete;
|
|
68
|
+
if (typeof deviceCode !== "string" ||
|
|
69
|
+
typeof userCode !== "string" ||
|
|
70
|
+
typeof verificationUri !== "string" ||
|
|
71
|
+
typeof verificationUriComplete !== "string" ||
|
|
72
|
+
!trustedHttpUrl(verificationUriComplete) ||
|
|
73
|
+
!trustedHttpUrl(verificationUri)) {
|
|
74
|
+
throw new Error(`Invalid Kimi Code device authorization response: ${JSON.stringify(json)}`);
|
|
75
|
+
}
|
|
76
|
+
const interval = json?.interval;
|
|
77
|
+
const expiresIn = json?.expires_in;
|
|
78
|
+
return {
|
|
79
|
+
deviceCode,
|
|
80
|
+
userCode,
|
|
81
|
+
verificationUri,
|
|
82
|
+
verificationUriComplete,
|
|
83
|
+
intervalSeconds: typeof interval === "number" && Number.isFinite(interval) && interval > 0
|
|
84
|
+
? interval
|
|
85
|
+
: DEFAULT_POLL_INTERVAL_SECONDS,
|
|
86
|
+
expiresInSeconds: typeof expiresIn === "number" && Number.isFinite(expiresIn) && expiresIn > 0
|
|
87
|
+
? expiresIn
|
|
88
|
+
: DEVICE_CODE_TIMEOUT_SECONDS,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function parseTokenResponse(json, operation) {
|
|
92
|
+
const accessToken = json?.access_token;
|
|
93
|
+
const refreshToken = json?.refresh_token;
|
|
94
|
+
const expiresIn = json?.expires_in;
|
|
95
|
+
if (typeof accessToken !== "string" ||
|
|
96
|
+
!accessToken ||
|
|
97
|
+
typeof refreshToken !== "string" ||
|
|
98
|
+
!refreshToken ||
|
|
99
|
+
typeof expiresIn !== "number" ||
|
|
100
|
+
!Number.isFinite(expiresIn) ||
|
|
101
|
+
expiresIn <= 0) {
|
|
102
|
+
throw new Error(`Kimi Code token ${operation} response missing fields: ${JSON.stringify(json)}`);
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
access: accessToken,
|
|
106
|
+
refresh: refreshToken,
|
|
107
|
+
expires: Date.now() + expiresIn * 1000,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
async function pollForToken(oauthHost, device, signal) {
|
|
111
|
+
return pollOAuthDeviceCodeFlow({
|
|
112
|
+
intervalSeconds: device.intervalSeconds,
|
|
113
|
+
expiresInSeconds: device.expiresInSeconds,
|
|
114
|
+
waitBeforeFirstPoll: true,
|
|
115
|
+
signal,
|
|
116
|
+
poll: async () => {
|
|
117
|
+
const response = await fetch(`${oauthHost}/api/oauth/token`, {
|
|
118
|
+
method: "POST",
|
|
119
|
+
headers: {
|
|
120
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
121
|
+
Accept: "application/json",
|
|
122
|
+
},
|
|
123
|
+
body: formUrlEncode({
|
|
124
|
+
client_id: CLIENT_ID,
|
|
125
|
+
device_code: device.deviceCode,
|
|
126
|
+
grant_type: "urn:ietf:params:oauth:grant-type:device_code",
|
|
127
|
+
}),
|
|
128
|
+
signal: requestSignal(signal),
|
|
129
|
+
});
|
|
130
|
+
if (response.status >= 500) {
|
|
131
|
+
const text = await response.text().catch(() => "");
|
|
132
|
+
return {
|
|
133
|
+
status: "failed",
|
|
134
|
+
message: `Kimi Code device token request failed with status ${response.status}${text ? `: ${text}` : ""}`,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
const json = await readJson(response);
|
|
138
|
+
if (response.ok && typeof json?.access_token === "string") {
|
|
139
|
+
try {
|
|
140
|
+
return { status: "complete", value: parseTokenResponse(json, "poll") };
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
return { status: "failed", message: error instanceof Error ? error.message : String(error) };
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
const error = json?.error;
|
|
147
|
+
const description = typeof json?.error_description === "string" ? `: ${json.error_description}` : "";
|
|
148
|
+
if (error === "authorization_pending") {
|
|
149
|
+
return { status: "pending" };
|
|
150
|
+
}
|
|
151
|
+
if (error === "slow_down") {
|
|
152
|
+
const interval = json?.interval;
|
|
153
|
+
return {
|
|
154
|
+
status: "slow_down",
|
|
155
|
+
intervalSeconds: typeof interval === "number" && interval > 0 ? interval : undefined,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
if (error === "expired_token") {
|
|
159
|
+
return { status: "failed", message: "Kimi Code device authorization expired. Please restart login." };
|
|
160
|
+
}
|
|
161
|
+
if (error === "access_denied") {
|
|
162
|
+
return { status: "failed", message: "Kimi Code login was denied." };
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
status: "failed",
|
|
166
|
+
message: `Kimi Code device token request failed (status ${response.status})${typeof error === "string" ? `: ${error}${description}` : ""}`,
|
|
167
|
+
};
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
function sleep(ms) {
|
|
172
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
173
|
+
}
|
|
174
|
+
function isRetryableRefreshFailure(response) {
|
|
175
|
+
return response.status === 429 || response.status >= 500;
|
|
176
|
+
}
|
|
177
|
+
async function refreshToken(oauthHost, refreshTokenValue, signal) {
|
|
178
|
+
let lastError;
|
|
179
|
+
for (let attempt = 0; attempt <= REFRESH_MAX_RETRIES; attempt++) {
|
|
180
|
+
if (attempt > 0) {
|
|
181
|
+
await sleep(1000 * 2 ** (attempt - 1));
|
|
182
|
+
}
|
|
183
|
+
if (signal?.aborted) {
|
|
184
|
+
throw new Error("Kimi Code token refresh aborted");
|
|
185
|
+
}
|
|
186
|
+
let response;
|
|
187
|
+
try {
|
|
188
|
+
response = await fetch(`${oauthHost}/api/oauth/token`, {
|
|
189
|
+
method: "POST",
|
|
190
|
+
headers: {
|
|
191
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
192
|
+
Accept: "application/json",
|
|
193
|
+
},
|
|
194
|
+
body: formUrlEncode({
|
|
195
|
+
client_id: CLIENT_ID,
|
|
196
|
+
grant_type: "refresh_token",
|
|
197
|
+
refresh_token: refreshTokenValue,
|
|
198
|
+
}),
|
|
199
|
+
signal: requestSignal(signal),
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
const json = await readJson(response);
|
|
207
|
+
if (response.ok) {
|
|
208
|
+
return parseTokenResponse(json, "refresh");
|
|
209
|
+
}
|
|
210
|
+
// Unauthorized: the stored credential is dead; Models clears it and prompts re-login.
|
|
211
|
+
if (response.status === 401 || response.status === 403 || json?.error === "invalid_grant") {
|
|
212
|
+
const description = typeof json?.error_description === "string" ? `: ${json.error_description}` : "";
|
|
213
|
+
throw new Error(`Kimi Code token refresh unauthorized (status ${response.status})${description}`);
|
|
214
|
+
}
|
|
215
|
+
if (isRetryableRefreshFailure(response) && attempt < REFRESH_MAX_RETRIES) {
|
|
216
|
+
lastError = new Error(`Kimi Code token refresh failed with status ${response.status}`);
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
const text = JSON.stringify(json);
|
|
220
|
+
throw new Error(`Kimi Code token refresh failed with status ${response.status}${text ? `: ${text}` : ""}`);
|
|
221
|
+
}
|
|
222
|
+
throw lastError ?? new Error("Kimi Code token refresh failed");
|
|
223
|
+
}
|
|
224
|
+
async function loginKimiCoding(interaction) {
|
|
225
|
+
const oauthHost = getOauthHost();
|
|
226
|
+
const device = await startDeviceAuthorization(oauthHost, interaction.signal);
|
|
227
|
+
interaction.notify({
|
|
228
|
+
type: "device_code",
|
|
229
|
+
userCode: device.userCode,
|
|
230
|
+
verificationUri: device.verificationUriComplete,
|
|
231
|
+
intervalSeconds: device.intervalSeconds,
|
|
232
|
+
expiresInSeconds: device.expiresInSeconds,
|
|
233
|
+
});
|
|
234
|
+
const token = await pollForToken(oauthHost, device, interaction.signal);
|
|
235
|
+
return { type: "oauth", access: token.access, refresh: token.refresh, expires: token.expires };
|
|
236
|
+
}
|
|
237
|
+
export const kimiCodingOAuth = {
|
|
238
|
+
name: "Kimi Code (subscription)",
|
|
239
|
+
loginLabel: "Sign in with Kimi Code",
|
|
240
|
+
login: loginKimiCoding,
|
|
241
|
+
refresh: async (credential, signal) => {
|
|
242
|
+
const token = await refreshToken(getOauthHost(), credential.refresh, signal);
|
|
243
|
+
return { type: "oauth", access: token.access, refresh: token.refresh, expires: token.expires };
|
|
244
|
+
},
|
|
245
|
+
async toAuth(credential) {
|
|
246
|
+
return { headers: { Authorization: `Bearer ${credential.access}` } };
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
//# sourceMappingURL=kimi-coding.js.map
|
|
@@ -36,6 +36,11 @@ export const loadGitHubCopilotOAuth = async () => {
|
|
|
36
36
|
return bundledLoaders.githubCopilot();
|
|
37
37
|
return (await importOAuthModule("./github-copilot.ts")).githubCopilotOAuth;
|
|
38
38
|
};
|
|
39
|
+
export const loadKimiCodingOAuth = async () => {
|
|
40
|
+
if (bundledLoaders)
|
|
41
|
+
return bundledLoaders.kimiCoding();
|
|
42
|
+
return (await importOAuthModule("./kimi-coding.ts")).kimiCodingOAuth;
|
|
43
|
+
};
|
|
39
44
|
export const loadXaiOAuth = async () => {
|
|
40
45
|
if (bundledLoaders)
|
|
41
46
|
return bundledLoaders.xai();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { anthropicOAuth } from "./auth/oauth/anthropic.js";
|
|
2
2
|
import { githubCopilotOAuth } from "./auth/oauth/github-copilot.js";
|
|
3
|
+
import { kimiCodingOAuth } from "./auth/oauth/kimi-coding.js";
|
|
3
4
|
import { registerBundledOAuthFlowLoaders } from "./auth/oauth/load.js";
|
|
4
5
|
import { openaiCodexOAuth } from "./auth/oauth/openai-codex.js";
|
|
5
6
|
import { createRadiusOAuth } from "./auth/oauth/radius.js";
|
|
@@ -10,6 +11,7 @@ export function registerBunOAuthFlows() {
|
|
|
10
11
|
anthropic: () => anthropicOAuth,
|
|
11
12
|
openaiCodex: () => openaiCodexOAuth,
|
|
12
13
|
githubCopilot: () => githubCopilotOAuth,
|
|
14
|
+
kimiCoding: () => kimiCodingOAuth,
|
|
13
15
|
xai: () => xaiOAuth,
|
|
14
16
|
radius: createRadiusOAuth,
|
|
15
17
|
});
|
|
@@ -67,6 +67,8 @@ function getApiKeyEnvVars(provider) {
|
|
|
67
67
|
}
|
|
68
68
|
const envMap = {
|
|
69
69
|
"ant-ling": "ANT_LING_API_KEY",
|
|
70
|
+
"qwen-token-plan": "QWEN_TOKEN_PLAN_API_KEY",
|
|
71
|
+
"qwen-token-plan-cn": "QWEN_TOKEN_PLAN_CN_API_KEY",
|
|
70
72
|
openai: "OPENAI_API_KEY",
|
|
71
73
|
"azure-openai-responses": "AZURE_OPENAI_API_KEY",
|
|
72
74
|
nvidia: "NVIDIA_API_KEY",
|
|
@@ -167,6 +167,51 @@ export const IMAGE_MODELS = {
|
|
|
167
167
|
cacheWrite: 0,
|
|
168
168
|
},
|
|
169
169
|
},
|
|
170
|
+
"krea/krea-2-large": {
|
|
171
|
+
id: "krea/krea-2-large",
|
|
172
|
+
name: "Krea: Krea 2 Large",
|
|
173
|
+
api: "openrouter-images",
|
|
174
|
+
provider: "openrouter",
|
|
175
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
176
|
+
input: ["text", "image"],
|
|
177
|
+
output: ["image"],
|
|
178
|
+
cost: {
|
|
179
|
+
input: 0,
|
|
180
|
+
output: 0,
|
|
181
|
+
cacheRead: 0,
|
|
182
|
+
cacheWrite: 0,
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
"krea/krea-2-medium": {
|
|
186
|
+
id: "krea/krea-2-medium",
|
|
187
|
+
name: "Krea: Krea 2 Medium",
|
|
188
|
+
api: "openrouter-images",
|
|
189
|
+
provider: "openrouter",
|
|
190
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
191
|
+
input: ["text", "image"],
|
|
192
|
+
output: ["image"],
|
|
193
|
+
cost: {
|
|
194
|
+
input: 0,
|
|
195
|
+
output: 0,
|
|
196
|
+
cacheRead: 0,
|
|
197
|
+
cacheWrite: 0,
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
"krea/krea-2-medium-turbo": {
|
|
201
|
+
id: "krea/krea-2-medium-turbo",
|
|
202
|
+
name: "Krea: Krea 2 Medium Turbo",
|
|
203
|
+
api: "openrouter-images",
|
|
204
|
+
provider: "openrouter",
|
|
205
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
206
|
+
input: ["text", "image"],
|
|
207
|
+
output: ["image"],
|
|
208
|
+
cost: {
|
|
209
|
+
input: 0,
|
|
210
|
+
output: 0,
|
|
211
|
+
cacheRead: 0,
|
|
212
|
+
cacheWrite: 0,
|
|
213
|
+
},
|
|
214
|
+
},
|
|
170
215
|
"microsoft/mai-image-2.5": {
|
|
171
216
|
id: "microsoft/mai-image-2.5",
|
|
172
217
|
name: "Microsoft: MAI-Image-2.5",
|
|
@@ -287,6 +332,21 @@ export const IMAGE_MODELS = {
|
|
|
287
332
|
cacheWrite: 0,
|
|
288
333
|
},
|
|
289
334
|
},
|
|
335
|
+
"openrouter/auto-beta": {
|
|
336
|
+
id: "openrouter/auto-beta",
|
|
337
|
+
name: "Auto Router (Beta)",
|
|
338
|
+
api: "openrouter-images",
|
|
339
|
+
provider: "openrouter",
|
|
340
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
341
|
+
input: ["text", "image"],
|
|
342
|
+
output: ["text", "image"],
|
|
343
|
+
cost: {
|
|
344
|
+
input: -1000000,
|
|
345
|
+
output: -1000000,
|
|
346
|
+
cacheRead: 0,
|
|
347
|
+
cacheWrite: 0,
|
|
348
|
+
},
|
|
349
|
+
},
|
|
290
350
|
"recraft/recraft-v3": {
|
|
291
351
|
id: "recraft/recraft-v3",
|
|
292
352
|
name: "Recraft: Recraft V3",
|
|
@@ -15,6 +15,8 @@ export * from "./utils/event-stream.js";
|
|
|
15
15
|
export * from "./utils/json-parse.js";
|
|
16
16
|
export * from "./utils/overflow.js";
|
|
17
17
|
export * from "./utils/retry.js";
|
|
18
|
+
export { contentText } from "./utils/text.js";
|
|
18
19
|
export * from "./utils/typebox-helpers.js";
|
|
20
|
+
export { uuidv7 } from "./utils/uuid.js";
|
|
19
21
|
export * from "./utils/validation.js";
|
|
20
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -26,6 +26,8 @@ import { OPENAI_CODEX_MODELS } from "./providers/openai-codex.models.js";
|
|
|
26
26
|
import { OPENCODE_MODELS } from "./providers/opencode.models.js";
|
|
27
27
|
import { OPENCODE_GO_MODELS } from "./providers/opencode-go.models.js";
|
|
28
28
|
import { OPENROUTER_MODELS } from "./providers/openrouter.models.js";
|
|
29
|
+
import { QWEN_TOKEN_PLAN_MODELS } from "./providers/qwen-token-plan.models.js";
|
|
30
|
+
import { QWEN_TOKEN_PLAN_CN_MODELS } from "./providers/qwen-token-plan-cn.models.js";
|
|
29
31
|
import { TOGETHER_MODELS } from "./providers/together.models.js";
|
|
30
32
|
import { VERCEL_AI_GATEWAY_MODELS } from "./providers/vercel-ai-gateway.models.js";
|
|
31
33
|
import { XAI_MODELS } from "./providers/xai.models.js";
|
|
@@ -62,6 +64,8 @@ export const MODELS = {
|
|
|
62
64
|
"opencode": OPENCODE_MODELS,
|
|
63
65
|
"opencode-go": OPENCODE_GO_MODELS,
|
|
64
66
|
"openrouter": OPENROUTER_MODELS,
|
|
67
|
+
"qwen-token-plan": QWEN_TOKEN_PLAN_MODELS,
|
|
68
|
+
"qwen-token-plan-cn": QWEN_TOKEN_PLAN_CN_MODELS,
|
|
65
69
|
"together": TOGETHER_MODELS,
|
|
66
70
|
"vercel-ai-gateway": VERCEL_AI_GATEWAY_MODELS,
|
|
67
71
|
"xai": XAI_MODELS,
|
|
@@ -28,6 +28,8 @@ import { opencodeProvider } from "./opencode.js";
|
|
|
28
28
|
import { opencodeGoProvider } from "./opencode-go.js";
|
|
29
29
|
import { openrouterProvider } from "./openrouter.js";
|
|
30
30
|
import { openrouterImagesProvider } from "./openrouter-images.js";
|
|
31
|
+
import { qwenTokenPlanProvider } from "./qwen-token-plan.js";
|
|
32
|
+
import { qwenTokenPlanCnProvider } from "./qwen-token-plan-cn.js";
|
|
31
33
|
import { radiusProvider } from "./radius.js";
|
|
32
34
|
import { togetherProvider } from "./together.js";
|
|
33
35
|
import { vercelAIGatewayProvider } from "./vercel-ai-gateway.js";
|
|
@@ -47,6 +49,10 @@ export function getBuiltinModel(provider, modelId) {
|
|
|
47
49
|
export function getBuiltinProviders() {
|
|
48
50
|
return Object.keys(MODELS);
|
|
49
51
|
}
|
|
52
|
+
/** URL of a generated provider catalog, used to compare its mtime with remote catalogs during development. */
|
|
53
|
+
export function getBuiltinModelDataUrl(provider) {
|
|
54
|
+
return new URL(`./data/${provider}.json`, import.meta.url);
|
|
55
|
+
}
|
|
50
56
|
export function getBuiltinModels(provider) {
|
|
51
57
|
const models = MODELS[provider];
|
|
52
58
|
return models
|
|
@@ -82,6 +88,8 @@ export function builtinProviders() {
|
|
|
82
88
|
opencodeProvider(),
|
|
83
89
|
opencodeGoProvider(),
|
|
84
90
|
openrouterProvider(),
|
|
91
|
+
qwenTokenPlanProvider(),
|
|
92
|
+
qwenTokenPlanCnProvider(),
|
|
85
93
|
radiusProvider(),
|
|
86
94
|
togetherProvider(),
|
|
87
95
|
vercelAIGatewayProvider(),
|
|
@@ -49,8 +49,9 @@ const bedrockAuth = {
|
|
|
49
49
|
return { type: "api_key" };
|
|
50
50
|
},
|
|
51
51
|
resolve: async ({ ctx, credential }) => {
|
|
52
|
-
if (credential?.key)
|
|
53
|
-
return { auth: { apiKey: credential.key }, source: "stored credential" };
|
|
52
|
+
if (credential?.key) {
|
|
53
|
+
return { auth: { apiKey: credential.key }, env: credential.env, source: "stored credential" };
|
|
54
|
+
}
|
|
54
55
|
if (await ctx.env("AWS_BEARER_TOKEN_BEDROCK"))
|
|
55
56
|
return { auth: {}, source: "AWS_BEARER_TOKEN_BEDROCK" };
|
|
56
57
|
if (credential?.env?.AWS_PROFILE ?? (await ctx.env("AWS_PROFILE"))) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":1,"structureHash":"948d1cb02b53150250941305b1032a95b1c1538d0803e9c35a02df3606578a70","files":{"amazon-bedrock.json":"5e0cf6a2985c99aa41093c3a68f0585d2b271baa7a229c805bdf2f1288cc530a","ant-ling.json":"cd4dbdca109e1c31dc7b81c8f8c358c65aee98abc9354c6cba1103c6d79228d2","anthropic.json":"bcf2011f93fcd4080b97f119bd3886dc4b1f2f821c07956f785ad87888eda706","azure-openai-responses.json":"fe6e2515f7eabb0d08e25ab7dae31fee015028b022b1c6a619667de9b7f6c564","cerebras.json":"8619ed9bd0fe2a1b113b6788ac647063557550dbb99d43c6baf5f5bfd01bc001","cloudflare-ai-gateway.json":"eca203979c16273452ebc14973ff3a199a3b002663831eaa9040b08f71f143de","cloudflare-workers-ai.json":"d253a1c502ce65ad2997e53673914bea5d97890c60a1f5400932d5a3fa1c5af7","deepseek.json":"2af04396431781c4b60ff990f9709aac9a73efcd81fd081efeb194de9ee5f71e","fireworks.json":"945066898ef5abf5c62dcf9a837bd91c2539018bbb7bee69187274222efca66b","github-copilot.json":"475d52b2ab0590aa832f3037ad2336cfee42bd8b5c470e0365b347ed95a12e05","google-vertex.json":"c8eaf862f1221580dc87bcdb632695398b67c847ca2d3292530c759107b83741","google.json":"395712ce72ed29b57b1ca1db43fe26e8c8486d6a000f03df901a1910624991e7","groq.json":"4c653340ebe62dce7b1a220db966dad6b0129a604cda1fab29963932ad152220","huggingface.json":"7b7b65b84141df34908a07e3f53434524277d50a92cb4f3003ea96266322e7ed","kimi-coding.json":"4dd5bbd99cce4b8a56a583eb2fcc58329d1d836a8b87757a552af990e2b96b21","minimax-cn.json":"328aa5ee5883ce0d12aa56e5455872eb0f4782a21b16b60822bcd4a3154bf042","minimax.json":"e8c94dc0856b5803815ac38b2b7c65e5bcbbe6db7a4010cefc94b9d36d0bd8d9","mistral.json":"9f4815a902b6aefa68b0568ac6479e38693632a234b98130b40243713bd54696","moonshotai-cn.json":"13c17c1430578e52aec5b6fc80ce3b24107342499a16ea3e68b2d3d09cfa912f","moonshotai.json":"00f03c532d75b90cb4e5c863221135be8d15fbc9134396b9adf61c0886f37112","nvidia.json":"5a2533834e0e3417c32f0105ca36975f67c76c74ae2a366be5b13b957eb48f75","openai-codex.json":"d328ec901afd11df831ddc9d77eb60c125bd39e14eb1714587597d65af8fd0c7","openai.json":"0fbd2572fe008178ad0d2706ea7b5bec0d8d19bde6808d7f8c837bebf8d5505f","opencode-go.json":"193ca7096916b66166d0ec46c215425adf199cd10de969b35e659f188181efe9","opencode.json":"a4bf7b56131565620105cd82a0c6c41b8bee5f74cab736e7092515937c6b1da8","openrouter.json":"6eb52b701ad3f0b1149826f605130f759f18646eaea2ead0a5b957cb8c666083","qwen-token-plan-cn.json":"f120d1f4578e417b3c52bf7c061667aa6dc4168fd43716c3de5885e327a75d57","qwen-token-plan.json":"4ea3d8e8f4de1d3368d7080a6de11fc35984eb7a49d35ba2e38a998a1f34c161","together.json":"1987bfac017995f7a645b1100b19f26e038f21c7e732daf7182db2d26f0b2731","vercel-ai-gateway.json":"ca40f98e75cdcc185e7148a7b182743f1776c21cc8ecca18f22e88ee22d2e04b","xai.json":"3c770da7852ae9994636ae81682b37d1d8c0d064e6b878a87e69e11fc04c66b9","xiaomi-token-plan-ams.json":"c6c246e77d6cff1a7f0ae5cdcf6beabd89eb7b5ff0a697c4120d070f120f91be","xiaomi-token-plan-cn.json":"e160f2805c63f7aeb86e53b6ca9c848ce04262757144cf3966f9590e6d89d212","xiaomi-token-plan-sgp.json":"c81874b2aa8b17edc5d8e75a09c735e833d4432f21671e1b716e2ea369218ccc","xiaomi.json":"2e69ba280bb332fdfd9a3be501b9b8fd40562c421a866894640c4d667dbab562","zai-coding-cn.json":"a19a0f5385de068576ee74feec2771a89caed121c9d70329b3712d0404588be0","zai.json":"03b7cd1d97a4af5e9b67264614fce0d439f32d24767cb5894311d4afb29c5d05"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"gemma-4-31b":{"id":"gemma-4-31b","name":"Gemma 4 31B IT","api":"openai-completions","provider":"cerebras","baseUrl":"https://api.cerebras.ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.99,"output":1.49,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":40960,"compat":{"supportsStore":false,"supportsDeveloperRole":false}},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","api":"openai-completions","provider":"cerebras","baseUrl":"https://api.cerebras.ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.35,"output":0.75,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":40960,"compat":{"supportsStore":false,"supportsDeveloperRole":false}},"zai-glm-4.7":{"id":"zai-glm-4.7","name":"Z.AI GLM-4.7","api":"openai-completions","provider":"cerebras","baseUrl":"https://api.cerebras.ai/v1","reasoning":true,"input":["text"],"cost":{"input":2.25,"output":2.75,"cacheRead":2.25,"cacheWrite":0},"contextWindow":131072,"maxTokens":40960,"compat":{"supportsStore":false,"supportsDeveloperRole":false}}}
|
|
1
|
+
{"gemma-4-31b":{"id":"gemma-4-31b","name":"Gemma 4 31B IT","api":"openai-completions","provider":"cerebras","baseUrl":"https://api.cerebras.ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.99,"output":1.49,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":40960,"compat":{"supportsStore":false,"supportsDeveloperRole":false},"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","api":"openai-completions","provider":"cerebras","baseUrl":"https://api.cerebras.ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.35,"output":0.75,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":40960,"compat":{"supportsStore":false,"supportsDeveloperRole":false},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"zai-glm-4.7":{"id":"zai-glm-4.7","name":"Z.AI GLM-4.7","api":"openai-completions","provider":"cerebras","baseUrl":"https://api.cerebras.ai/v1","reasoning":true,"input":["text"],"cost":{"input":2.25,"output":2.75,"cacheRead":2.25,"cacheWrite":0},"contextWindow":131072,"maxTokens":40960,"compat":{"supportsStore":false,"supportsDeveloperRole":false},"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":null,"xhigh":null,"max":null}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"claude-3-5-haiku":{"id":"claude-3-5-haiku","name":"Claude Haiku 3.5 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":false,"input":["text","image"],"cost":{"input":0.8,"output":4,"cacheRead":0.08,"cacheWrite":1},"contextWindow":200000,"maxTokens":8192,"compat":{"sendSessionAffinityHeaders":true}},"claude-3-haiku":{"id":"claude-3-haiku","name":"Claude Haiku 3","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":false,"input":["text","image"],"cost":{"input":0.25,"output":1.25,"cacheRead":0.03,"cacheWrite":0.3},"contextWindow":200000,"maxTokens":4096,"compat":{"sendSessionAffinityHeaders":true}},"claude-3-opus":{"id":"claude-3-opus","name":"Claude Opus 3","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":false,"input":["text","image"],"cost":{"input":15,"output":75,"cacheRead":1.5,"cacheWrite":18.75},"contextWindow":200000,"maxTokens":4096,"compat":{"sendSessionAffinityHeaders":true}},"claude-3-sonnet":{"id":"claude-3-sonnet","name":"Claude Sonnet 3","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":false,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":0.3},"contextWindow":200000,"maxTokens":4096,"compat":{"sendSessionAffinityHeaders":true}},"claude-3.5-haiku":{"id":"claude-3.5-haiku","name":"Claude Haiku 3.5 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":false,"input":["text","image"],"cost":{"input":0.8,"output":4,"cacheRead":0.08,"cacheWrite":1},"contextWindow":200000,"maxTokens":8192,"compat":{"sendSessionAffinityHeaders":true}},"claude-3.5-sonnet":{"id":"claude-3.5-sonnet","name":"Claude Sonnet 3.5 v2","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":false,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":3.75},"contextWindow":200000,"maxTokens":8192,"compat":{"sendSessionAffinityHeaders":true}},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":10,"output":50,"cacheRead":1,"cacheWrite":12.5},"contextWindow":1000000,"maxTokens":128000,"compat":{"sendSessionAffinityHeaders":true,"forceAdaptiveThinking":true},"thinkingLevelMap":{"off":null,"xhigh":"xhigh","max":"max"}},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":1,"output":5,"cacheRead":0.1,"cacheWrite":1.25},"contextWindow":200000,"maxTokens":64000,"compat":{"sendSessionAffinityHeaders":true}},"claude-opus-4":{"id":"claude-opus-4","name":"Claude Opus 4 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":15,"output":75,"cacheRead":1.5,"cacheWrite":18.75},"contextWindow":200000,"maxTokens":32000,"compat":{"sendSessionAffinityHeaders":true}},"claude-opus-4-1":{"id":"claude-opus-4-1","name":"Claude Opus 4.1 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":15,"output":75,"cacheRead":1.5,"cacheWrite":18.75},"contextWindow":200000,"maxTokens":32000,"compat":{"sendSessionAffinityHeaders":true}},"claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"contextWindow":200000,"maxTokens":64000,"compat":{"sendSessionAffinityHeaders":true}},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"contextWindow":1000000,"maxTokens":128000,"compat":{"sendSessionAffinityHeaders":true,"forceAdaptiveThinking":true},"thinkingLevelMap":{"max":"max"}},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"contextWindow":1000000,"maxTokens":128000,"compat":{"sendSessionAffinityHeaders":true,"forceAdaptiveThinking":true,"supportsTemperature":false},"thinkingLevelMap":{"xhigh":"xhigh","max":"max"}},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"contextWindow":1000000,"maxTokens":128000,"compat":{"sendSessionAffinityHeaders":true,"forceAdaptiveThinking":true,"supportsTemperature":false},"thinkingLevelMap":{"xhigh":"xhigh","max":"max"}},"claude-sonnet-4":{"id":"claude-sonnet-4","name":"Claude Sonnet 4 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":3.75},"contextWindow":200000,"maxTokens":64000,"compat":{"sendSessionAffinityHeaders":true}},"claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":3.75},"contextWindow":200000,"maxTokens":64000,"compat":{"sendSessionAffinityHeaders":true}},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":3.75},"contextWindow":1000000,"maxTokens":64000,"compat":{"sendSessionAffinityHeaders":true,"forceAdaptiveThinking":true},"thinkingLevelMap":{"max":"max"}},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":10,"cacheRead":0.2,"cacheWrite":2.5},"contextWindow":1000000,"maxTokens":128000,"compat":{"sendSessionAffinityHeaders":true,"forceAdaptiveThinking":true},"thinkingLevelMap":{"xhigh":"xhigh","max":"max"}},"gpt-4":{"id":"gpt-4","name":"GPT-4","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":false,"input":["text"],"cost":{"input":30,"output":60,"cacheRead":0,"cacheWrite":0},"contextWindow":8192,"maxTokens":8192},"gpt-4-turbo":{"id":"gpt-4-turbo","name":"GPT-4 Turbo","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":false,"input":["text","image"],"cost":{"input":10,"output":30,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":4096},"gpt-4o":{"id":"gpt-4o","name":"GPT-4o","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":false,"input":["text","image"],"cost":{"input":2.5,"output":10,"cacheRead":1.25,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384},"gpt-4o-mini":{"id":"gpt-4o-mini","name":"GPT-4o mini","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":false,"input":["text","image"],"cost":{"input":0.15,"output":0.6,"cacheRead":0.08,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384},"gpt-5.1":{"id":"gpt-5.1","name":"GPT-5.1","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0.13,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null}},"gpt-5.1-codex":{"id":"gpt-5.1-codex","name":"GPT-5.1 Codex","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0.125,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null}},"gpt-5.2":{"id":"gpt-5.2","name":"GPT-5.2","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":1.75,"output":14,"cacheRead":0.175,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"xhigh":"xhigh"}},"gpt-5.2-codex":{"id":"gpt-5.2-codex","name":"GPT-5.2 Codex","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":1.75,"output":14,"cacheRead":0.175,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"xhigh":"xhigh"}},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":1.75,"output":14,"cacheRead":0.175,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"xhigh":"xhigh"}},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":2.5,"output":15,"cacheRead":0.25,"cacheWrite":0},"contextWindow":1050000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"xhigh":"xhigh"}},"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":30,"cacheRead":0.5,"cacheWrite":0},"contextWindow":1050000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"xhigh":"xhigh"}},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":1,"output":6,"cacheRead":0.1,"cacheWrite":0},"contextWindow":1050000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"xhigh":"xhigh","max":"max"}},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":30,"cacheRead":0.5,"cacheWrite":0},"contextWindow":1050000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"xhigh":"xhigh","max":"max"}},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":2.5,"output":15,"cacheRead":0.25,"cacheWrite":0},"contextWindow":1050000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"xhigh":"xhigh","max":"max"}},"o1":{"id":"o1","name":"o1","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":15,"output":60,"cacheRead":7.5,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000},"o3":{"id":"o3","name":"o3","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":8,"cacheRead":0.5,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000},"o3-mini":{"id":"o3-mini","name":"o3-mini","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text"],"cost":{"input":1.1,"output":4.4,"cacheRead":0.55,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000},"o3-pro":{"id":"o3-pro","name":"o3-pro","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":20,"output":80,"cacheRead":0,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000},"o4-mini":{"id":"o4-mini","name":"o4-mini","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":1.1,"output":4.4,"cacheRead":0.28,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000},"workers-ai/@cf/moonshotai/kimi-k2.5":{"id":"workers-ai/@cf/moonshotai/kimi-k2.5","name":"Kimi K2.5","api":"openai-completions","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat","reasoning":true,"input":["text","image"],"cost":{"input":0.6,"output":3,"cacheRead":0.1,"cacheWrite":0},"contextWindow":256000,"maxTokens":256000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true}},"workers-ai/@cf/moonshotai/kimi-k2.6":{"id":"workers-ai/@cf/moonshotai/kimi-k2.6","name":"Kimi K2.6","api":"openai-completions","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat","reasoning":true,"input":["text","image"],"cost":{"input":0.95,"output":4,"cacheRead":0.16,"cacheWrite":0},"contextWindow":256000,"maxTokens":256000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true}},"workers-ai/@cf/nvidia/nemotron-3-120b-a12b":{"id":"workers-ai/@cf/nvidia/nemotron-3-120b-a12b","name":"Nemotron 3 Super 120B","api":"openai-completions","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat","reasoning":true,"input":["text"],"cost":{"input":0.5,"output":1.5,"cacheRead":0,"cacheWrite":0},"contextWindow":256000,"maxTokens":256000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true}},"workers-ai/@cf/zai-org/glm-4.7-flash":{"id":"workers-ai/@cf/zai-org/glm-4.7-flash","name":"GLM-4.7-Flash","api":"openai-completions","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat","reasoning":true,"input":["text"],"cost":{"input":0.06,"output":0.4,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":131072,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true}},"workers-ai/@cf/zai-org/glm-5.2":{"id":"workers-ai/@cf/zai-org/glm-5.2","name":"Glm 5.2","api":"openai-completions","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat","reasoning":true,"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.26,"cacheWrite":0},"contextWindow":262144,"maxTokens":262144,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true}}}
|
|
1
|
+
{"claude-3-5-haiku":{"id":"claude-3-5-haiku","name":"Claude Haiku 3.5 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":false,"input":["text","image"],"cost":{"input":0.8,"output":4,"cacheRead":0.08,"cacheWrite":1},"contextWindow":200000,"maxTokens":8192,"compat":{"sendSessionAffinityHeaders":true}},"claude-3-haiku":{"id":"claude-3-haiku","name":"Claude Haiku 3","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":false,"input":["text","image"],"cost":{"input":0.25,"output":1.25,"cacheRead":0.03,"cacheWrite":0.3},"contextWindow":200000,"maxTokens":4096,"compat":{"sendSessionAffinityHeaders":true}},"claude-3-opus":{"id":"claude-3-opus","name":"Claude Opus 3","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":false,"input":["text","image"],"cost":{"input":15,"output":75,"cacheRead":1.5,"cacheWrite":18.75},"contextWindow":200000,"maxTokens":4096,"compat":{"sendSessionAffinityHeaders":true}},"claude-3-sonnet":{"id":"claude-3-sonnet","name":"Claude Sonnet 3","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":false,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":0.3},"contextWindow":200000,"maxTokens":4096,"compat":{"sendSessionAffinityHeaders":true}},"claude-3.5-haiku":{"id":"claude-3.5-haiku","name":"Claude Haiku 3.5 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":false,"input":["text","image"],"cost":{"input":0.8,"output":4,"cacheRead":0.08,"cacheWrite":1},"contextWindow":200000,"maxTokens":8192,"compat":{"sendSessionAffinityHeaders":true}},"claude-3.5-sonnet":{"id":"claude-3.5-sonnet","name":"Claude Sonnet 3.5 v2","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":false,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":3.75},"contextWindow":200000,"maxTokens":8192,"compat":{"sendSessionAffinityHeaders":true}},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":10,"output":50,"cacheRead":1,"cacheWrite":12.5},"contextWindow":1000000,"maxTokens":128000,"compat":{"sendSessionAffinityHeaders":true,"forceAdaptiveThinking":true},"thinkingLevelMap":{"off":null,"xhigh":"xhigh","max":"max"}},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":1,"output":5,"cacheRead":0.1,"cacheWrite":1.25},"contextWindow":200000,"maxTokens":64000,"compat":{"sendSessionAffinityHeaders":true}},"claude-opus-4":{"id":"claude-opus-4","name":"Claude Opus 4 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":15,"output":75,"cacheRead":1.5,"cacheWrite":18.75},"contextWindow":200000,"maxTokens":32000,"compat":{"sendSessionAffinityHeaders":true}},"claude-opus-4-1":{"id":"claude-opus-4-1","name":"Claude Opus 4.1 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":15,"output":75,"cacheRead":1.5,"cacheWrite":18.75},"contextWindow":200000,"maxTokens":32000,"compat":{"sendSessionAffinityHeaders":true}},"claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"contextWindow":200000,"maxTokens":64000,"compat":{"sendSessionAffinityHeaders":true}},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"contextWindow":1000000,"maxTokens":128000,"compat":{"sendSessionAffinityHeaders":true,"forceAdaptiveThinking":true},"thinkingLevelMap":{"max":"max"}},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"contextWindow":1000000,"maxTokens":128000,"compat":{"sendSessionAffinityHeaders":true,"forceAdaptiveThinking":true,"supportsTemperature":false},"thinkingLevelMap":{"xhigh":"xhigh","max":"max"}},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"contextWindow":1000000,"maxTokens":128000,"compat":{"sendSessionAffinityHeaders":true,"forceAdaptiveThinking":true,"supportsTemperature":false},"thinkingLevelMap":{"xhigh":"xhigh","max":"max"}},"claude-sonnet-4":{"id":"claude-sonnet-4","name":"Claude Sonnet 4 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":3.75},"contextWindow":200000,"maxTokens":64000,"compat":{"sendSessionAffinityHeaders":true}},"claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":3.75},"contextWindow":200000,"maxTokens":64000,"compat":{"sendSessionAffinityHeaders":true}},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":3.75},"contextWindow":1000000,"maxTokens":64000,"compat":{"sendSessionAffinityHeaders":true,"forceAdaptiveThinking":true},"thinkingLevelMap":{"max":"max"}},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","api":"anthropic-messages","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":10,"cacheRead":0.2,"cacheWrite":2.5},"contextWindow":1000000,"maxTokens":128000,"compat":{"sendSessionAffinityHeaders":true,"forceAdaptiveThinking":true},"thinkingLevelMap":{"xhigh":"xhigh","max":"max"}},"gpt-4":{"id":"gpt-4","name":"GPT-4","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":false,"input":["text"],"cost":{"input":30,"output":60,"cacheRead":0,"cacheWrite":0},"contextWindow":8192,"maxTokens":8192},"gpt-4-turbo":{"id":"gpt-4-turbo","name":"GPT-4 Turbo","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":false,"input":["text","image"],"cost":{"input":10,"output":30,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":4096},"gpt-4o":{"id":"gpt-4o","name":"GPT-4o","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":false,"input":["text","image"],"cost":{"input":2.5,"output":10,"cacheRead":1.25,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384},"gpt-4o-mini":{"id":"gpt-4o-mini","name":"GPT-4o mini","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":false,"input":["text","image"],"cost":{"input":0.15,"output":0.6,"cacheRead":0.08,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384},"gpt-5.1":{"id":"gpt-5.1","name":"GPT-5.1","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0.13,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"gpt-5.1-codex":{"id":"gpt-5.1-codex","name":"GPT-5.1 Codex","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0.125,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"gpt-5.2":{"id":"gpt-5.2","name":"GPT-5.2","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":1.75,"output":14,"cacheRead":0.175,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null}},"gpt-5.2-codex":{"id":"gpt-5.2-codex","name":"GPT-5.2 Codex","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":1.75,"output":14,"cacheRead":0.175,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null}},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":1.75,"output":14,"cacheRead":0.175,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null}},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":2.5,"output":15,"cacheRead":0.25,"cacheWrite":0},"contextWindow":1050000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null}},"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":30,"cacheRead":0.5,"cacheWrite":0},"contextWindow":1050000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null}},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":1,"output":6,"cacheRead":0.1,"cacheWrite":0},"contextWindow":1050000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"}},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":30,"cacheRead":0.5,"cacheWrite":0},"contextWindow":1050000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"}},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":2.5,"output":15,"cacheRead":0.25,"cacheWrite":0},"contextWindow":1050000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"}},"o1":{"id":"o1","name":"o1","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":15,"output":60,"cacheRead":7.5,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"o3":{"id":"o3","name":"o3","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":8,"cacheRead":0.5,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"o3-mini":{"id":"o3-mini","name":"o3-mini","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text"],"cost":{"input":1.1,"output":4.4,"cacheRead":0.55,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"o3-pro":{"id":"o3-pro","name":"o3-pro","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":20,"output":80,"cacheRead":0,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"o4-mini":{"id":"o4-mini","name":"o4-mini","api":"openai-responses","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai","reasoning":true,"input":["text","image"],"cost":{"input":1.1,"output":4.4,"cacheRead":0.28,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"workers-ai/@cf/moonshotai/kimi-k2.5":{"id":"workers-ai/@cf/moonshotai/kimi-k2.5","name":"Kimi K2.5","api":"openai-completions","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat","reasoning":true,"input":["text","image"],"cost":{"input":0.6,"output":3,"cacheRead":0.1,"cacheWrite":0},"contextWindow":256000,"maxTokens":256000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true}},"workers-ai/@cf/moonshotai/kimi-k2.6":{"id":"workers-ai/@cf/moonshotai/kimi-k2.6","name":"Kimi K2.6","api":"openai-completions","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat","reasoning":true,"input":["text","image"],"cost":{"input":0.95,"output":4,"cacheRead":0.16,"cacheWrite":0},"contextWindow":256000,"maxTokens":256000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true}},"workers-ai/@cf/nvidia/nemotron-3-120b-a12b":{"id":"workers-ai/@cf/nvidia/nemotron-3-120b-a12b","name":"Nemotron 3 Super 120B","api":"openai-completions","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat","reasoning":true,"input":["text"],"cost":{"input":0.5,"output":1.5,"cacheRead":0,"cacheWrite":0},"contextWindow":256000,"maxTokens":256000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true}},"workers-ai/@cf/zai-org/glm-4.7-flash":{"id":"workers-ai/@cf/zai-org/glm-4.7-flash","name":"GLM-4.7-Flash","api":"openai-completions","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat","reasoning":true,"input":["text"],"cost":{"input":0.06,"output":0.4,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":131072,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true}},"workers-ai/@cf/zai-org/glm-5.2":{"id":"workers-ai/@cf/zai-org/glm-5.2","name":"Glm 5.2","api":"openai-completions","provider":"cloudflare-ai-gateway","baseUrl":"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/compat","reasoning":true,"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.26,"cacheWrite":0},"contextWindow":262144,"maxTokens":262144,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true}}}
|