# mulesoft OpenAI Connector - Full Documentation --- product: OpenAI Connector version: 0.1 --- # OpenAI Connector 0.1.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for OpenAI (OpenAI Connector) enables Mule applications to access the OpenAI API. > [!NOTE] OpenAI Connector is a beta connector that is subject to the Beta Services Terms at > [Agreements - Salesforce.com](https://www.salesforce.com/company/legal/) or a written Unified > Pilot Agreement if executed by Customer, and the Non-GA Gen AI and Non-GA Credit Consumption terms > in the > [Product Terms Directory](https://ptd.salesforce.com/?_ga=2.247987783.1372150065.1709219475-629000709.1639001992). > Use of this beta connector with external systems or services consumes > [Mule messages](https://docs.mulesoft.com/general/usage-metrics) and is at the Customer’s sole discretion. For information about compatibility and fixed issues, refer to the OpenAI Connector Release Notes. ## Before You Begin To use this connector, you must be familiar with: - The OpenAI Connector’s API - Anypoint Connectors - Mule runtime engine (Mule) - Elements and global elements in a Mule flow - How to create a Mule app using Anypoint Code Builder or Anypoint Studio Before creating an app, you must have: - Credentials to access the OpenAI target resource - Anypoint Platform - The latest versions of Anypoint Code Builder or Anypoint Studio ## Next Step After you complete the prerequisites, you’re ready to create an app and configure the connector using [Anypoint Studio](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) or [Anypoint Code Builder](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange) - [OpenAI Connector Reference](https://docs.mulesoft.com/openai-connector/0.1/openai-connector-reference) - [Salesforce Help](https://help.salesforce.com) --- product: OpenAI Connector version: 0.1 --- # OpenAI Connector 0.1.0 Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## Configurations --- ### Config Default configuration. #### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x

Connection

The connection types to provide to this configuration.

x

Name

String

The identifier of this element used to reference it in other components.

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration. This does not mean that the platform expires the instance at the exact moment that it becomes eligible. Mule purges the instances as appropriate.

#### Connection Types ##### Api Key ###### Parameters
NameTypeDescriptionDefault ValueRequired

baseUri

String

The base URI for the OpenAI API.

x

token

String

The API key token for authentication.

x

TLS Configuration

The TLS configuration for secure connections.

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

## Supported Operations - [Create Assistant](#CreateAssistant) - [Create Chat Completion](#CreateChatCompletion) - [Create Embedding](#CreateEmbedding) - [Create Message](#CreateMessage) - [Create Moderation](#CreateModeration) - [Create Thread](#CreateThread) - [Create Thread And Run](#CreateThreadAndRun) - [Delete Thread](#DeleteThread) - [List Assistants](#ListAssistants) - [List Message](#ListMessage) - [List Models](#ListModels) - [Modify Assistant](#ModifyAssistant) - [Modify Message](#ModifyMessage) - [Modify Thread](#ModifyThread) - [Retrieve Assistants](#RetrieveAssistants) - [Retrieve Message](#RetrieveMessage) - [Retrieve Thread](#RetrieveThread) ## Operations ## Create Assistant `` Creates an assistant. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Chat Completion `` Creates a chat completion. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Embedding `` Creates an embedding. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Message `` Creates a message. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

thread_id

String

The ID of the thread.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Moderation `` Creates a moderation. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Thread `` Creates a thread. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Thread And Run `` Creates a thread and runs it. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Delete Thread `` Deletes a thread. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

thread_id

String

The ID of the thread.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## List Assistants `` Lists assistants. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

limit

Number

The maximum number of results to return.

order

Enumeration, one of:

  • asc

  • desc

The sort order for the results.

after

String

A cursor for pagination to fetch results after this ID.

before

String

A cursor for pagination to fetch results before this ID.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Array of Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## List Message `` Lists messages. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

thread_id

String

The ID of the thread.

x

limit

Number

The maximum number of results to return.

order

Enumeration, one of:

  • asc

  • desc

The sort order for the results.

after

String

A cursor for pagination to fetch results after this ID.

before

String

A cursor for pagination to fetch results before this ID.

run_id

String

The ID of the run.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Array of Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## List Models `` Lists models. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Modify Assistant `` Modifies an assistant. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

assistant_id

String

The ID of the assistant.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Modify Message `` Modifies a message. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

thread_id

String

