Conversation API
Create conversation sessions for chat features, including AI chat, image analysis, and document chat.
Overview
The Conversation API allows you to create conversation sessions that serve as containers for chat interactions. These conversations can be used with different AI models and support various chat types including standard AI chat, image analysis, and document-based conversations.
Endpoint
Authentication
All requests require authentication using an API key in the request header.
| Field | Value |
|---|---|
| API-KEY | <api-key> |
| Content-Type | application/json |
Request Parameters
Required Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | ✔️ | Conversation type (see supported types below) |
title | string | ✔️ | Conversation title (maximum 91 characters) |
model | string | ✔️ | AI model to use for the conversation |
Optional Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fileList | array | - | File ID list from Asset API (required for CHAT_WITH_PDF) |
youtubeUrl | string | - | YouTube video URL (required for CHAT_WITH_YOUTUBE_VIDEO) |
Supported Conversation Types
| Type | Description | fileList Required | youtubeUrl Required | Notes |
|---|---|---|---|---|
CHAT_WITH_AI | Standard AI chat conversation | No | No | Optional - can use feature type as conversationId for single messages without conversation history |
CHAT_WITH_IMAGE | Chat with image analysis | No | No | Optional - can use feature type as conversationId for single messages without conversation history |
CHAT_WITH_PDF | Multi-document chat with PDFs | Yes | No | Required - must create conversation first before using with feature API |
CHAT_WITH_YOUTUBE_VIDEO | Chat with YouTube videos | No | Yes | Required - must create conversation first before using with feature API |
Example Request
Basic Conversation (CHAT_WITH_AI or CHAT_WITH_IMAGE)
API Playground
https://api.1min.ai/api/conversationsGenerated cURL Command:
curl -X POST "https://api.1min.ai/api/conversations" \
-H "API-KEY: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"type": "CHAT_WITH_AI",
"title": "My AI Conversation",
"model": "gpt-4o-mini"
}'
Conversation with PDF Files
API Playground
https://api.1min.ai/api/conversationsGenerated cURL Command:
curl -X POST "https://api.1min.ai/api/conversations" \
-H "API-KEY: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"type": "CHAT_WITH_PDF",
"title": "Document Analysis Chat",
"model": "gpt-4o-mini",
"fileList": [
"20ad0277-74df-4629-8c50-56a2549acbd7",
"73560309-5804-4092-99d7-0a262fba92f5"
]
}'
Conversation with YouTube Video
API Playground
https://api.1min.ai/api/conversationsGenerated cURL Command:
curl -X POST "https://api.1min.ai/api/conversations" \
-H "API-KEY: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"type": "CHAT_WITH_YOUTUBE_VIDEO",
"title": "YouTube Video Chat",
"model": "gpt-4o-mini",
"youtubeUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}'
Response
Success Response (200)
{
"conversation": {
"uuid": "20ad0277-74df-4629-8c50-56a2549acbd7",
"title": "My AI Conversation",
"status": "ACTIVE",
"createdAt": "2024-09-30T06:35:42.236Z",
"metadata": {
"fileToken": 5006,
"fileCharacter": 17197
},
"conversationFile": [
{
"conversationId": "20ad0277-74df-4629-8c50-56a2549acbd7",
"fileId": "66effbd5-dcbf-47f7-9f0c-7a2a02bd5b11",
"createdAt": "2024-09-30T06:35:42.236Z",
"createdBy": "SYSTEM",
"updatedAt": "2024-09-30T06:35:42.236Z",
"updatedBy": "SYSTEM"
},
{
"conversationId": "20ad0277-74df-4629-8c50-56a2549acbd7",
"fileId": "73560309-5804-4092-99d7-0a262fba92f5",
"createdAt": "2024-09-30T06:35:42.236Z",
"createdBy": "SYSTEM",
"updatedAt": "2024-09-30T06:35:42.236Z",
"updatedBy": "SYSTEM"
}
]
}
}
Response Fields
conversation Object
| Field | Type | Description |
|---|---|---|
uuid | string | Unique identifier for the conversation |
title | string | Conversation title |
status | string | Conversation status (ACTIVE, INACTIVE, etc.) |
createdAt | string | Creation timestamp (ISO 8601) |
metadata | object | Conversation metadata (file stats, etc.) |
conversationFile | array | List of files associated with the conversation |
metadata Object
| Field | Type | Description |
|---|---|---|
fileToken | number | Total token count from files |
fileCharacter | number | Total character count from files |
conversationFile Object
| Field | Type | Description |
|---|---|---|
conversationId | string | Associated conversation ID |
fileId | string | File identifier from Asset API |
createdAt | string | File association creation timestamp |
createdBy | string | Who created the file association |
updatedAt | string | Last update timestamp |
updatedBy | string | Who last updated the file association |
Usage with AI Feature API
Once you have created a conversation using this API, you can use the conversation ID with the AI Feature API to send chat messages within the conversation context.
Example Chat with Context
{
"type": "CHAT_WITH_AI",
"conversationId": "20ad0277-74df-4629-8c50-56a2549acbd7",
"model": "gpt-4o-mini",
"promptObject": {
"prompt": "Hello, how can you help me?",
"isMixed": false,
"webSearch": false
}
}
Error Responses
Bad Request (400)
{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Missing required parameters or invalid format"
}
}
Unauthorized (401)
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}
Forbidden (403)
{
"success": false,
"error": {
"code": "FORBIDDEN",
"message": "Insufficient permissions or quota exceeded"
}
}
Unprocessable Entity (422)
{
"success": false,
"error": {
"code": "UNPROCESSABLE_ENTITY",
"message": "Invalid file IDs or unsupported model"
}
}