> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-serverless-sft-revamp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# wrapOpenAI

> TypeScript SDK 레퍼런스

# wrapOpenAI

▸ **wrapOpenAI**\<`T`>(`openai`): `T`

OpenAI 호출에 대한 함수 트레이싱(tracing)을 활성화하기 위해 OpenAI API를 래핑합니다.

#### Type parameters

| Name | Type                |
| :--- | :------------------ |
| `T`  | extends `OpenAIAPI` |

#### Parameters

| Name     | Type |
| :------- | :--- |
| `openai` | `T`  |

#### Returns

`T`

`Example`

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

#### Defined in

[integrations/openai.ts:469](https://github.com/wandb/weave/blob/1aee4006a95d913addb45881dfc950de7ce7b0bd/sdks/node/src/integrations/openai.ts#L469)