The ID of the thread.

x

message_id

String

The ID of the message.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Modify Thread `` Modifies a thread. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

thread_id

String

The ID of the thread.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Retrieve Assistants `` Retrieves assistants. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

assistant_id

String

The ID of the assistant.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Retrieve Message `` Retrieves a message. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

thread_id

String

The ID of the thread.

x

message_id

String

The ID of the message.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Retrieve Thread `` Retrieves a thread. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

thread_id

String

The ID of the thread.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Types ### Tls
FieldTypeDescriptionDefault ValueRequired

Enabled Protocols

String

A comma-separated list of protocols enabled for this context.

Enabled Cipher Suites

String

A comma-separated list of cipher suites enabled for this context.

Trust Store

Configures the TLS truststore.

Key Store

Configures the TLS keystore.

Revocation Check

Configures a revocation checking mechanism.

### Trust Store
FieldTypeDescriptionDefault ValueRequired

Path

String

The location (which will be resolved relative to the current classpath and file system, if possible) of the trust store.

Password

String

The password used to protect the trust store.

Type

String

The type of store used.

Algorithm

String

The algorithm used by the trust store.

Insecure

Boolean

If true, no certificate validations will be performed, rendering connections vulnerable to attacks. Use at your own risk.

### Key Store
FieldTypeDescriptionDefault ValueRequired

Path

String

The location (which will be resolved relative to the current classpath and file system, if possible) of the key store.

Type

String

The type of store used.

Alias

String

When the key store contains many private keys, this attribute indicates the alias of the key that should be used. If not defined, the first key in the file will be used by default.

Key Password

String

The password used to protect the private key.

Password

String

The password used to protect the key store.

Algorithm

String

The algorithm used by the key store.

### Standard Revocation Check
FieldTypeDescriptionDefault ValueRequired

Only End Entities

Boolean

Only verify the last element of the certificate chain.

Prefer Crls

Boolean

Try CRL instead of OCSP first.

No Fallback

Boolean

Do not use the secondary checking method (the one not selected before).

Soft Fail

Boolean

Avoid verification failure when the revocation server can not be reached or is busy.

### Custom Ocsp Responder
FieldTypeDescriptionDefault ValueRequired

Url

String

The URL of the OCSP responder.

Cert Alias

String

Alias of the signing certificate for the OCSP response (must be in the trust store), if present.

### Crl File
FieldTypeDescriptionDefault ValueRequired

Path

String

The path to the CRL file.

### Reconnection
FieldTypeDescriptionDefault ValueRequired

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

The reconnection strategy to use.

### Reconnect
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often in milliseconds to reconnect.

Blocking

Boolean

If false, the reconnection strategy will run in a separate, non-blocking thread.

Count

Number

How many reconnection attempts to make.

### Reconnect Forever
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often in milliseconds to reconnect.

Blocking

Boolean

If false, the reconnection strategy will run in a separate, non-blocking thread.

### Expiration Policy
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

A scalar time value for the maximum amount of time a dynamic configuration instance should be allowed to be idle before it’s considered eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

### Error Mapping
FieldTypeDescriptionDefault ValueRequired

Source

Enumeration, one of:

  • ANY

  • REDELIVERY_EXHAUSTED

  • TRANSFORMATION

  • EXPRESSION

  • SECURITY

  • CLIENT_SECURITY

  • SERVER_SECURITY

  • ROUTING

  • CONNECTIVITY

  • RETRY_EXHAUSTED

  • TIMEOUT

Source of the error.

Target

String

Target of the error.

x

### Repeatable In Memory Iterable
FieldTypeDescriptionDefault ValueRequired

Initial Buffer Size

Number

The amount of instances that is initially be allowed to be kept in memory to consume the stream and provide random access to it. If the stream contains more data than can fit into this buffer, then the buffer expands according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize. Default value is 100 instances.

Buffer Size Increment

Number

This is by how much the buffer size expands if it exceeds its initial size. Setting a value of zero or lower means that the buffer should not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised when the buffer gets full. Default value is 100 instances.

Max Buffer Size

Number

The maximum amount of memory to use. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised. A value lower than or equal to zero means no limit.

### Repeatable File Store Iterable
FieldTypeDescriptionDefault ValueRequired

In Memory Objects

Number

The maximum amount of instances to keep in memory. If more than that is required, content on the disk is buffered.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the In Memory Objects field.

