Skip to content

Commit f96378a

Browse files
committed
feat(providers): add Kie provider for Claude, GPT, Grok, and Kimi models
1 parent 59ee92b commit f96378a

24 files changed

Lines changed: 877 additions & 13 deletions

File tree

‎apps/docs/components/icons.tsx‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4319,6 +4319,51 @@ export const ZaiIcon = (props: SVGProps<SVGSVGElement>) => (
43194319
</svg>
43204320
)
43214321

4322+
export function KieIcon(props: SVGProps<SVGSVGElement>) {
4323+
const id = useId()
4324+
const gradientId = `kie_gradient_${id}`
4325+
4326+
return (
4327+
<svg
4328+
{...props}
4329+
height='1em'
4330+
viewBox='0 0 24 24'
4331+
width='1em'
4332+
fill='none'
4333+
xmlns='http://www.w3.org/2000/svg'
4334+
>
4335+
<title>Kie</title>
4336+
<defs>
4337+
<linearGradient
4338+
id={gradientId}
4339+
x1='3'
4340+
y1='3'
4341+
x2='21'
4342+
y2='21'
4343+
gradientUnits='userSpaceOnUse'
4344+
>
4345+
<stop stopColor='#38B6FF' />
4346+
<stop offset='1' stopColor='#1D4ED8' />
4347+
</linearGradient>
4348+
</defs>
4349+
<g
4350+
stroke={`url(#${gradientId})`}
4351+
strokeWidth='1.6'
4352+
strokeLinecap='round'
4353+
strokeLinejoin='round'
4354+
>
4355+
<path d='M3.5 20.5 10.2 4.1a2 2 0 0 1 3.6 0l6.7 16.4' />
4356+
<path d='M7.8 20.5 12 9.6l4.2 10.9' />
4357+
<path d='M9.4 16.4h5.2' />
4358+
<path d='M5.3 16.1H3.2' />
4359+
<path d='M18.7 16.1h2.1' />
4360+
</g>
4361+
<circle cx='2.4' cy='16.1' r='1.2' fill={`url(#${gradientId})`} />
4362+
<circle cx='21.6' cy='16.1' r='1.2' fill={`url(#${gradientId})`} />
4363+
</svg>
4364+
)
4365+
}
4366+
43224367
export const KimiIcon = (props: SVGProps<SVGSVGElement>) => (
43234368
<svg {...props} height='1em' viewBox='0 0 24 24' width='1em' xmlns='http://www.w3.org/2000/svg'>
43244369
<title>Kimi</title>

‎apps/docs/content/docs/workflows/blocks/agent.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ Live tool-call chips stream for **OpenAI, Anthropic, Azure Anthropic, Google, Ve
170170
| Groq | Full thinking deltas | `groq/openai/gpt-oss-120b`, `groq/openai/gpt-oss-20b`, `groq/openai/gpt-oss-safeguard-20b`, `groq/qwen/qwen3.8-27b`, `groq/qwen/qwen3.6-27b` |
171171
| Meta | Not streamed | `muse-spark-1.3`, `muse-spark-1.1` |
172172
| Kimi | Full thinking deltas | `kimi-k3`, `kimi-k2.6` |
173+
| Kie | Summaries only | `kie/claude-opus-5-5`, `kie/claude-opus-5`, `kie/claude-fable-5`, `kie/claude-sonnet-5`, `kie/claude-opus-4-8`, `kie/claude-opus-4-7`, `kie/claude-opus-4-6`, `kie/claude-sonnet-4-6`, `kie/claude-opus-4-5`, `kie/claude-sonnet-4-5`, `kie/claude-haiku-4-5`, `kie/gpt-6-astra`, `kie/gpt-6-sol`, `kie/gpt-6-luna`, `kie/gpt-5-6-sol`, `kie/gpt-5-6-terra`, `kie/gpt-5-6-luna`, `kie/gpt-5-5`, `kie/grok-4-6`, `kie/grok-4-5`, `kie/grok-4-3`, `kie/kimi-k3` |
173174
| Z.ai | Full thinking deltas | `glm-5.3`, `glm-5.3-flash`, `glm-5.2`, `glm-5.1`, `glm-5`, `glm-5-turbo`, `glm-4.7`, `glm-4.6`, `glm-4.5`, `glm-4.5-air` |
174175

175176
{/* agent-stream-capabilities:end */}

‎apps/sim/app/(landing)/models/utils.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const PROVIDER_PREFIXES: Record<string, string[]> = {
1414
baseten: ['baseten/'],
1515
'ollama-cloud': ['ollama-cloud/'],
1616
groq: ['groq/'],
17+
kie: ['kie/'],
1718
openrouter: ['openrouter/'],
1819
vllm: ['vllm/'],
1920
}

‎apps/sim/app/workspace/[workspaceId]/settings/components/byok/byok.tsx‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
HunterIOIcon,
2525
IcypeasIcon,
2626
JinaAIIcon,
27+
KieIcon,
2728
KimiIcon,
2829
LeadMagicIcon,
2930
LinkupIcon,
@@ -166,6 +167,13 @@ const PROVIDERS: (BYOKManagerProvider & { id: BYOKProviderId })[] = [
166167
description: 'LLM calls',
167168
placeholder: 'Enter your Ollama API key',
168169
},
170+
{
171+
id: 'kie',
172+
name: 'Kie',
173+
icon: KieIcon,
174+
description: 'LLM calls',
175+
placeholder: 'Enter your Kie API key',
176+
},
169177
{
170178
id: 'falai',
171179
name: 'Fal.ai',
@@ -365,6 +373,7 @@ const PROVIDER_SECTIONS: BYOKProviderSection[] = [
365373
'together',
366374
'baseten',
367375
'ollama-cloud',
376+
'kie',
368377
'falai',
369378
],
370379
},

‎apps/sim/components/icons.tsx‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4319,6 +4319,51 @@ export const ZaiIcon = (props: SVGProps<SVGSVGElement>) => (
43194319
</svg>
43204320
)
43214321

4322+
export function KieIcon(props: SVGProps<SVGSVGElement>) {
4323+
const id = useId()
4324+
const gradientId = `kie_gradient_${id}`
4325+
4326+
return (
4327+
<svg
4328+
{...props}
4329+
height='1em'
4330+
viewBox='0 0 24 24'
4331+
width='1em'
4332+
fill='none'
4333+
xmlns='http://www.w3.org/2000/svg'
4334+
>
4335+
<title>Kie</title>
4336+
<defs>
4337+
<linearGradient
4338+
id={gradientId}
4339+
x1='3'
4340+
y1='3'
4341+
x2='21'
4342+
y2='21'
4343+
gradientUnits='userSpaceOnUse'
4344+
>
4345+
<stop stopColor='#38B6FF' />
4346+
<stop offset='1' stopColor='#1D4ED8' />
4347+
</linearGradient>
4348+
</defs>
4349+
<g
4350+
stroke={`url(#${gradientId})`}
4351+
strokeWidth='1.6'
4352+
strokeLinecap='round'
4353+
strokeLinejoin='round'
4354+
>
4355+
<path d='M3.5 20.5 10.2 4.1a2 2 0 0 1 3.6 0l6.7 16.4' />
4356+
<path d='M7.8 20.5 12 9.6l4.2 10.9' />
4357+
<path d='M9.4 16.4h5.2' />
4358+
<path d='M5.3 16.1H3.2' />
4359+
<path d='M18.7 16.1h2.1' />
4360+
</g>
4361+
<circle cx='2.4' cy='16.1' r='1.2' fill={`url(#${gradientId})`} />
4362+
<circle cx='21.6' cy='16.1' r='1.2' fill={`url(#${gradientId})`} />
4363+
</svg>
4364+
)
4365+
}
4366+
43224367
export const KimiIcon = (props: SVGProps<SVGSVGElement>) => (
43234368
<svg {...props} height='1em' viewBox='0 0 24 24' width='1em' xmlns='http://www.w3.org/2000/svg'>
43244369
<title>Kimi</title>

‎apps/sim/ee/organization-usage/components/usage-consumers.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
FireworksIcon,
1414
GeminiIcon,
1515
GroqIcon,
16+
KieIcon,
1617
KimiIcon,
1718
LitellmIcon,
1819
MetaIcon,
@@ -64,6 +65,7 @@ const PROVIDER_ICONS: Readonly<Record<string, ComponentType<{ className?: string
6465
fireworks: FireworksIcon,
6566
google: GeminiIcon,
6667
groq: GroqIcon,
68+
kie: KieIcon,
6769
kimi: KimiIcon,
6870
litellm: LitellmIcon,
6971
meta: MetaIcon,

‎apps/sim/lib/api-key/byok.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,20 @@ export async function getApiKeyWithBYOK(
316316
throw new Error(`API key is required for Ollama Cloud ${model}`)
317317
}
318318

319+
if (provider === 'kie') {
320+
if (workspaceId) {
321+
const byokResult = await getBYOKKey(workspaceId, 'kie')
322+
if (byokResult) {
323+
logger.info('Using BYOK key for Kie', { model, workspaceId, scope: byokResult.scope })
324+
return byokResult
325+
}
326+
}
327+
if (userProvidedKey) {
328+
return { apiKey: userProvidedKey, isBYOK: false }
329+
}
330+
throw new Error(`API key is required for Kie ${model}`)
331+
}
332+
319333
if (provider === 'bedrock') {
320334
return { apiKey: PROVIDER_PLACEHOLDER_KEY, isBYOK: false }
321335
}

‎apps/sim/lib/api/contracts/byok-keys.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const byokProviderIdSchema = z.enum([
1515
'together',
1616
'baseten',
1717
'ollama-cloud',
18+
'kie',
1819
'falai',
1920
'firecrawl',
2021
'exa',

‎apps/sim/lib/memory/agent-turn-session.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import {
4949
projectResolvedSecretModelJsonStrings,
5050
} from '@/executor/utils/resolved-secret-content-projection'
5151
import type { ResolvedSecretTraceRegistry } from '@/executor/utils/resolved-secret-trace-registry'
52-
import { providerHistoryProtocols } from '@/providers/history-adapters'
52+
import { getProviderHistoryProtocol, isHistoryProviderId } from '@/providers/history-adapters'
5353

5454
const logger = createLogger('AgentMemory')
5555
const MAX_CACHED_AGENT_TURNS = 32
@@ -183,7 +183,7 @@ function validState(value: unknown): value is AgentTurnState {
183183
if (
184184
!isRecordLike(native) ||
185185
typeof native.providerId !== 'string' ||
186-
!Object.hasOwn(providerHistoryProtocols, native.providerId) ||
186+
!isHistoryProviderId(native.providerId) ||
187187
typeof native.model !== 'string' ||
188188
!native.model ||
189189
typeof native.binding !== 'string' ||
@@ -193,8 +193,7 @@ function validState(value: unknown): value is AgentTurnState {
193193
(typeof native.prefixHash !== 'string' || !/^[a-f0-9]{64}$/.test(native.prefixHash)))
194194
)
195195
return false
196-
const protocol =
197-
providerHistoryProtocols[native.providerId as keyof typeof providerHistoryProtocols]
196+
const protocol = getProviderHistoryProtocol(native.providerId, native.model)
198197
if (
199198
native.protocol !== protocol &&
200199
!(native.providerId === 'azure-openai' && native.protocol === 'chat-completions')

‎apps/sim/lib/tokenization/constants.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ export const TOKENIZATION_CONFIG = {
8181
confidence: 'medium',
8282
supportedMethods: ['heuristic', 'fallback'],
8383
},
84+
kie: {
85+
avgCharsPerToken: 4,
86+
confidence: 'medium',
87+
supportedMethods: ['heuristic', 'fallback'],
88+
},
8489
ollama: {
8590
avgCharsPerToken: 4,
8691
confidence: 'low',

0 commit comments

Comments
 (0)