Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-examples-openai-sdk-streaming-stream-api-responses-workflow-guide.mdA 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.textA 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.textA 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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