--- product: OpenAI Connector version: 1.0 --- # OpenAI Connector 1.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for OpenAI (OpenAI Connector) enables Mule applications to access the OpenAI API. > [!NOTE] OpenAI Connector is a beta connector that is subject to the Beta Services Terms at > [Agreements - Salesforce.com](https://www.salesforce.com/company/legal/) or a written Unified > Pilot Agreement if executed by Customer, and the Non-GA Gen AI and Non-GA Credit Consumption terms > in the > [Product Terms Directory](https://ptd.salesforce.com/?_ga=2.247987783.1372150065.1709219475-629000709.1639001992). > Use of this beta connector with external systems or services consumes > [Mule messages](https://docs.mulesoft.com/general/usage-metrics) and is at the Customer’s sole discretion. For information about compatibility and fixed issues, refer to the OpenAI Connector Release Notes. ## Before You Begin To use this connector, you must be familiar with: - The OpenAI Connector’s API - Anypoint Connectors - Mule runtime engine (Mule) - Elements and global elements in a Mule flow - How to create a Mule app using Anypoint Code Builder or Anypoint Studio Before creating an app, you must have: - Credentials to access the OpenAI target resource - Anypoint Platform - The latest versions of Anypoint Code Builder or Anypoint Studio ## Next Step After you complete the prerequisites, you’re ready to create an app and configure the connector using [Anypoint Studio](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) or [Anypoint Code Builder](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange) - [OpenAI Connector Reference](https://docs.mulesoft.com/openai-connector/1.0/openai-connector-reference) - [Salesforce Help](https://help.salesforce.com) --- product: OpenAI Connector version: 1.0 --- # OpenAI Connector 1.0 Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## Configurations --- ### Config Default configuration. #### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x

Connection

The connection types to provide to this configuration.

x

Name

String

The identifier of this element used to reference it in other components.

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration. This does not mean that the platform expires the instance at the exact moment that it becomes eligible. Mule purges the instances as appropriate.

#### Connection Types ##### Api Key ###### Parameters
NameTypeDescriptionDefault ValueRequired

baseUri

String

The base URI for the OpenAI API.

x

token

String

The API key token for authentication.

x

TLS Configuration

The TLS configuration for secure connections.

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

## Supported Operations - [Create Assistant](#CreateAssistant) - [Create Chat Completion](#CreateChatCompletion) - [Create Embedding](#CreateEmbedding) - [Create Message](#CreateMessage) - [Create Moderation](#CreateModeration) - [Create Thread](#CreateThread) - [Create Thread And Run](#CreateThreadAndRun) - [Delete Thread](#DeleteThread) - [List Assistants](#ListAssistants) - [List Message](#ListMessage) - [List Models](#ListModels) - [Modify Assistant](#ModifyAssistant) - [Modify Message](#ModifyMessage) - [Modify Thread](#ModifyThread) - [Retrieve Assistants](#RetrieveAssistants) - [Retrieve Message](#RetrieveMessage) - [Retrieve Thread](#RetrieveThread) ## Operations ## Create Assistant `` Creates an assistant. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Chat Completion `` Creates a chat completion. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Embedding `` Creates an embedding. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Message `` Creates a message. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

thread_id

String

The ID of the thread.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Moderation `` Creates a moderation. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Thread `` Creates a thread. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Thread And Run `` Creates a thread and runs it. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Delete Thread `` Deletes a thread. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

thread_id

String

The ID of the thread.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## List Assistants `` Lists assistants. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

limit

Number

The maximum number of results to return.

order

Enumeration, one of:

  • asc

  • desc

The sort order for the results.

after

String

A cursor for pagination to fetch results after this ID.

before

String

A cursor for pagination to fetch results before this ID.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Array of Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## List Message `` Lists messages. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

thread_id

String

The ID of the thread.

x

limit

Number

The maximum number of results to return.

order

Enumeration, one of:

  • asc

  • desc

The sort order for the results.

after

String

A cursor for pagination to fetch results after this ID.

before

String

A cursor for pagination to fetch results before this ID.

run_id

String

The ID of the run.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Array of Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## List Models `` Lists models. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Modify Assistant `` Modifies an assistant. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

assistant_id

String

The ID of the assistant.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Modify Message `` Modifies a message. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

thread_id

String

The ID of the thread.

