AI Feature API
A unified API endpoint for all AI services.
Overview
The AI Feature API provides a single endpoint to access all AI features, including both streaming and non-streaming capabilities. This unified approach simplifies integration and provides consistent access to chat, image generation, and other AI services.
Endpoints
Streaming Features (Chat)
Non-Streaming Features
Authentication
All requests require authentication using an API key in the request header.
| Field | Value |
|---|---|
| API-KEY | <api-key> |
| Content-Type | application/json |
Request Payload
Required Parameters
| Parameter | Type | Description |
|---|---|---|
type | string | Feature name (e.g., CHAT_WITH_AI, IMAGE_GENERATOR) |
model | string | Model name to use |
promptObject | object | Feature-specific parameters |
Note: Please check for all parameters of
promptObjectas they vary by feature type.
Streaming Features Examples
Chat Without Context
- JavaScript
- cURL
- Python
fetch('https://api.1min.ai/api/features?isStreaming=true', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'API-KEY': 'YOUR_API_KEY'
},
body: JSON.stringify({
type: 'CHAT_WITH_AI',
model: 'gpt-4o-mini',
promptObject: {
prompt: 'Tell me about artificial intelligence',
isMixed: false,
webSearch: true,
numOfSite: 1,
maxWord: 500
}
})
})
curl --location 'https://api.1min.ai/api/features?isStreaming=true' \
--header 'API-KEY: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"type": "CHAT_WITH_AI",
"model": "gpt-4o-mini",
"promptObject": {
"prompt": "Tell me about artificial intelligence",
"isMixed": false,
"webSearch": true,
"numOfSite": 1,
"maxWord": 500
}
}'
import requests
url = "https://api.1min.ai/api/features?isStreaming=true"
headers = {
"Content-Type": "application/json",
"API-KEY": "YOUR_API_KEY"
}
data = {
"type": "CHAT_WITH_AI",
"model": "gpt-4o-mini",
"promptObject": {
"prompt": "Tell me about artificial intelligence",
"isMixed": False,
"webSearch": True,
"numOfSite": 1,
"maxWord": 500
}
}
response = requests.post(url, headers=headers, json=data)
Chat With Context (Multi-AI Chat)
- JavaScript
- cURL
- Python
fetch('https://api.1min.ai/api/features?isStreaming=true', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'API-KEY': 'YOUR_API_KEY'
},
body: JSON.stringify({
type: 'CHAT_WITH_AI',
conversationId: 'c5c5e1d4-76a9-46a6-bf6b-1ba843b838db',
model: 'gpt-4o-mini',
promptObject: {
prompt: 'Can you elaborate on that?',
isMixed: false,
webSearch: false
},
metadata: {
messageGroup: '1727596968593_71'
}
})
})
curl --location 'https://api.1min.ai/api/features?isStreaming=true' \
--header 'API-KEY: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"type": "CHAT_WITH_AI",
"conversationId": "c5c5e1d4-76a9-46a6-bf6b-1ba843b838db",
"model": "gpt-4o-mini",
"promptObject": {
"prompt": "Can you elaborate on that?",
"isMixed": false,
"webSearch": false
},
"metadata": {
"messageGroup": "1727596968593_71"
}
}'
import requests
url = "https://api.1min.ai/api/features?isStreaming=true"
headers = {
"Content-Type": "application/json",
"API-KEY": "YOUR_API_KEY"
}
data = {
"type": "CHAT_WITH_AI",
"conversationId": "c5c5e1d4-76a9-46a6-bf6b-1ba843b838db",
"model": "gpt-4o-mini",
"promptObject": {
"prompt": "Can you elaborate on that?",
"isMixed": False,
"webSearch": False
},
"metadata": {
"messageGroup": "1727596968593_71"
}
}
response = requests.post(url, headers=headers, json=data)
Chat Feature Types
CHAT_WITH_AI- Standard AI chat (conversationId optional for single messages)CHAT_WITH_IMAGE- Chat with image analysis (conversationId optional for single messages)CHAT_WITH_PDF- Multi-document chat with PDFs (requires conversation creation first)CHAT_WITH_YOUTUBE_VIDEO- Chat with YouTube videos (requires conversation creation first)
Note on conversationId:
- For
CHAT_WITH_AIandCHAT_WITH_IMAGE: conversationId is optional. You can omit it for single messages or use the feature type name (e.g., "CHAT_WITH_AI") without maintaining conversation history. - For
CHAT_WITH_PDFandCHAT_WITH_YOUTUBE_VIDEO: You must first create a conversation using the Conversation API and use the returneduuidas conversationId.
Non-Streaming Features Example
Image Variation
- JavaScript
- cURL
- Python
fetch('https://api.1min.ai/api/features', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'API-KEY': 'YOUR_API_KEY'
},
body: JSON.stringify({
type: 'IMAGE_VARIATOR',
model: 'midjourney',
promptObject: {
imageUrl: 'development/images/2024_09_30_13_41_50_758_2023_11_10_16_27_12_416_208054.png',
mode: 'fast',
n: 4,
isNiji6: false,
aspect_width: 1,
aspect_height: 1,
maintainModeration: true
}
})
})
curl --location 'https://api.1min.ai/api/features' \
--header 'API-KEY: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"type": "IMAGE_VARIATOR",
"model": "midjourney",
"promptObject": {
"imageUrl": "development/images/2024_09_30_13_41_50_758_2023_11_10_16_27_12_416_208054.png",
"mode": "fast",
"n": 4,
"isNiji6": false,
"aspect_width": 1,
"aspect_height": 1,
"maintainModeration": true
}
}'
import requests
url = "https://api.1min.ai/api/features"
headers = {
"Content-Type": "application/json",
"API-KEY": "YOUR_API_KEY"
}
data = {
"type": "IMAGE_VARIATOR",
"model": "midjourney",
"promptObject": {
"imageUrl": "development/images/2024_09_30_13_41_50_758_2023_11_10_16_27_12_416_208054.png",
"mode": "fast",
"n": 4,
"isNiji6": False,
"aspect_width": 1,
"aspect_height": 1,
"maintainModeration": True
}
}
response = requests.post(url, headers=headers, json=data)
PromptObject Parameters
The promptObject contains feature-specific parameters:
For Chat Features
| Parameter | Type | Description |
|---|---|---|
prompt | string | The user's message |
isMixed | boolean | Mix models context |
imageList | array | Image identifiers (for CHAT_WITH_IMAGE) |
webSearch | boolean | Enable web search |
numOfSite | number | Number of sites to search (when webSearch is true) |
maxWord | number | Maximum words from web search (when webSearch is true) |
For Image Features
| Parameter | Type | Description |
|---|---|---|
imageUrl | string | Absolute URL or asset key from Asset API |
mode | string | Processing mode (e.g., "fast") |
n | number | Number of variations |
aspect_width | number | Aspect ratio width |
aspect_height | number | Aspect ratio height |
maintainModeration | boolean | Apply content moderation |
Response Payload
Streaming Features Response
For streaming features like chat, responses are streamed in real-time:
This is an example streaming chat response that arrives in real-time chunks...
Non-Streaming Features Response (200)
For non-streaming features, a complete JSON response is returned:
{
"aiRecord": {
"uuid": "120qae97-d77d-468d-9d78-2e7c0b2bbb98",
"userId": "75cz1a57-c969-47ac-9dc5-82941cdcfe57",
"teamId": "595w4b41-dcc7-466f-8697-d4a919810b11",
"teamUser": {
"teamId": "595w4b41-dcc7-466f-8697-d4a919810b11",
"userId": "75cz1a57-c969-47ac-9dc5-82941cdcfe57",
"userName": "1minAI",
"userAvatar": "https://lh3.googleusercontent.com/a/ACg8ocJxHeiuADdtp",
"status": "ACTIVE",
"role": "ADMIN",
"creditLimit": 214748364,
"usedCredit": 3086973,
"createdAt": "2023-11-24T06:31:06.467Z",
"createdBy": "SYSTEM",
"updatedAt": "2024-09-29T09:17:08.210Z",
"updatedBy": "SYSTEM"
},
"model": "black-forest-labs/flux-schnell",
"type": "IMAGE_GENERATOR",
"metadata": null,
"rating": null,
"feedback": null,
"conversationId": null,
"status": "SUCCESS",
"createdAt": "2024-09-30T03:47:29.738Z",
"aiRecordDetail": {
"promptObject": {
"prompt": "a cat",
"num_outputs": 1,
"aspect_ratio": "1:1",
"output_format": "webp"
},
"resultObject": ["images/2024_09_30_03_47_31_072_210865.webp"]
},
"additionalData": null
}
}
Response Fields
aiRecord Object
| Field | Type | Description |
|---|---|---|
uuid | string | Unique identifier for the AI record |
userId | string | User identifier |
teamId | string | Team identifier |
teamUser | object | Team user details and permissions |
model | string | Model used for processing |
type | string | Feature type (e.g., IMAGE_GENERATOR) |
metadata | object | Additional metadata (nullable) |
rating | number | User rating for the result (nullable) |
feedback | string | User feedback text (nullable) |
conversationId | string | Associated conversation ID (nullable) |
status | string | Processing status (SUCCESS, FAILED, etc.) |
createdAt | string | Record creation timestamp (ISO 8601) |
aiRecordDetail | object | Detailed request and response data |
additionalData | object | Extra data specific to feature (nullable) |
aiRecordDetail Object
| Field | Type | Description |
|---|---|---|
promptObject | object | Original request parameters |
resultObject | array | Generated results (URLs, text, etc.) |
teamUser Object
| Field | Type | Description |
|---|---|---|
teamId | string | Team identifier |
userId | string | User identifier |
userName | string | Display name of the user |
userAvatar | string | URL to user's avatar image |
status | string | User status (ACTIVE, INACTIVE, etc.) |
role | string | User role (ADMIN, MEMBER, etc.) |
creditLimit | number | Maximum credits available to user |
usedCredit | number | Credits consumed by user |
createdAt | string | User creation timestamp (ISO 8601) |
createdBy | string | Who created the user record |
updatedAt | string | Last update timestamp (ISO 8601) |
updatedBy | string | Who last updated the user record |
Additional Details
For detailed request and response examples for each specific feature, use Chrome DevTools or similar tools to inspect network traffic when using the 1minAI web application. The API behavior matches the web application functionality.
