Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/openai/core.ts>APIPromise#withResponse

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
method APIPromise.prototype.withResponse
import { APIPromise } from "https://deno.land/x/openai@v4.52.0/core.ts";

Gets the parsed response data and the raw Response instance.

If you just want to get the raw Response instance without parsing it, you can use asResponse().

👋 Getting the wrong TypeScript type for Response? Try setting "moduleResolution": "NodeNext" if you can, or add one of these imports before your first import … from 'openai':

  • import 'openai/shims/node' (if you're running on Node)
  • import 'openai/shims/web' (otherwise)

Returns

Promise<{ data: T; response: Response; }>