x

message_id

String

The ID of the message.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Modify Thread `` Modifies a thread. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

thread_id

String

The ID of the thread.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Retrieve Assistants `` Retrieves assistants. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

assistant_id

String

The ID of the assistant.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Retrieve Message `` Retrieves a message. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

thread_id

String

The ID of the thread.

x

message_id

String

The ID of the message.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Retrieve Thread `` Retrieves a thread. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

thread_id

String

The ID of the thread.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Types ### Tls
FieldTypeDescriptionDefault ValueRequired

Enabled Protocols

String

A comma-separated list of protocols enabled for this context.

Enabled Cipher Suites

String

A comma-separated list of cipher suites enabled for this context.

Trust Store

Configures the TLS truststore.

Key Store

Configures the TLS keystore.

Revocation Check

Configures a revocation checking mechanism.

### Trust Store
FieldTypeDescriptionDefault ValueRequired

Path

String

The location (which will be resolved relative to the current classpath and file system, if possible) of the trust store.

Password

String

The password used to protect the trust store.

Type

String

The type of store used.

Algorithm

String

The algorithm used by the trust store.

Insecure

Boolean

If true, no certificate validations will be performed, rendering connections vulnerable to attacks. Use at your own risk.

### Key Store
FieldTypeDescriptionDefault ValueRequired

Path

String

The location (which will be resolved relative to the current classpath and file system, if possible) of the key store.

Type

String

The type of store used.

Alias

String

When the key store contains many private keys, this attribute indicates the alias of the key that should be used. If not defined, the first key in the file will be used by default.

Key Password

String

The password used to protect the private key.

Password

String

The password used to protect the key store.

Algorithm

String

The algorithm used by the key store.

### Standard Revocation Check
FieldTypeDescriptionDefault ValueRequired

Only End Entities

Boolean

Only verify the last element of the certificate chain.

Prefer Crls

Boolean

Try CRL instead of OCSP first.

No Fallback

Boolean

Do not use the secondary checking method (the one not selected before).

Soft Fail

Boolean

Avoid verification failure when the revocation server can not be reached or is busy.

### Custom Ocsp Responder
FieldTypeDescriptionDefault ValueRequired

Url

String

The URL of the OCSP responder.

Cert Alias

String

Alias of the signing certificate for the OCSP response (must be in the trust store), if present.

### Crl File
FieldTypeDescriptionDefault ValueRequired

Path

String

The path to the CRL file.

### Reconnection
FieldTypeDescriptionDefault ValueRequired

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

The reconnection strategy to use.

### Reconnect
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often in milliseconds to reconnect.

Blocking

Boolean

If false, the reconnection strategy will run in a separate, non-blocking thread.

Count

Number

How many reconnection attempts to make.

### Reconnect Forever
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often in milliseconds to reconnect.

Blocking

Boolean

If false, the reconnection strategy will run in a separate, non-blocking thread.

### Expiration Policy
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

A scalar time value for the maximum amount of time a dynamic configuration instance should be allowed to be idle before it’s considered eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

### Error Mapping
FieldTypeDescriptionDefault ValueRequired

Source

Enumeration, one of:

  • ANY

  • REDELIVERY_EXHAUSTED

  • TRANSFORMATION

  • EXPRESSION

  • SECURITY

  • CLIENT_SECURITY

  • SERVER_SECURITY

  • ROUTING

  • CONNECTIVITY

  • RETRY_EXHAUSTED

  • TIMEOUT

Source of the error.

Target

String

Target of the error.

x

### Repeatable In Memory Iterable
FieldTypeDescriptionDefault ValueRequired

Initial Buffer Size

Number

The amount of instances that is initially be allowed to be kept in memory to consume the stream and provide random access to it. If the stream contains more data than can fit into this buffer, then the buffer expands according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize. Default value is 100 instances.

Buffer Size Increment

Number

This is by how much the buffer size expands if it exceeds its initial size. Setting a value of zero or lower means that the buffer should not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised when the buffer gets full. Default value is 100 instances.

Max Buffer Size

Number

The maximum amount of memory to use. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised. A value lower than or equal to zero means no limit.

### Repeatable File Store Iterable
FieldTypeDescriptionDefault ValueRequired

In Memory Objects

Number

The maximum amount of instances to keep in memory. If more than that is required, content on the disk is buffered.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the In Memory Objects field.

