Skip to main content

Chat Completion

Chat Completion is for generating predicted completions.

Path Parameters
chat_completion_api_id integer REQUIRED

The API ID.

Header Parameters
Authorization string REQUIRED

Bearer Auth

Example: Bearer #your_token
Request Body
params object

The passed-in fields will partially override the API config.

model string

Possible values: [gpt-3.5-turbo, vicuna-7B]

Name of the model to use.

system_prompt string

The system prompt.

max_tokens integer

Possible values: 1 ≤ value

The maximum number of tokens to generate in the chat completion.The total length of input tokens and generated tokens is limited by the model's context length.

temperature number

Possible values: value ≤ 2

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both.

top_p number

Possible values: value ≤ 1

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or but not both.

inputs object REQUIRED

Parameters for invoking the API.

session_id string

Possible values: length ≤ 32

Unique identifier used to maintain user session state. If not provided, a new session_id will be generated and returned in the response.

prompt string REQUIRED

The latest user prompt.

variables object

Format the system prompt with these variables.

var1_name string
var2_name string
... string
Responses
200

OK

Schema OPTIONAL
code integer

Error code. 0 when success.

msg string

Error message. Please use "code" instead of "msg" to determine errors.

data object OPTIONAL

Business data.

session_id string

Unique identifier used to maintain user session state.

text string

AI generated content.

400

Invalid input

401

Unauthorized

404

Record not found