AI Feature API
A unified API endpoint for all AI services.
The chat-related feature types (CHAT_WITH_AI, CHAT_WITH_IMAGE, CHAT_WITH_PDF, CHAT_WITH_YOUTUBE_VIDEO) in this API are being deprecated. Please migrate all chat integrations to the new Chat with AI API using the UNIFY_CHAT_WITH_AI type. The new API provides a better developer experience with structured settings, SSE streaming events, and AI memory support. Non-chat features (image generation, video, audio, writing, etc.) will continue to use this endpoint.
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 image generation, and other AI services.
Endpoints
Streaming Features (Chat - Deprecated)
Please use the new Chat with AI API with the UNIFY_CHAT_WITH_AI type instead
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., 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.
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: 'magic-art',
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": "magic-art",
"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": "magic-art",
"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
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.
