Image Generation
Image Analysis
Model Training
Content Moderation
Authentication
Server Status
Text Generation
Finetuned models
POST
/
api
/
ai
/
content
/
v4
/
{modelType}
/
{modelId}
curl --request POST \
--url https://api.worqhat.com/api/ai/content/v4/{modelType}/{modelId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"training_data": "You will be provided with customer service queries. Classify each query into a primary and secondary category. Provide JSON output with keys: `primary` and `secondary`.\n",
"response_type": "json",
"question": "How do I reset my password?",
"conversation_id": "conv_1724236791746",
"preserve_history": false,
"conversation_history": [
{
"user_prompt": "I need help with my bill.",
"model_response": "Sure! Can you clarify what specific issue you'\''re facing?"
}
]
}'
{
"Text Output": {
"value": {
"content": "Hi there! My name is Alex, and I'm happy to help you with anything you need for your tour. What can I do for you today?",
"processingTime": 3105.397454,
"processingId": "8aa97481-20f9-48f4-a12d-d02eb6c1d62a",
"processingCount": 84,
"conversation_id": "conv_1724236791746",
"model": "aicon-v4-alpha-160824"
}
},
"JSON Structured Output": {
"value": {
"content": {
"response": "Hi there! My name is Alex, and I'm delighted to assist you with your travel needs. What can I help you with today?"
},
"processingTime": 2946.176112,
"processingId": "5944ab45-8bd7-4151-853d-da6cf315d617",
"processingCount": 90,
"conversation_id": "conv_1724237541817",
"model": "aicon-v4-alpha-160824"
}
},
"Streaming Data": {
"value": {
"data": [
{
"content": "Hi",
"model": "aicon-v4-alpha-160824",
"timestamp": 1724240278523,
"processing_id": "bc4cc3b9-d000-4866-83ad-ad71abf10c8f",
"conversation_id": "conv_1724240276193"
},
{
"content": " there! My name is Alex, and I'm excited to be your tour",
"model": "aicon-v4-alpha-160824",
"timestamp": 1724240278630,
"processing_id": "bc4cc3b9-d000-4866-83ad-ad71abf10c8f",
"conversation_id": "conv_1724240276193"
},
{
"content": " guide today. What can I help you with? \n",
"model": "aicon-v4-alpha-160824",
"timestamp": 1724240278708,
"processing_id": "bc4cc3b9-d000-4866-83ad-ad71abf10c8f",
"conversation_id": "conv_1724240276193"
},
{
"content": "",
"model": "aicon-v4-alpha-160824",
"timestamp": 1724240278712,
"processing_id": "bc4cc3b9-d000-4866-83ad-ad71abf10c8f",
"conversation_id": "conv_1724240276193"
},
{
"content": "",
"model": "aicon-v4-alpha-160824",
"finishReason": "stop",
"timestamp": 1724240278716,
"processing_id": "bc4cc3b9-d000-4866-83ad-ad71abf10c8f",
"conversation_id": "conv_1724240276193",
"wordCount": 77
}
]
}
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
The type of the base model that you have used to train the data.
Available options:
nano
, large
The unique ID of the custom model that has been created.
Body
Response
200
application/json
Text Generated Successfully
The response is of type object
.
Was this page helpful?
curl --request POST \
--url https://api.worqhat.com/api/ai/content/v4/{modelType}/{modelId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"training_data": "You will be provided with customer service queries. Classify each query into a primary and secondary category. Provide JSON output with keys: `primary` and `secondary`.\n",
"response_type": "json",
"question": "How do I reset my password?",
"conversation_id": "conv_1724236791746",
"preserve_history": false,
"conversation_history": [
{
"user_prompt": "I need help with my bill.",
"model_response": "Sure! Can you clarify what specific issue you'\''re facing?"
}
]
}'
{
"Text Output": {
"value": {
"content": "Hi there! My name is Alex, and I'm happy to help you with anything you need for your tour. What can I do for you today?",
"processingTime": 3105.397454,
"processingId": "8aa97481-20f9-48f4-a12d-d02eb6c1d62a",
"processingCount": 84,
"conversation_id": "conv_1724236791746",
"model": "aicon-v4-alpha-160824"
}
},
"JSON Structured Output": {
"value": {
"content": {
"response": "Hi there! My name is Alex, and I'm delighted to assist you with your travel needs. What can I help you with today?"
},
"processingTime": 2946.176112,
"processingId": "5944ab45-8bd7-4151-853d-da6cf315d617",
"processingCount": 90,
"conversation_id": "conv_1724237541817",
"model": "aicon-v4-alpha-160824"
}
},
"Streaming Data": {
"value": {
"data": [
{
"content": "Hi",
"model": "aicon-v4-alpha-160824",
"timestamp": 1724240278523,
"processing_id": "bc4cc3b9-d000-4866-83ad-ad71abf10c8f",
"conversation_id": "conv_1724240276193"
},
{
"content": " there! My name is Alex, and I'm excited to be your tour",
"model": "aicon-v4-alpha-160824",
"timestamp": 1724240278630,
"processing_id": "bc4cc3b9-d000-4866-83ad-ad71abf10c8f",
"conversation_id": "conv_1724240276193"
},
{
"content": " guide today. What can I help you with? \n",
"model": "aicon-v4-alpha-160824",
"timestamp": 1724240278708,
"processing_id": "bc4cc3b9-d000-4866-83ad-ad71abf10c8f",
"conversation_id": "conv_1724240276193"
},
{
"content": "",
"model": "aicon-v4-alpha-160824",
"timestamp": 1724240278712,
"processing_id": "bc4cc3b9-d000-4866-83ad-ad71abf10c8f",
"conversation_id": "conv_1724240276193"
},
{
"content": "",
"model": "aicon-v4-alpha-160824",
"finishReason": "stop",
"timestamp": 1724240278716,
"processing_id": "bc4cc3b9-d000-4866-83ad-ad71abf10c8f",
"conversation_id": "conv_1724240276193",
"wordCount": 77
}
]
}
}
}