cloudflare · Cloudflare Workers Docs
Workers Stream OpenAI API Responses
Implements streaming OpenAI API responses within a Cloudflare Workers environment using the OpenAI v4 SDK and Hono framework.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Workers Stream OpenAI API Responses
Implements streaming OpenAI API responses within a Cloudflare Workers environment using the OpenAI v4 SDK and Hono framework.
When To Use
Use when you need to implement real-time text streaming from OpenAI models within a Cloudflare Workers application using TypeScript or JavaScript.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-examples-openai-sdk-streaming-stream-api-responses-workflow-guide.md | A markdown guide demonstrating how to use the OpenAI v4 SDK to stream API responses within a Cloudflare Worker. | Questions about a markdown guide demonstrating how to use the OpenAI v4 SDK to stream API responses within a Cloudflare Worker. |
examples/workers-examples-openai-sdk-streaming-stream-api-responses-cloudflare-wo.text | A JavaScript example demonstrating how to use the OpenAI SDK within a Cloudflare Worker to stream chat completions using TransformStream. | Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to use the OpenAI SDK within a Cloudflare Worker to stream chat completions us... |
examples/workers-examples-openai-sdk-streaming-stream-api-responses-cloudflare-wo-2.text | A Hono-based Cloudflare Worker implementation that uses the OpenAI SDK to stream chat completions to a client. | Exact payloads, commands, or snippets shown in A Hono-based Cloudflare Worker implementation that uses the OpenAI SDK to stream chat completions to a client. |
What This Skill Covers
- Use the OpenAI v4 SDK to stream responses from OpenAI.
- Main sections:
Tags.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.cloudflare.com/workers/examples/openai-sdk-streaming
