Back to skills
SKILL.md
Orpc Openai Streaming
ASecurityCombine oRPC with the OpenAI Streaming API to build a chatbot.
- 8 stars
- 0 votes
- 0 copies
- 3 views
- Added September 12, 2026
Works with
Security analysis
100/100npx -y skills add ali-master/skills --skill orpc-openai-streaming --agent claude-codeAre you the author of Orpc Openai Streaming?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ali-master-orpc-openai-streaming)---
name: oRPC OpenAI Streaming Example
description: Combine oRPC with the OpenAI Streaming API to build a chatbot.
license: MIT
metadata:
author: Ali Torki
homepage: https://github.com/ali-master
version: "1.0.0"
---
# OpenAI Streaming Example
Integrate oRPC with the OpenAI Streaming API to build a chatbot.
## Basic Example
```ts
import { createORPCClient } from '@orpc/client'
import { RPCLink } from '@orpc/client/fetch'
import { os, RouterClient } from '@orpc/server'
import * as z from 'zod'
import OpenAI from 'openai'
const openai = new OpenAI()
const complete = os
.input(z.object({ content: z.string() }))
.handler(async function* ({ input }) {
const stream = await openai.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: input.content }],
stream: true,
})
yield* stream
})
const router = { complete }
// --------------- CLIENT ---------------
const link = new RPCLink({
url: 'https://example.com/rpc',
})
const client: RouterClient<typeof router> = createORPCClient(link)
const stream = await client.complete({ content: 'Hello, world!' })
for await (const chunk of stream) {
console.log(chunk.choices[0]?.delta?.content || '')
}
```
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.