Getting Started with Nara API
Welcome to the Nara API! This guide will walk you through the process of sending a chat message and retrieving chat messages.
Authentication
To use our API, you'll need an API key for authentication. This can be obtained by contacting us at [email protected]
. Please send a request and we will get back to you as soon as possible.
The API key should be included in the header of each API request, in the Authorization
field. The format is 'Bearer YOUR_API_KEY'.
Endpoints
Our API currently supports two main endpoints:
/api/v1.0/chat
/api/v1.0/chat/messages
Sending a Chat Message (/api/v1.0/chat
)
/api/v1.0/chat
)This endpoint allows you to send a chat message. Here is an example of a curl request:
curl --location 'https://nara-backend-50wz.zeet-nara.zeet.app/api/v1.0/chat' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"message": "Hello!",
"conversation_id": "conv_123",
"stream": false,
"temperature": 0.1
}'
message
(string): The chat message you want to send.conversation_id
(string): The identifier of the conversation you are participating in.stream
(boolean): Set this totrue
if you want the conversation to be streamed. Default isfalse
.temperature
(float): This parameter can be used to adjust the randomness of the model's responses. Higher values (closer to 1) make the responses more random, while lower values (closer to 0) make them more deterministic.
Retrieving Chat Messages (/api/v1.0/chat/messages
)
/api/v1.0/chat/messages
)This endpoint allows you to retrieve chat messages. Here is an example of a curl request:
curl --location 'https://nara-backend-50wz.zeet-nara.zeet.app/api/v1.0/chat/messages?user_id=1254321&rows_per_page=20¤t_page=1&sort_by=created_at%3Adesc' \
--header 'Authorization: Bearer YOUR_API_KEY'
user_id
(int): The ID of the user whose messages you want to retrieve.rows_per_page
(int): The number of rows you want to fetch per page.current_page
(int): The page number you want to fetch.sort_by
(string): The field by which to sort the results. It should be in the formatfield:direction
(e.g.,created_at:desc
to sort by the creation time in descending order).
Support
If you have any issues or queries regarding the use of our API, please do not hesitate to contact us at [email protected]
. Our team is always ready to assist you!
Updated about 1 year ago