MCPcopy Index your code
hub / github.com/simstudioai/sim / getFalAIFallbackProviderCostDollars

Function getFalAIFallbackProviderCostDollars

apps/sim/lib/tools/falai-pricing.ts:39–62  ·  view source on GitHub ↗
(endpointId: string)

Source from the content-addressed store, hash-verified

37}
38
39function getFalAIFallbackProviderCostDollars(endpointId: string): number {
40 const normalizedEndpointId = endpointId.toLowerCase()
41
42 const isImageEndpoint =
43 normalizedEndpointId.includes('image') ||
44 normalizedEndpointId.includes('nano-banana') ||
45 normalizedEndpointId.includes('seedream') ||
46 normalizedEndpointId.includes('flux') ||
47 normalizedEndpointId.includes('grok-imagine')
48 if (isImageEndpoint) return FALAI_IMAGE_FALLBACK_PROVIDER_COST_DOLLARS
49
50 // Audio (TTS/voice clone, music, sound effects) is far cheaper than video, so it
51 // must not fall through to the video floor — that would over-bill a short clip.
52 const isAudioEndpoint =
53 normalizedEndpointId.includes('tts') ||
54 normalizedEndpointId.includes('speech') ||
55 normalizedEndpointId.includes('music') ||
56 normalizedEndpointId.includes('sound-effect') ||
57 normalizedEndpointId.includes('audio') ||
58 normalizedEndpointId.includes('elevenlabs')
59 if (isAudioEndpoint) return FALAI_AUDIO_FALLBACK_PROVIDER_COST_DOLLARS
60
61 return FALAI_VIDEO_FALLBACK_PROVIDER_COST_DOLLARS
62}
63
64function parseBillingEvent(value: unknown): FalAIBillingEvent | undefined {
65 if (!isRecordLike(value)) return undefined

Callers 1

getFalAICostMetadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected