Skip to main content

AI Feature API

A unified API endpoint for all AI services.

Deprecation Notice for Chat Features

The chat-related feature types (CHAT_WITH_AI, CHAT_WITH_IMAGE, CHAT_WITH_PDF, CHAT_WITH_YOUTUBE_VIDEO) are no longer supported by this API. Use the Chat with AI API with the UNIFY_CHAT_WITH_AI type for chat integrations. Non-chat features (image generation, video, audio, writing, etc.) 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 requests are not supported on this endpoint. Use the 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.

FieldValue
API-KEY<api-key>
Content-Typeapplication/json

Request Payload

Required Parameters

ParameterTypeDescription
typestringFeature name (e.g., IMAGE_GENERATOR)
modelstringModel name to use
promptObjectobjectFeature-specific parameters

Note: Please check for all parameters of promptObject as they vary by feature type.

Non-Streaming Features Example

Image Variation

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
}
})
})

PromptObject Parameters

The promptObject contains feature-specific parameters:

For Image Features

ParameterTypeDescription
imageUrlstringAbsolute URL or asset key from Asset API
modestringProcessing mode (e.g., "fast")
nnumberNumber of variations
aspect_widthnumberAspect ratio width
aspect_heightnumberAspect ratio height
maintainModerationbooleanApply 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

FieldTypeDescription
uuidstringUnique identifier for the AI record
userIdstringUser identifier
teamIdstringTeam identifier
teamUserobjectTeam user details and permissions
modelstringModel used for processing
typestringFeature type (e.g., IMAGE_GENERATOR)
metadataobjectAdditional metadata (nullable)
ratingnumberUser rating for the result (nullable)
feedbackstringUser feedback text (nullable)
conversationIdstringAssociated conversation ID (nullable)
statusstringProcessing status (SUCCESS, FAILED, etc.)
createdAtstringRecord creation timestamp (ISO 8601)
aiRecordDetailobjectDetailed request and response data
additionalDataobjectExtra data specific to feature (nullable)

aiRecordDetail Object

FieldTypeDescription
promptObjectobjectOriginal request parameters
resultObjectarrayGenerated results (URLs, text, etc.)

teamUser Object

FieldTypeDescription
teamIdstringTeam identifier
userIdstringUser identifier
userNamestringDisplay name of the user
userAvatarstringURL to user's avatar image
statusstringUser status (ACTIVE, INACTIVE, etc.)
rolestringUser role (ADMIN, MEMBER, etc.)
creditLimitnumberMaximum credits available to user
usedCreditnumberCredits consumed by user
createdAtstringUser creation timestamp (ISO 8601)
createdBystringWho created the user record
updatedAtstringLast update timestamp (ISO 8601)
updatedBystringWho 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.

Details Response