Chat Completion
POST
/chat/completion
Creates a model response for chat conversations. OmniAI translates OpenAI Chat Completion params for all models. Supported models can be found here.
Request
Headers
An API Key is required to access this endpoint.
Name | Value |
---|---|
x-api-key |
|
Body
Name | Type | Description |
---|---|---|
| Message[] | List of messages in the OpenAI style. |
| string | The model to use. |
| number (optional) | The maximum number of tokens to generate before stopping. |
| string[] (optional) | Stop sequence. |
| number (optional) | The randomness of the response from 0 - 2. Higher temperatures generate a more random response. Defaults to |
| number (optional) | An alternative to temperature. Defaults to |
| Tool[] (optional) | A list of tools the model can call. |
| Tool (optional) | Specifies how the model should use the tools. Forces function calls with each provided function. Defaults to |
Message
Name | Type | Description |
---|---|---|
| enum | Supported enums:
|
| string | The contents of the message. |
Tool
Name | Type | Description |
---|---|---|
| string | The type of tool. Only |
| Function object. |
Function
Name | Type | Description |
---|---|---|
| string | A description of what the function does. |
| string | The name of the function to be called. |
| object | The parameters the functions accepts, described as a JSON object. |
Example
Response
The API returns the response in JSON format.
The request will return a 200 with a chat completion object.
Example
Last updated