--- product: OpenAI Connector version: 1.1 is-latest-version: true --- # OpenAI Connector 1.1 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for OpenAI (OpenAI Connector) enables Mule applications to access the OpenAI API. > [!NOTE] OpenAI Connector is a beta connector that is subject to the Beta Services Terms at > [Agreements - Salesforce.com](https://www.salesforce.com/company/legal/) or a written Unified > Pilot Agreement if executed by Customer, and the Non-GA Gen AI and Non-GA Credit Consumption terms > in the > [Product Terms Directory](https://ptd.salesforce.com/?_ga=2.247987783.1372150065.1709219475-629000709.1639001992). > Use of this beta connector with external systems or services consumes > [Mule messages](https://docs.mulesoft.com/general/usage-metrics) and is at the Customer’s sole discretion. For information about compatibility and fixed issues, refer to the OpenAI Connector Release Notes. ## Before You Begin To use this connector, you must be familiar with: - The OpenAI Connector’s API - Anypoint Connectors - Mule runtime engine (Mule) - Elements and global elements in a Mule flow - How to create a Mule app using Anypoint Code Builder or Anypoint Studio Before creating an app, you must have: - Credentials to access the OpenAI target resource - Anypoint Platform - The latest versions of Anypoint Code Builder or Anypoint Studio ## Next Step After you complete the prerequisites, you’re ready to create an app and configure the connector using [Anypoint Studio](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) or [Anypoint Code Builder](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange) - [OpenAI Connector Reference](https://docs.mulesoft.com/openai-connector/latest/openai-connector-reference) - [Salesforce Help](https://help.salesforce.com) --- product: OpenAI Connector version: 1.1 is-latest-version: true --- # OpenAI Connector 1.1 Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## Configurations --- ### Config Default configuration. #### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x

Connection

The connection types to provide to this configuration.

x

Name

String

The identifier of this element used to reference it in other components.

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration. This does not mean that the platform expires the instance at the exact moment that it becomes eligible. Mule purges the instances as appropriate.

#### Connection Types ##### Api Key ###### Parameters
NameTypeDescriptionDefault ValueRequired

baseUri

String

The base URI for the OpenAI API.

x

token

String

The API key token for authentication.

x

TLS Configuration

The TLS configuration for secure connections.

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

## Supported Operations - [Create Chat Completion](#CreateChatCompletion) - [Create Conversation](#CreateConversation) - [Create Conversation Items](#CreateConversationItems) - [Create Embedding](#CreateEmbedding) - [Create Moderation](#CreateModeration) - [Create Response](#CreateResponse) - [Delete Conversation](#DeleteConversation) - [Delete Conversation Item](#DeleteConversationItem) - [Delete Response](#DeleteResponse) - [List Conversation Items](#ListConversationItems) - [List Models](#ListModels) - [List Response Input Items](#ListResponseInputItems) - [Retrieve Conversation](#RetrieveConversation) - [Retrieve Conversation Item](#RetrieveConversationItem) - [Retrieve Response](#RetrieveResponse) - [Update Conversation](#UpdateConversation) ## Operations ## Create Chat Completion `` Creates a chat completion. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Conversation `` Creates a conversation. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Conversation Items `` Creates items in a conversation. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

conversation_id

String

The ID of the conversation.

x

includes

Array of String

Additional fields to include in the response.

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Embedding `` Creates an embedding. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Moderation `` Creates a moderation. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Create Response `` Creates a response. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Delete Conversation `` Deletes a conversation. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

conversation_id

String

The ID of the conversation.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Delete Conversation Item `` Deletes an item from a conversation. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

conversation_id

String

The ID of the conversation.

x

item_id

String

The ID of the item.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Delete Response `` Deletes a response. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

response_id

String

The ID of the response.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## List Conversation Items `` Lists items in a conversation. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

conversation_id

String

The ID of the conversation.

x

limit

Number

The maximum number of results to return.

order

Enumeration, one of:

  • asc

  • desc

The sort order for the results.

after

String

A cursor for pagination to fetch results after this ID.

includes

Array of String

Additional fields to include in the response.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## List Models `` Lists models. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## List Response Input Items `` Lists input items for a response. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

response_id

String

The ID of the response.

x

limit

Number

The maximum number of results to return.

order

Enumeration, one of:

  • asc

  • desc

