Skip to main content

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.

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

Request Payload

Required Parameters

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

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

Streaming Features Examples

Chat Without Context

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

Chat With Context (Multi-AI Chat)

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

Chat Feature Types

  • CHAT_WITH_AI - Standard AI chat
  • CHAT_WITH_IMAGE - Chat with image analysis
  • CHAT_WITH_PDF - Multi-document chat with PDFs

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

PromptObject Parameters

The promptObject contains feature-specific parameters:

For Chat Features

ParameterTypeDescription
promptstringThe user's message
isMixedbooleanMix models context
imageListarrayImage identifiers (for CHAT_WITH_IMAGE)
webSearchbooleanEnable web search
numOfSitenumberNumber of sites to search (when webSearch is true)
maxWordnumberMaximum words from web search (when webSearch is true)

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

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

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