> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# wrapOpenAI

> TypeScript SDK reference

```ts theme={"system"}
wrapOpenAI<T>(openai: T): T
```

[GitHub source](https://github.com/wandb/weave/blob/7c9efdc9fe05ffcaf2430dd652ef9bc5b3ffdfaa/sdks/node/src/integrations/openai.ts#L760)

OpenAI API をラップして、OpenAI の Call で関数のトレースを有効にします。

## タイプパラメーター

**T** `extends object`

## パラメーター

**openai** `T` *required*

## Returns

`T`

## 例

```ts twoslash theme={"system"}
// @noErrors
const openai = wrapOpenAI(new OpenAI());
const result = await openai.chat.completions.create({
  model: 'gpt-3.5-turbo',
  messages: [{ role: 'user', content: 'Hello, world!' }]
});
```