The sort order for the results.

after

String

A cursor for pagination to fetch results after this ID.

includes

Array of String

Additional fields to include in the response.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Retrieve Conversation `` Retrieves a conversation. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

conversation_id

String

The ID of the conversation.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Retrieve Conversation Item `` Retrieves an item from a conversation. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

conversation_id

String

The ID of the conversation.

x

item_id

String

The ID of the item.

x

includes

Array of String

Additional fields to include in the response.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Retrieve Response `` Retrieves a response. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

response_id

String

The ID of the response.

x

includes

Array of String

Additional fields to include in the response.

stream

Boolean

Whether to stream the response.

false

starting_after

Number

The sequence number after which to start streaming.

include_obfuscation

Boolean

Whether to include obfuscation in streamed events.

false

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Update Conversation `` Updates a conversation. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

conversation_id

String

The ID of the conversation.

x

body

Any

The request body content.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

### Output

Type

Any

Attributes Type

Any

### For Configurations - [Config](#Config) ### Throws - OPENAI:CLIENT\_ERROR - OPENAI:CONNECTIVITY - OPENAI:FORBIDDEN - OPENAI:SECURITY - OPENAI:SERVER\_ERROR - OPENAI:TIMEOUT - OPENAI:UNAUTHORIZED ## Types ### Tls
FieldTypeDescriptionDefault ValueRequired

Enabled Protocols

String

A comma-separated list of protocols enabled for this context.

Enabled Cipher Suites

String

A comma-separated list of cipher suites enabled for this context.

Trust Store

Configures the TLS truststore.

Key Store

Configures the TLS keystore.

Revocation Check

Configures a revocation checking mechanism.

### Trust Store
FieldTypeDescriptionDefault ValueRequired

Path

String

The location (which will be resolved relative to the current classpath and file system, if possible) of the trust store.

Password

String

The password used to protect the trust store.

Type

String

The type of store used.

Algorithm

String

The algorithm used by the trust store.

Insecure

Boolean

If true, no certificate validations will be performed, rendering connections vulnerable to attacks. Use at your own risk.

### Key Store
FieldTypeDescriptionDefault ValueRequired

Path

String

The location (which will be resolved relative to the current classpath and file system, if possible) of the key store.

Type

String

The type of store used.

Alias

String

When the key store contains many private keys, this attribute indicates the alias of the key that should be used. If not defined, the first key in the file will be used by default.

Key Password

String

The password used to protect the private key.

Password

String

The password used to protect the key store.

Algorithm

String

The algorithm used by the key store.

### Standard Revocation Check
FieldTypeDescriptionDefault ValueRequired

Only End Entities

Boolean

Only verify the last element of the certificate chain.

Prefer Crls

Boolean

Try CRL instead of OCSP first.

No Fallback

Boolean

Do not use the secondary checking method (the one not selected before).

Soft Fail

Boolean

Avoid verification failure when the revocation server can not be reached or is busy.

### Custom Ocsp Responder
FieldTypeDescriptionDefault ValueRequired

Url

String

The URL of the OCSP responder.

Cert Alias

String

Alias of the signing certificate for the OCSP response (must be in the trust store), if present.

### Crl File
FieldTypeDescriptionDefault ValueRequired

Path

String

The path to the CRL file.

### Reconnection
FieldTypeDescriptionDefault ValueRequired

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

The reconnection strategy to use.

### Reconnect
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often in milliseconds to reconnect.

Blocking

Boolean

If false, the reconnection strategy will run in a separate, non-blocking thread.

Count

Number

How many reconnection attempts to make.

### Reconnect Forever
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often in milliseconds to reconnect.

Blocking

Boolean

If false, the reconnection strategy will run in a separate, non-blocking thread.

### Expiration Policy
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

A scalar time value for the maximum amount of time a dynamic configuration instance should be allowed to be idle before it’s considered eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

### Error Mapping
FieldTypeDescriptionDefault ValueRequired

Source

Enumeration, one of:

  • ANY

  • REDELIVERY_EXHAUSTED

  • TRANSFORMATION

  • EXPRESSION

  • SECURITY

  • CLIENT_SECURITY

  • SERVER_SECURITY

  • ROUTING

  • CONNECTIVITY

  • RETRY_EXHAUSTED

  • TIMEOUT

Source of the error.

Target

String

Target of the error.

x