Chat

Chat

POST

Request

This endpoint expects an object.
messages
list of objectsRequired
List of messages specifying the conversation so far.
model
stringRequired
frequency_penalty
doubleOptional
Parameter which penalises tokens based on their frequency in the model's output so far. The larger the value, the higher the penalisation. 0.0 means no frequency penalty. Defaults to 0.0.
max_tokens
integerOptional
The maximum number of new tokens to be generated by the model. Note that this is limited by the model's context length. Defaults to 1024.
presence_penalty
doubleOptional
Parameter which penalises tokens based on whether they have appeared in the model's output so far. The larger the value, the higher the penalisation. 0.0 means no presence penalty. Defaults to 0.0.
seed
integerOptional
Random seed used for generations. The same value forces the model to sample the same output.
stop
list of stringsOptional
A list of stop strings used to control generation. If the model generates one of these, it will stop.
stream
booleanOptional
temperature
doubleOptional

Positive number representing the temperature to use for generation. Higher values will make the output more unformly random or creative. 0.0 means greedy decoding. Defaults to 0.4.

top_k
integerOptional

Parameter which forces the model to only consider the tokens with the top_k highest probabilities at the next step. Defaults to 1024.

top_p
doubleOptional

Parameter used to do nucleus sampling, i.e. only consider tokens comprising the top_p probability of the next token’s distribution. Defaults to 0.95.

use_search_engine
booleanOptional

Whether to consider using search engine to complete the request. Note that even if this is set to True, the model might decide to not use search.

Response

This endpoint returns a union
Chat Responseobject
OR
Chunk Chat Responseobject
POST
1curl -X POST https://api.reka.ai/v1/chat \
2 -H "X-Api-Key: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "messages": [
6 {
7 "content": "What is the fifth prime number?",
8 "role": "user"
9 }
10 ],
11 "model": "reka-core",
12 "stream": false
13}'
200Successful
1{
2 "id": "a22157d5-6712-4f0d-b6d1-0143e0511986",
3 "model": "reka-core",
4 "responses": [
5 {
6 "finish_reason": "stop",
7 "message": {
8 "content": " The fifth prime number is 11. Here's a quick breakdown of the first five prime numbers in order: 2, 3, 5, 7, 11.\n\n",
9 "role": "assistant"
10 }
11 }
12 ],
13 "usage": {
14 "input_tokens": 14,
15 "output_tokens": 40
16 }
17}