@ai-sdk/gateway 4.0.0-beta.1 → 4.0.0-beta.108
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/CHANGELOG.md +794 -4
- package/dist/index.d.ts +314 -42
- package/dist/index.js +1369 -397
- package/dist/index.js.map +1 -1
- package/docs/00-ai-gateway.mdx +447 -61
- package/package.json +15 -15
- package/src/errors/as-gateway-error.ts +2 -1
- package/src/errors/create-gateway-error.ts +17 -3
- package/src/errors/gateway-authentication-error.ts +8 -5
- package/src/errors/gateway-error.ts +8 -0
- package/src/errors/gateway-failed-dependency-error.ts +35 -0
- package/src/errors/gateway-forbidden-error.ts +34 -0
- package/src/errors/gateway-response-error.ts +1 -1
- package/src/errors/index.ts +2 -0
- package/src/errors/parse-auth-method.ts +1 -2
- package/src/gateway-config.ts +1 -1
- package/src/gateway-embedding-model-settings.ts +1 -0
- package/src/gateway-embedding-model.ts +62 -15
- package/src/gateway-fetch-metadata.ts +51 -38
- package/src/gateway-generation-info.ts +149 -0
- package/src/gateway-headers.ts +3 -0
- package/src/gateway-image-model-settings.ts +14 -1
- package/src/gateway-image-model.ts +46 -21
- package/src/gateway-language-model-settings.ts +52 -31
- package/src/gateway-language-model.ts +72 -42
- package/src/gateway-model-entry.ts +15 -3
- package/src/gateway-provider-options.ts +50 -78
- package/src/gateway-provider.ts +239 -35
- package/src/gateway-realtime-auth.ts +126 -0
- package/src/gateway-realtime-model-settings.ts +1 -0
- package/src/gateway-realtime-model.ts +107 -0
- package/src/gateway-reranking-model-settings.ts +7 -0
- package/src/gateway-reranking-model.ts +142 -0
- package/src/gateway-speech-model-settings.ts +1 -0
- package/src/gateway-speech-model.ts +145 -0
- package/src/gateway-spend-report.ts +193 -0
- package/src/gateway-transcription-model-settings.ts +1 -0
- package/src/gateway-transcription-model.ts +155 -0
- package/src/gateway-video-model-settings.ts +4 -0
- package/src/gateway-video-model.ts +29 -19
- package/src/index.ts +30 -5
- package/src/tool/parallel-search.ts +10 -11
- package/src/tool/perplexity-search.ts +10 -11
- package/dist/index.d.mts +0 -602
- package/dist/index.mjs +0 -1539
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createJsonErrorResponseHandler,
|
|
3
|
+
createJsonResponseHandler,
|
|
4
|
+
getFromApi,
|
|
5
|
+
lazySchema,
|
|
6
|
+
resolve,
|
|
7
|
+
zodSchema,
|
|
8
|
+
} from '@ai-sdk/provider-utils';
|
|
9
|
+
import { z } from 'zod/v4';
|
|
10
|
+
import { asGatewayError } from './errors';
|
|
11
|
+
import type { GatewayConfig } from './gateway-config';
|
|
12
|
+
|
|
13
|
+
export interface GatewayGenerationInfoParams {
|
|
14
|
+
/** The generation ID to look up (format: gen_<ulid>) */
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface GatewayGenerationInfo {
|
|
19
|
+
/** The generation ID */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Total cost in USD */
|
|
22
|
+
totalCost: number;
|
|
23
|
+
/** Upstream inference cost in USD (BYOK only) */
|
|
24
|
+
upstreamInferenceCost: number;
|
|
25
|
+
/** Usage cost in USD (same as totalCost) */
|
|
26
|
+
usage: number;
|
|
27
|
+
/** ISO 8601 timestamp when the generation was created */
|
|
28
|
+
createdAt: string;
|
|
29
|
+
/** Model identifier */
|
|
30
|
+
model: string;
|
|
31
|
+
/** Whether BYOK credentials were used */
|
|
32
|
+
isByok: boolean;
|
|
33
|
+
/** Provider that served this generation */
|
|
34
|
+
providerName: string;
|
|
35
|
+
/** Whether streaming was used */
|
|
36
|
+
streamed: boolean;
|
|
37
|
+
/** Finish reason (e.g. 'stop') */
|
|
38
|
+
finishReason: string;
|
|
39
|
+
/** Time to first token in milliseconds */
|
|
40
|
+
latency: number;
|
|
41
|
+
/** Total generation time in milliseconds */
|
|
42
|
+
generationTime: number;
|
|
43
|
+
/** Number of prompt tokens */
|
|
44
|
+
promptTokens: number;
|
|
45
|
+
/** Number of completion tokens */
|
|
46
|
+
completionTokens: number;
|
|
47
|
+
/** Reasoning tokens used */
|
|
48
|
+
reasoningTokens: number;
|
|
49
|
+
/** Cached tokens used */
|
|
50
|
+
cachedTokens: number;
|
|
51
|
+
/** Cache creation input tokens */
|
|
52
|
+
cacheCreationTokens: number;
|
|
53
|
+
/** Billable web search calls */
|
|
54
|
+
billableWebSearchCalls: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export class GatewayGenerationInfoFetcher {
|
|
58
|
+
constructor(private readonly config: GatewayConfig) {}
|
|
59
|
+
|
|
60
|
+
async getGenerationInfo(
|
|
61
|
+
params: GatewayGenerationInfoParams,
|
|
62
|
+
): Promise<GatewayGenerationInfo> {
|
|
63
|
+
try {
|
|
64
|
+
const baseUrl = new URL(this.config.baseURL);
|
|
65
|
+
|
|
66
|
+
const { value } = await getFromApi({
|
|
67
|
+
url: `${baseUrl.origin}/v1/generation?id=${encodeURIComponent(params.id)}`,
|
|
68
|
+
headers: this.config.headers
|
|
69
|
+
? await resolve(this.config.headers)
|
|
70
|
+
: undefined,
|
|
71
|
+
successfulResponseHandler: createJsonResponseHandler(
|
|
72
|
+
gatewayGenerationInfoResponseSchema,
|
|
73
|
+
),
|
|
74
|
+
failedResponseHandler: createJsonErrorResponseHandler({
|
|
75
|
+
errorSchema: z.any(),
|
|
76
|
+
errorToMessage: data => data,
|
|
77
|
+
}),
|
|
78
|
+
fetch: this.config.fetch,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
return value;
|
|
82
|
+
} catch (error) {
|
|
83
|
+
throw await asGatewayError(error);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const gatewayGenerationInfoResponseSchema = lazySchema(() =>
|
|
89
|
+
zodSchema(
|
|
90
|
+
z
|
|
91
|
+
.object({
|
|
92
|
+
data: z
|
|
93
|
+
.object({
|
|
94
|
+
id: z.string(),
|
|
95
|
+
total_cost: z.number(),
|
|
96
|
+
upstream_inference_cost: z.number(),
|
|
97
|
+
usage: z.number(),
|
|
98
|
+
created_at: z.string(),
|
|
99
|
+
model: z.string(),
|
|
100
|
+
is_byok: z.boolean(),
|
|
101
|
+
provider_name: z.string(),
|
|
102
|
+
streamed: z.boolean(),
|
|
103
|
+
finish_reason: z.string(),
|
|
104
|
+
latency: z.number(),
|
|
105
|
+
generation_time: z.number(),
|
|
106
|
+
native_tokens_prompt: z.number(),
|
|
107
|
+
native_tokens_completion: z.number(),
|
|
108
|
+
native_tokens_reasoning: z.number(),
|
|
109
|
+
native_tokens_cached: z.number(),
|
|
110
|
+
native_tokens_cache_creation: z.number(),
|
|
111
|
+
billable_web_search_calls: z.number(),
|
|
112
|
+
})
|
|
113
|
+
.transform(
|
|
114
|
+
({
|
|
115
|
+
total_cost,
|
|
116
|
+
upstream_inference_cost,
|
|
117
|
+
created_at,
|
|
118
|
+
is_byok,
|
|
119
|
+
provider_name,
|
|
120
|
+
finish_reason,
|
|
121
|
+
generation_time,
|
|
122
|
+
native_tokens_prompt,
|
|
123
|
+
native_tokens_completion,
|
|
124
|
+
native_tokens_reasoning,
|
|
125
|
+
native_tokens_cached,
|
|
126
|
+
native_tokens_cache_creation,
|
|
127
|
+
billable_web_search_calls,
|
|
128
|
+
...rest
|
|
129
|
+
}) => ({
|
|
130
|
+
...rest,
|
|
131
|
+
totalCost: total_cost,
|
|
132
|
+
upstreamInferenceCost: upstream_inference_cost,
|
|
133
|
+
createdAt: created_at,
|
|
134
|
+
isByok: is_byok,
|
|
135
|
+
providerName: provider_name,
|
|
136
|
+
finishReason: finish_reason,
|
|
137
|
+
generationTime: generation_time,
|
|
138
|
+
promptTokens: native_tokens_prompt,
|
|
139
|
+
completionTokens: native_tokens_completion,
|
|
140
|
+
reasoningTokens: native_tokens_reasoning,
|
|
141
|
+
cachedTokens: native_tokens_cached,
|
|
142
|
+
cacheCreationTokens: native_tokens_cache_creation,
|
|
143
|
+
billableWebSearchCalls: billable_web_search_calls,
|
|
144
|
+
}),
|
|
145
|
+
),
|
|
146
|
+
})
|
|
147
|
+
.transform(({ data }) => data),
|
|
148
|
+
),
|
|
149
|
+
);
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
export type GatewayImageModelId =
|
|
2
|
+
| 'bfl/flux-2-flex'
|
|
3
|
+
| 'bfl/flux-2-klein-4b'
|
|
4
|
+
| 'bfl/flux-2-klein-9b'
|
|
5
|
+
| 'bfl/flux-2-max'
|
|
6
|
+
| 'bfl/flux-2-pro'
|
|
2
7
|
| 'bfl/flux-kontext-max'
|
|
3
8
|
| 'bfl/flux-kontext-pro'
|
|
4
9
|
| 'bfl/flux-pro-1.0-fill'
|
|
5
10
|
| 'bfl/flux-pro-1.1'
|
|
6
11
|
| 'bfl/flux-pro-1.1-ultra'
|
|
12
|
+
| 'bytedance/seedream-4.0'
|
|
13
|
+
| 'bytedance/seedream-4.5'
|
|
14
|
+
| 'bytedance/seedream-5.0-lite'
|
|
7
15
|
| 'google/imagen-4.0-fast-generate-001'
|
|
8
16
|
| 'google/imagen-4.0-generate-001'
|
|
9
17
|
| 'google/imagen-4.0-ultra-generate-001'
|
|
10
18
|
| 'openai/gpt-image-1'
|
|
11
19
|
| 'openai/gpt-image-1-mini'
|
|
12
20
|
| 'openai/gpt-image-1.5'
|
|
21
|
+
| 'openai/gpt-image-2'
|
|
22
|
+
| 'prodia/flux-fast-schnell'
|
|
13
23
|
| 'recraft/recraft-v2'
|
|
14
24
|
| 'recraft/recraft-v3'
|
|
15
25
|
| 'recraft/recraft-v4'
|
|
16
26
|
| 'recraft/recraft-v4-pro'
|
|
27
|
+
| 'recraft/recraft-v4.1'
|
|
28
|
+
| 'recraft/recraft-v4.1-pro'
|
|
29
|
+
| 'recraft/recraft-v4.1-utility'
|
|
30
|
+
| 'recraft/recraft-v4.1-utility-pro'
|
|
17
31
|
| 'xai/grok-imagine-image'
|
|
18
|
-
| 'xai/grok-imagine-image-pro'
|
|
19
32
|
| (string & {});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
ImageModelV4,
|
|
3
|
+
ImageModelV4File,
|
|
4
|
+
ImageModelV4ProviderMetadata,
|
|
5
5
|
} from '@ai-sdk/provider';
|
|
6
6
|
import {
|
|
7
7
|
combineHeaders,
|
|
@@ -10,6 +10,9 @@ import {
|
|
|
10
10
|
createJsonErrorResponseHandler,
|
|
11
11
|
postJsonToApi,
|
|
12
12
|
resolve,
|
|
13
|
+
serializeModelOptions,
|
|
14
|
+
WORKFLOW_SERIALIZE,
|
|
15
|
+
WORKFLOW_DESERIALIZE,
|
|
13
16
|
type Resolvable,
|
|
14
17
|
} from '@ai-sdk/provider-utils';
|
|
15
18
|
import { z } from 'zod/v4';
|
|
@@ -17,17 +20,33 @@ import type { GatewayConfig } from './gateway-config';
|
|
|
17
20
|
import { asGatewayError } from './errors';
|
|
18
21
|
import { parseAuthMethod } from './errors/parse-auth-method';
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
type GatewayImageConfig = GatewayConfig & {
|
|
24
|
+
provider: string;
|
|
25
|
+
o11yHeaders: Resolvable<Record<string, string>>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export class GatewayImageModel implements ImageModelV4 {
|
|
29
|
+
readonly specificationVersion = 'v4' as const;
|
|
22
30
|
// Set a very large number to prevent client-side splitting of requests
|
|
23
31
|
readonly maxImagesPerCall = Number.MAX_SAFE_INTEGER;
|
|
24
32
|
|
|
33
|
+
static [WORKFLOW_SERIALIZE](model: GatewayImageModel) {
|
|
34
|
+
return serializeModelOptions({
|
|
35
|
+
modelId: model.modelId,
|
|
36
|
+
config: model.config,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
41
|
+
modelId: string;
|
|
42
|
+
config: GatewayImageConfig;
|
|
43
|
+
}) {
|
|
44
|
+
return new GatewayImageModel(options.modelId, options.config);
|
|
45
|
+
}
|
|
46
|
+
|
|
25
47
|
constructor(
|
|
26
48
|
readonly modelId: string,
|
|
27
|
-
private readonly config:
|
|
28
|
-
provider: string;
|
|
29
|
-
o11yHeaders: Resolvable<Record<string, string>>;
|
|
30
|
-
},
|
|
49
|
+
private readonly config: GatewayImageConfig,
|
|
31
50
|
) {}
|
|
32
51
|
|
|
33
52
|
get provider(): string {
|
|
@@ -45,16 +64,14 @@ export class GatewayImageModel implements ImageModelV3 {
|
|
|
45
64
|
providerOptions,
|
|
46
65
|
headers,
|
|
47
66
|
abortSignal,
|
|
48
|
-
}: Parameters<
|
|
49
|
-
Awaited<ReturnType<
|
|
67
|
+
}: Parameters<ImageModelV4['doGenerate']>[0]): Promise<
|
|
68
|
+
Awaited<ReturnType<ImageModelV4['doGenerate']>>
|
|
50
69
|
> {
|
|
51
|
-
const resolvedHeaders =
|
|
70
|
+
const resolvedHeaders = this.config.headers
|
|
71
|
+
? await resolve(this.config.headers)
|
|
72
|
+
: undefined;
|
|
52
73
|
try {
|
|
53
|
-
const {
|
|
54
|
-
responseHeaders,
|
|
55
|
-
value: responseBody,
|
|
56
|
-
rawValue,
|
|
57
|
-
} = await postJsonToApi({
|
|
74
|
+
const { responseHeaders, value: responseBody } = await postJsonToApi({
|
|
58
75
|
url: this.getUrl(),
|
|
59
76
|
headers: combineHeaders(
|
|
60
77
|
resolvedHeaders,
|
|
@@ -89,7 +106,7 @@ export class GatewayImageModel implements ImageModelV3 {
|
|
|
89
106
|
images: responseBody.images, // Always base64 strings from server
|
|
90
107
|
warnings: responseBody.warnings ?? [],
|
|
91
108
|
providerMetadata:
|
|
92
|
-
responseBody.providerMetadata as
|
|
109
|
+
responseBody.providerMetadata as ImageModelV4ProviderMetadata,
|
|
93
110
|
response: {
|
|
94
111
|
timestamp: new Date(),
|
|
95
112
|
modelId: this.modelId,
|
|
@@ -104,7 +121,10 @@ export class GatewayImageModel implements ImageModelV3 {
|
|
|
104
121
|
}),
|
|
105
122
|
};
|
|
106
123
|
} catch (error) {
|
|
107
|
-
throw await asGatewayError(
|
|
124
|
+
throw await asGatewayError(
|
|
125
|
+
error,
|
|
126
|
+
await parseAuthMethod(resolvedHeaders ?? {}),
|
|
127
|
+
);
|
|
108
128
|
}
|
|
109
129
|
}
|
|
110
130
|
|
|
@@ -114,13 +134,13 @@ export class GatewayImageModel implements ImageModelV3 {
|
|
|
114
134
|
|
|
115
135
|
private getModelConfigHeaders() {
|
|
116
136
|
return {
|
|
117
|
-
'ai-image-model-specification-version': '
|
|
137
|
+
'ai-image-model-specification-version': '4',
|
|
118
138
|
'ai-model-id': this.modelId,
|
|
119
139
|
};
|
|
120
140
|
}
|
|
121
141
|
}
|
|
122
142
|
|
|
123
|
-
function maybeEncodeImageFile(file:
|
|
143
|
+
function maybeEncodeImageFile(file: ImageModelV4File) {
|
|
124
144
|
if (file.type === 'file' && file.data instanceof Uint8Array) {
|
|
125
145
|
return {
|
|
126
146
|
...file,
|
|
@@ -147,6 +167,11 @@ const gatewayImageWarningSchema = z.discriminatedUnion('type', [
|
|
|
147
167
|
feature: z.string(),
|
|
148
168
|
details: z.string().optional(),
|
|
149
169
|
}),
|
|
170
|
+
z.object({
|
|
171
|
+
type: z.literal('deprecated'),
|
|
172
|
+
setting: z.string(),
|
|
173
|
+
message: z.string(),
|
|
174
|
+
}),
|
|
150
175
|
z.object({
|
|
151
176
|
type: z.literal('other'),
|
|
152
177
|
message: z.string(),
|
|
@@ -3,6 +3,7 @@ export type GatewayModelId =
|
|
|
3
3
|
| 'alibaba/qwen-3-235b'
|
|
4
4
|
| 'alibaba/qwen-3-30b'
|
|
5
5
|
| 'alibaba/qwen-3-32b'
|
|
6
|
+
| 'alibaba/qwen-3.6-max-preview'
|
|
6
7
|
| 'alibaba/qwen3-235b-a22b-thinking'
|
|
7
8
|
| 'alibaba/qwen3-coder'
|
|
8
9
|
| 'alibaba/qwen3-coder-30b-a3b'
|
|
@@ -13,29 +14,33 @@ export type GatewayModelId =
|
|
|
13
14
|
| 'alibaba/qwen3-max-thinking'
|
|
14
15
|
| 'alibaba/qwen3-next-80b-a3b-instruct'
|
|
15
16
|
| 'alibaba/qwen3-next-80b-a3b-thinking'
|
|
17
|
+
| 'alibaba/qwen3-vl-235b-a22b-instruct'
|
|
16
18
|
| 'alibaba/qwen3-vl-instruct'
|
|
17
19
|
| 'alibaba/qwen3-vl-thinking'
|
|
18
20
|
| 'alibaba/qwen3.5-flash'
|
|
19
21
|
| 'alibaba/qwen3.5-plus'
|
|
22
|
+
| 'alibaba/qwen3.6-27b'
|
|
23
|
+
| 'alibaba/qwen3.6-plus'
|
|
24
|
+
| 'alibaba/qwen3.7-max'
|
|
25
|
+
| 'alibaba/qwen3.7-plus'
|
|
20
26
|
| 'amazon/nova-2-lite'
|
|
21
27
|
| 'amazon/nova-lite'
|
|
22
28
|
| 'amazon/nova-micro'
|
|
23
29
|
| 'amazon/nova-pro'
|
|
24
30
|
| 'anthropic/claude-3-haiku'
|
|
25
|
-
| 'anthropic/claude-3-opus'
|
|
26
31
|
| 'anthropic/claude-3.5-haiku'
|
|
27
|
-
| 'anthropic/claude-3.5-sonnet'
|
|
28
|
-
| 'anthropic/claude-3.5-sonnet-20240620'
|
|
29
|
-
| 'anthropic/claude-3.7-sonnet'
|
|
30
32
|
| 'anthropic/claude-haiku-4.5'
|
|
31
33
|
| 'anthropic/claude-opus-4'
|
|
32
34
|
| 'anthropic/claude-opus-4.1'
|
|
33
35
|
| 'anthropic/claude-opus-4.5'
|
|
34
36
|
| 'anthropic/claude-opus-4.6'
|
|
37
|
+
| 'anthropic/claude-opus-4.7'
|
|
38
|
+
| 'anthropic/claude-opus-4.8'
|
|
35
39
|
| 'anthropic/claude-sonnet-4'
|
|
36
40
|
| 'anthropic/claude-sonnet-4.5'
|
|
37
41
|
| 'anthropic/claude-sonnet-4.6'
|
|
38
42
|
| 'arcee-ai/trinity-large-preview'
|
|
43
|
+
| 'arcee-ai/trinity-large-thinking'
|
|
39
44
|
| 'arcee-ai/trinity-mini'
|
|
40
45
|
| 'bytedance/seed-1.6'
|
|
41
46
|
| 'bytedance/seed-1.8'
|
|
@@ -46,25 +51,30 @@ export type GatewayModelId =
|
|
|
46
51
|
| 'deepseek/deepseek-v3.1-terminus'
|
|
47
52
|
| 'deepseek/deepseek-v3.2'
|
|
48
53
|
| 'deepseek/deepseek-v3.2-thinking'
|
|
49
|
-
| '
|
|
50
|
-
| '
|
|
54
|
+
| 'deepseek/deepseek-v4-flash'
|
|
55
|
+
| 'deepseek/deepseek-v4-pro'
|
|
51
56
|
| 'google/gemini-2.5-flash'
|
|
52
57
|
| 'google/gemini-2.5-flash-image'
|
|
53
58
|
| 'google/gemini-2.5-flash-lite'
|
|
54
|
-
| 'google/gemini-2.5-flash-lite-preview-09-2025'
|
|
55
|
-
| 'google/gemini-2.5-flash-preview-09-2025'
|
|
56
59
|
| 'google/gemini-2.5-pro'
|
|
57
60
|
| 'google/gemini-3-flash'
|
|
58
61
|
| 'google/gemini-3-pro-image'
|
|
59
62
|
| 'google/gemini-3-pro-preview'
|
|
63
|
+
| 'google/gemini-3.1-flash-image'
|
|
60
64
|
| 'google/gemini-3.1-flash-image-preview'
|
|
65
|
+
| 'google/gemini-3.1-flash-lite'
|
|
61
66
|
| 'google/gemini-3.1-flash-lite-preview'
|
|
62
67
|
| 'google/gemini-3.1-pro-preview'
|
|
68
|
+
| 'google/gemini-3.5-flash'
|
|
69
|
+
| 'google/gemma-4-26b-a4b-it'
|
|
70
|
+
| 'google/gemma-4-31b-it'
|
|
63
71
|
| 'inception/mercury-2'
|
|
64
72
|
| 'inception/mercury-coder-small'
|
|
73
|
+
| 'interfaze/interfaze-beta'
|
|
65
74
|
| 'kwaipilot/kat-coder-pro-v1'
|
|
75
|
+
| 'kwaipilot/kat-coder-pro-v2'
|
|
66
76
|
| 'meituan/longcat-flash-chat'
|
|
67
|
-
| 'meituan/longcat-flash-thinking'
|
|
77
|
+
| 'meituan/longcat-flash-thinking-2601'
|
|
68
78
|
| 'meta/llama-3.1-70b'
|
|
69
79
|
| 'meta/llama-3.1-8b'
|
|
70
80
|
| 'meta/llama-3.2-11b'
|
|
@@ -78,6 +88,10 @@ export type GatewayModelId =
|
|
|
78
88
|
| 'minimax/minimax-m2.1'
|
|
79
89
|
| 'minimax/minimax-m2.1-lightning'
|
|
80
90
|
| 'minimax/minimax-m2.5'
|
|
91
|
+
| 'minimax/minimax-m2.5-highspeed'
|
|
92
|
+
| 'minimax/minimax-m2.7'
|
|
93
|
+
| 'minimax/minimax-m2.7-highspeed'
|
|
94
|
+
| 'minimax/minimax-m3'
|
|
81
95
|
| 'mistral/codestral'
|
|
82
96
|
| 'mistral/devstral-2'
|
|
83
97
|
| 'mistral/devstral-small'
|
|
@@ -89,23 +103,24 @@ export type GatewayModelId =
|
|
|
89
103
|
| 'mistral/ministral-8b'
|
|
90
104
|
| 'mistral/mistral-large-3'
|
|
91
105
|
| 'mistral/mistral-medium'
|
|
106
|
+
| 'mistral/mistral-medium-3.5'
|
|
92
107
|
| 'mistral/mistral-nemo'
|
|
93
108
|
| 'mistral/mistral-small'
|
|
94
|
-
| 'mistral/mixtral-8x22b-instruct'
|
|
95
109
|
| 'mistral/pixtral-12b'
|
|
96
110
|
| 'mistral/pixtral-large'
|
|
97
111
|
| 'moonshotai/kimi-k2'
|
|
98
|
-
| 'moonshotai/kimi-k2-0905'
|
|
99
112
|
| 'moonshotai/kimi-k2-thinking'
|
|
100
|
-
| 'moonshotai/kimi-k2-thinking-turbo'
|
|
101
|
-
| 'moonshotai/kimi-k2-turbo'
|
|
102
113
|
| 'moonshotai/kimi-k2.5'
|
|
114
|
+
| 'moonshotai/kimi-k2.6'
|
|
115
|
+
| 'moonshotai/kimi-k2.7-code'
|
|
116
|
+
| 'moonshotai/kimi-k2.7-code-highspeed'
|
|
103
117
|
| 'morph/morph-v3-fast'
|
|
104
118
|
| 'morph/morph-v3-large'
|
|
105
119
|
| 'nvidia/nemotron-3-nano-30b-a3b'
|
|
120
|
+
| 'nvidia/nemotron-3-super-120b-a12b'
|
|
121
|
+
| 'nvidia/nemotron-3-ultra-550b-a55b'
|
|
106
122
|
| 'nvidia/nemotron-nano-12b-v2-vl'
|
|
107
123
|
| 'nvidia/nemotron-nano-9b-v2'
|
|
108
|
-
| 'openai/codex-mini'
|
|
109
124
|
| 'openai/gpt-3.5-turbo'
|
|
110
125
|
| 'openai/gpt-3.5-turbo-instruct'
|
|
111
126
|
| 'openai/gpt-4-turbo'
|
|
@@ -130,12 +145,14 @@ export type GatewayModelId =
|
|
|
130
145
|
| 'openai/gpt-5.2-chat'
|
|
131
146
|
| 'openai/gpt-5.2-codex'
|
|
132
147
|
| 'openai/gpt-5.2-pro'
|
|
133
|
-
| 'openai/gpt-5.4'
|
|
134
|
-
| 'openai/gpt-5.4-2026-03-05'
|
|
135
|
-
| 'openai/gpt-5.4-pro'
|
|
136
|
-
| 'openai/gpt-5.4-pro-2026-03-05'
|
|
137
148
|
| 'openai/gpt-5.3-chat'
|
|
138
149
|
| 'openai/gpt-5.3-codex'
|
|
150
|
+
| 'openai/gpt-5.4'
|
|
151
|
+
| 'openai/gpt-5.4-mini'
|
|
152
|
+
| 'openai/gpt-5.4-nano'
|
|
153
|
+
| 'openai/gpt-5.4-pro'
|
|
154
|
+
| 'openai/gpt-5.5'
|
|
155
|
+
| 'openai/gpt-5.5-pro'
|
|
139
156
|
| 'openai/gpt-oss-120b'
|
|
140
157
|
| 'openai/gpt-oss-20b'
|
|
141
158
|
| 'openai/gpt-oss-safeguard-20b'
|
|
@@ -147,23 +164,23 @@ export type GatewayModelId =
|
|
|
147
164
|
| 'openai/o4-mini'
|
|
148
165
|
| 'perplexity/sonar'
|
|
149
166
|
| 'perplexity/sonar-pro'
|
|
150
|
-
| 'perplexity/sonar-reasoning'
|
|
151
167
|
| 'perplexity/sonar-reasoning-pro'
|
|
152
|
-
| '
|
|
153
|
-
| '
|
|
154
|
-
| 'vercel/v0-1.5-md'
|
|
155
|
-
| 'xai/grok-2-vision'
|
|
156
|
-
| 'xai/grok-3'
|
|
157
|
-
| 'xai/grok-3-fast'
|
|
158
|
-
| 'xai/grok-3-mini'
|
|
159
|
-
| 'xai/grok-3-mini-fast'
|
|
160
|
-
| 'xai/grok-4'
|
|
161
|
-
| 'xai/grok-4-fast-non-reasoning'
|
|
162
|
-
| 'xai/grok-4-fast-reasoning'
|
|
168
|
+
| 'stepfun/step-3.5-flash'
|
|
169
|
+
| 'stepfun/step-3.7-flash'
|
|
163
170
|
| 'xai/grok-4.1-fast-non-reasoning'
|
|
164
171
|
| 'xai/grok-4.1-fast-reasoning'
|
|
165
|
-
| 'xai/grok-
|
|
172
|
+
| 'xai/grok-4.20-multi-agent'
|
|
173
|
+
| 'xai/grok-4.20-multi-agent-beta'
|
|
174
|
+
| 'xai/grok-4.20-non-reasoning'
|
|
175
|
+
| 'xai/grok-4.20-non-reasoning-beta'
|
|
176
|
+
| 'xai/grok-4.20-reasoning'
|
|
177
|
+
| 'xai/grok-4.20-reasoning-beta'
|
|
178
|
+
| 'xai/grok-4.3'
|
|
179
|
+
| 'xai/grok-build-0.1'
|
|
166
180
|
| 'xiaomi/mimo-v2-flash'
|
|
181
|
+
| 'xiaomi/mimo-v2-pro'
|
|
182
|
+
| 'xiaomi/mimo-v2.5'
|
|
183
|
+
| 'xiaomi/mimo-v2.5-pro'
|
|
167
184
|
| 'zai/glm-4.5'
|
|
168
185
|
| 'zai/glm-4.5-air'
|
|
169
186
|
| 'zai/glm-4.5v'
|
|
@@ -171,6 +188,10 @@ export type GatewayModelId =
|
|
|
171
188
|
| 'zai/glm-4.6v'
|
|
172
189
|
| 'zai/glm-4.6v-flash'
|
|
173
190
|
| 'zai/glm-4.7'
|
|
191
|
+
| 'zai/glm-4.7-flash'
|
|
174
192
|
| 'zai/glm-4.7-flashx'
|
|
175
193
|
| 'zai/glm-5'
|
|
194
|
+
| 'zai/glm-5-turbo'
|
|
195
|
+
| 'zai/glm-5.1'
|
|
196
|
+
| 'zai/glm-5v-turbo'
|
|
176
197
|
| (string & {});
|