<!--
 ⚠️  AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
 This file is automatically generated by scripts/docs-generator.js
 To make changes, edit the source TypeScript files or update the generator script
-->

[openai](../../) / [Exports](../modules) / IOpenAIProviderOptions

# Interface: IOpenAIProviderOptions

OpenAI provider options

## Hierarchy

- [`IProviderOptions`](IProviderOptions)

  ↳ **`IOpenAIProviderOptions`**

## Table of contents

### Properties

- [apiKey](IOpenAIProviderOptions#apikey)
- [organization](IOpenAIProviderOptions#organization)
- [timeout](IOpenAIProviderOptions#timeout)
- [baseURL](IOpenAIProviderOptions#baseurl)
- [responseFormat](IOpenAIProviderOptions#responseformat)
- [jsonSchema](IOpenAIProviderOptions#jsonschema)
- [client](IOpenAIProviderOptions#client)
- [payloadLogger](IOpenAIProviderOptions#payloadlogger)
- [executor](IOpenAIProviderOptions#executor)
- [logger](IOpenAIProviderOptions#logger)

## Properties

### apiKey

• `Optional` **apiKey**: `string`

OpenAI API key (required when client is not provided)

#### Defined in

[openai/src/types.ts:39](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/types.ts#L39)

---

### organization

• `Optional` **organization**: `string`

OpenAI organization ID (optional)

#### Defined in

[openai/src/types.ts:44](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/types.ts#L44)

---

### timeout

• `Optional` **timeout**: `number`

API request timeout (milliseconds)

#### Defined in

[openai/src/types.ts:49](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/types.ts#L49)

---

### baseURL

• `Optional` **baseURL**: `string`

API base URL (default: 'https://api.openai.com/v1')

#### Defined in

[openai/src/types.ts:54](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/types.ts#L54)

---

### responseFormat

• `Optional` **responseFormat**: `"text"` \| `"json_object"` \| `"json_schema"`

Response format (default: 'text')

- 'text': Plain text response
- 'json_object': JSON object mode (requires system message)
- 'json_schema': Structured Outputs with schema validation

#### Defined in

[openai/src/types.ts:62](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/types.ts#L62)

---

### jsonSchema

• `Optional` **jsonSchema**: `Object`

JSON schema for structured outputs (required when responseFormat is 'json_schema')

#### Type declaration

| Name           | Type                                                                            |
| :------------- | :------------------------------------------------------------------------------ |
| `name`         | `string`                                                                        |
| `description?` | `string`                                                                        |
| `schema?`      | `Record`\<`string`, [`TProviderOptionValue`](../modules#tprovideroptionvalue)\> |
| `strict?`      | `boolean`                                                                       |

#### Defined in

[openai/src/types.ts:67](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/types.ts#L67)

---

### client

• `Optional` **client**: `OpenAI`

OpenAI client instance (optional: will be created from apiKey if not provided)

#### Defined in

[openai/src/types.ts:77](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/types.ts#L77)

---

### payloadLogger

• `Optional` **payloadLogger**: [`IPayloadLogger`](IPayloadLogger)

Payload logger instance for debugging API requests/responses

Use different implementations based on your environment:

- FilePayloadLogger: Node.js file-based logging
- ConsolePayloadLogger: Browser console-based logging
- Custom: Implement IPayloadLogger interface

**`Example`**

```typescript
// Node.js
import { FilePayloadLogger } from '@robota-sdk/agent-provider-openai/loggers/file';
const provider = new OpenAIProvider({
  client: openaiClient,
  payloadLogger: new FilePayloadLogger({ logDir: './logs/openai' }),
});

// Browser
import { ConsolePayloadLogger } from '@robota-sdk/agent-provider-openai/loggers/console';
const provider = new OpenAIProvider({
  client: openaiClient,
  payloadLogger: new ConsolePayloadLogger(),
});
```

#### Defined in

[openai/src/types.ts:104](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/types.ts#L104)

---

### executor

• `Optional` **executor**: `IExecutor`

Optional executor for handling AI requests

When provided, the provider will delegate all chat operations to this executor
instead of making direct API calls. This enables remote execution capabilities.

**`Example`**

```typescript
import { LocalExecutor, RemoteExecutor } from '@robota-sdk/agent-core';

// Local execution (registers this provider)
const localExecutor = new LocalExecutor();
localExecutor.registerProvider('openai', new OpenAIProvider({ apiKey: 'sk-...' }));

// Remote execution
const remoteExecutor = new RemoteExecutor({
  serverUrl: 'https://api.robota.io',
  userApiKey: 'user-token-123',
});

const provider = new OpenAIProvider({
  executor: remoteExecutor, // No direct API key needed
});
```

#### Defined in

[openai/src/types.ts:131](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/types.ts#L131)

---

### logger

• `Optional` **logger**: `AbstractLogger`

Logger instance for internal OpenAI provider logging

**`Default Value`**

```ts
SilentLogger;
```

#### Defined in

[openai/src/types.ts:137](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/types.ts#L137)
