Deno Runtime
Serverless edge functions powered by Deno. Execute sandboxed JavaScript and TypeScript at the edge with zero cold starts. The runtime exposes a secure subset of Deno APIs alongside OpenAI integration via the npm:openai module.
Edge-native
Runs on Deno Deploy globally. No containers, no cold starts.
Sandboxed
No filesystem, no network except allow-listed domains.
TypeScript first
Native TS support. No transpilation step required.
OpenAI SDK
Import OpenAI from npm:openai. Full chat completions API.
Try it
deno-runtime/route.ts
import OpenAI from "npm:openai";
const openai = new OpenAI({
apiKey: Deno.env.get("OPENAI_API_KEY"),
});
export async function handler(req: Request) {
const { prompt } = await req.json();
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: prompt }],
});
return Response.json({
result: completion.choices[0].message.content,
});
}