---
title: "Create OpenAI"
method: POST
path: "/openai/create/{instance}"
tags: ["OpenIA Controller"]
---

# Create OpenAI

`POST /openai/create/{instance}`

## Request

- Base URL: `https://evolution-example`
- URL: `https://evolution-example/openai/create/{instance}`
- Auth: API key in header `apikey`

Create an OpenAI bot with detailed configuration

## Path parameters

- `instance` string, required

## Request body

- object
  - `enabled` boolean, required: Indicates whether the bot is enabled
  - `openaiCredsId` string, required: ID of the OpenAI credentials
  - `botType` string, required: Type of the bot (e.g., 'assistant')
  - `assistantId` string, required: Unique identifier for the assistant
  - `functionUrl` string, required: URL for additional bot functionality
  - `model` string, required: Model to be used (e.g., 'gpt-4o')
  - `systemMessages` string[], required: Messages to define system behavior
  - `assistantMessages` string[], required: Predefined assistant messages
  - `userMessages` string[], required: Predefined user messages
  - `maxTokens` integer, required: Maximum number of tokens per interaction
  - `triggerType` string, required: Type of trigger for the bot
  - `triggerOperator` string, required: Operator for trigger evaluation
  - `triggerValue` string, required: Value to trigger the bot
  - `expire` integer, required: Expiration time in seconds
  - `keywordFinish` string, required: Keyword to terminate the bot interaction
  - `delayMessage` integer, required: Delay before the bot responds, in milliseconds
  - `unknownMessage` string, required: Message to display for unrecognized input
  - `listeningFromMe` boolean, required: Indicates if the bot listens to messages from the user
  - `stopBotFromMe` boolean, required: Indicates if the bot can be stopped by the user
  - `keepOpen` boolean, required: Indicates if the bot session remains open
  - `debounceTime` integer, required: Debounce time for message processing
  - `ignoreJids` string[], required: List of JIDs to ignore

## Response `200`

Ok

## Changes

- **2024-11-25** (v2) `ad43c2b657d9`: 1 info
  - endpoint added
- **2024-11-25** (v2) `c153448703e5`: 1 breaking
  - api path removed without deprecation
- **2024-09-09** (v2) `0c4620ca5ed5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/evolution-foundation/apis/evolution-api-3/changes/openai/create/:instance/post.md)

---

[API](https://skmtc.dev/evolution-foundation/apis/evolution-api-3.md) - [All operations](https://skmtc.dev/evolution-foundation/apis/evolution-api-3/llms.txt) - [OpenAPI document](https://skmtc.dev/evolution-foundation/apis/evolution-api-3/revisions/153363ee7f38?raw)
