Skip to main content

Setup

Create a new Cloudflare Worker project:

Worker Code

Add Your API Key

Deploy

Your AI API is now live at https://kyma-worker.<your-subdomain>.workers.dev.

Test It

Streaming

The SDK’s toReadableStream() emits newline-delimited JSON, one chunk object per line — not SSE. Label it as such:
To forward Kyma’s SSE stream untouched — data: lines your browser client can read with EventSource — skip the SDK and return the upstream body:
Cloudflare Workers have a 30-second CPU time limit. For long responses, use streaming to avoid timeouts.