### Get Recraft Style List API Requests Source: https://docs.1min.ai/docs/api/ai-for-image/background-replacer/recraft-background-replacer Examples for retrieving available styles and substyles for a specific model version. ```curl curl --location 'https://api.1min.ai/api/recraft/styles?taskType=recraftv3' \ --header 'API-KEY: ' ``` ```javascript fetch('https://api.1min.ai/api/recraft/styles?taskType=recraftv3', { method: 'GET', headers: { 'API-KEY': 'YOUR_API_KEY' } }) .then(response => response.json()) .then(data => console.log(data)); ``` ```python import requests url = "https://api.1min.ai/api/recraft/styles" headers = { "API-KEY": "YOUR_API_KEY" } params = { "taskType": "recraftv3" } response = requests.get(url, headers=headers, params=params) styles = response.json() ``` -------------------------------- ### WebVTT Format Example Source: https://docs.1min.ai/docs/api/ai-for-video/caption-generator/caption-generator-tag This example shows the WebVTT (Web Video Text Tracks) format for video captions and subtitles. It is a more modern and flexible format than SRT. ```vtt WEBVTT 00:00:00.000 --> 00:00:03.240 Welcome to this video tutorial on AI technology. 00:00:03.240 --> 00:00:07.080 Today we'll explore the latest developments in machine learning. ``` -------------------------------- ### Generate Video via API Source: https://docs.1min.ai/docs/api/ai-for-video/text-to-video/luma-text-to-video Examples for invoking the text-to-video generation endpoint using different programming environments. ```bash curl --location 'https://api.1min.ai/api/features' \ --header 'API-KEY: ' \ --header 'Content-Type: application/json' \ --data '{ "type": "TEXT_TO_VIDEO", "model": "luma", "promptObject": { "prompt": "a majestic lion walking through golden savanna at sunset", "modelName": "ray-v2", "duration": "5s", "aspectRatio": "16:9", "resolution": "720p", "loop": false } }' ``` ```javascript fetch('https://api.1min.ai/api/features', { method: 'POST', headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_API_KEY' }, body: JSON.stringify({ type: 'TEXT_TO_VIDEO', model: 'luma', promptObject: { prompt: 'a majestic lion walking through golden savanna at sunset', modelName: 'ray-v2', duration: '5s', aspectRatio: '16:9', resolution: '720p', loop: false } }) }) ``` ```python import requests url = "https://api.1min.ai/api/features" headers = { "Content-Type": "application/json", "API-KEY": "YOUR_API_KEY" } data = { "type": "TEXT_TO_VIDEO", "model": "luma", "promptObject": { "prompt": "a majestic lion walking through golden savanna at sunset", "modelName": "ray-v2", "duration": "5s", "aspectRatio": "16:9", "resolution": "720p", "loop": False } } response = requests.post(url, headers=headers, json=data) ``` -------------------------------- ### Upscale Image via API Source: https://docs.1min.ai/docs/api/ai-for-image/image-upscaler/dzine-image-upscaler Examples for invoking the image upscaling endpoint using different programming environments. ```bash curl --location 'https://api.1min.ai/api/features' \ --header 'API-KEY: ' \ --header 'Content-Type: application/json' \ --data '{ "type": "IMAGE_UPSCALER", "model": "dzine", "promptObject": { "imageUrl": "development/images/low_res_photo.jpg", "upscaling_resize": 2, "output_format": "png" } }' ``` ```javascript fetch('https://api.1min.ai/api/features', { method: 'POST', headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_API_KEY' }, body: JSON.stringify({ type: 'IMAGE_UPSCALER', model: 'dzine', promptObject: { imageUrl: 'development/images/low_res_photo.jpg', upscaling_resize: 2, output_format: 'png' } }) }) ``` ```python import requests url = "https://api.1min.ai/api/features" headers = { "Content-Type": "application/json", "API-KEY": "YOUR_API_KEY" } data = { "type": "IMAGE_UPSCALER", "model": "dzine", "promptObject": { "imageUrl": "development/images/low_res_photo.jpg", "upscaling_resize": 2, "output_format": "png" } } response = requests.post(url, headers=headers, json=data) ``` -------------------------------- ### Flux Depth Dev API Integration Examples Source: https://docs.1min.ai/docs/api/ai-for-image/image-text-editor/flux-depth-dev-image-text-editor Examples for invoking the Flux Depth Dev image editing model using cURL, JavaScript Fetch, and Python Requests. ```bash curl -X POST "https://api.1min.ai/api/features" \ -H "API-KEY: " \ -H "Content-Type: application/json" \ -d '{ "type": "IMAGE_EDITOR", "model": "black-forest-labs/flux-depth-dev", "promptObject": { "imageUrl": "development/images/2025_02_16_15_42_40_711_human.jpg", "prompt": "Create dramatic depth effects with cinematic lighting", "num_inference_steps": 50, "guidance": 5.0, "seed": 42, "output_quality": 90, "disable_safety_checker": false, "megapixels": "1", "format": "webp" } }' ``` ```javascript fetch('https://api.1min.ai/api/features', { method: 'POST', headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_API_KEY' }, body: JSON.stringify({ type: 'IMAGE_EDITOR', model: 'black-forest-labs/flux-depth-dev', promptObject: { imageUrl: 'development/images/2025_02_16_15_42_40_711_human.jpg', prompt: 'Create dramatic depth effects with cinematic lighting', num_inference_steps: 50, guidance: 5.0, seed: 42, output_quality: 90, disable_safety_checker: false, megapixels: '1', format: 'webp' } }) }) ``` ```python import requests url = "https://api.1min.ai/api/features" headers = { "Content-Type": "application/json", "API-KEY": "YOUR_API_KEY" } data = { "type": "IMAGE_EDITOR", "model": "black-forest-labs/flux-depth-dev", "promptObject": { "imageUrl": "development/images/2025_02_16_15_42_40_711_human.jpg", "prompt": "Create dramatic depth effects with cinematic lighting", "num_inference_steps": 50, "guidance": 5.0, "seed": 42, "output_quality": 90, "disable_safety_checker": False, "megapixels": "1", "format": "webp" } } response = requests.post(url, headers=headers, json=data) ``` -------------------------------- ### Background Replacer API Integration Source: https://docs.1min.ai/docs/api/ai-for-image/background-replacer/stable-diffusion-xl-background-replacer Examples for invoking the background replacement feature using different programming environments. ```bash curl --location 'https://api.1min.ai/api/features' \ --header 'API-KEY: ' \ --header 'Content-Type: application/json' \ --data '{ "type": "BACKGROUND_REPLACER", "model": "clipdrop", "promptObject": { "imageUrl": "images/2025_10_26_10_39_15_294_cat.png", "prompt": "remove background" } }' ``` ```javascript fetch('https://api.1min.ai/api/features', { method: 'POST', headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_API_KEY' }, body: JSON.stringify({ type: 'BACKGROUND_REPLACER', model: 'clipdrop', promptObject: { imageUrl: 'images/2025_10_26_10_39_15_294_cat.png', prompt: 'remove background' } }) }) ``` ```python import requests url = "https://api.1min.ai/api/features" headers = { "Content-Type": "application/json", "API-KEY": "YOUR_API_KEY" } data = { "type": "BACKGROUND_REPLACER", "model": "clipdrop", "promptObject": { "imageUrl": "images/2025_10_26_10_39_15_294_cat.png", "prompt": "remove background" } } response = requests.post(url, headers=headers, json=data) ``` -------------------------------- ### Upscale Image via API Source: https://docs.1min.ai/docs/api/ai-for-image/image-upscaler/stable-image-upscaler Examples for invoking the image upscaler endpoint using various programming environments. ```bash curl --location 'https://api.1min.ai/api/features' \ --header 'API-KEY: ' \ --header 'Content-Type: application/json' \ --data '{ "type": "IMAGE_UPSCALER", "model": "stable-image", "promptObject": { "imageUrl": "images/2025_10_26_05_43_42_184_cat.png", "output_format": "png" } }' ``` ```javascript fetch('https://api.1min.ai/api/features', { method: 'POST', headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_API_KEY' }, body: JSON.stringify({ type: 'IMAGE_UPSCALER', model: 'stable-image', promptObject: { imageUrl: 'images/2025_10_26_05_43_42_184_cat.png', output_format: 'png' } }) }) ``` ```python import requests url = "https://api.1min.ai/api/features" headers = { "Content-Type": "application/json", "API-KEY": "YOUR_API_KEY" } data = { "type": "IMAGE_UPSCALER", "model": "stable-image", "promptObject": { "imageUrl": "images/2025_10_26_05_43_42_184_cat.png", "output_format": "png" } } response = requests.post(url, headers=headers, json=data) ``` -------------------------------- ### Get Dzine Style List Response Format Source: https://docs.1min.ai/docs/api/ai-for-image/image-generator/dzine-image-generation Example JSON response structure returned by the style list endpoint. ```json { "styleList": [ { "name": "No Style v2", "base_model": "S", "style_code": "Style-7feccf2b-f2ad-43a6-89cb-354fb5d928d2", "cover_url": "https://static.stylar.ai/stylar_admin/common/style_avatar/6ce8b5158b63c56d32cd8305a73ecab8/1721212364855681_11_312.jpg", "style_intensity": { "img2img": 0, "txt2img": 0 } }, { "name": "Anime", "base_model": "S", "style_code": "Style-a1b2c3d4-e5f6-7890-abcd-ef1234567890", "cover_url": "https://static.stylar.ai/.../anime_style.jpg", "style_intensity": { "img2img": 0.8, "txt2img": 0.9 } } ], "total": 208 } ``` -------------------------------- ### Music Generation Use Cases Source: https://docs.1min.ai/docs/api/ai-for-audio/music-generator/lyria-music-generator Example prompt objects for various scenarios including film, gaming, marketing, and podcasting. ```json { "prompt": "cinematic orchestral music with dramatic strings and epic brass, building tension", "negative_prompt": "no percussion, no electronic elements" } ``` ```json { "prompt": "ambient fantasy music with soft flutes and gentle harp, peaceful atmosphere", } ``` ```json { "prompt": "upbeat corporate music with piano and light percussion, inspiring and positive", "negative_prompt": "no heavy bass, no aggressive sounds" } ``` ```json { "prompt": "modern tech podcast intro with electronic beats and synthesizers, futuristic", "seed": 42 } ``` -------------------------------- ### Content Expander API Integration Source: https://docs.1min.ai/docs/api/ai-for-writing/content-expander/content-expander-tag Examples for calling the Content Expander API using different programming environments. Replace or YOUR_API_KEY with your actual credentials. ```bash curl --location 'https://api.1min.ai/api/features' \ --header 'API-KEY: ' \ --header 'Content-Type: application/json' \ --data '{ "type": "CONTENT_EXPANDER", "model": "gpt-4o", "conversationId": "CONTENT_EXPANDER", "promptObject": { "tone": "informative", "numberOfWord": 100, "prompt": "AI is transforming industries." } }' ``` ```javascript fetch('https://api.1min.ai/api/features', { method: 'POST', headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_API_KEY' }, body: JSON.stringify({ type: 'CONTENT_EXPANDER', model: 'gpt-4o', conversationId: 'CONTENT_EXPANDER', promptObject: { tone: 'informative', numberOfWord: 100, prompt: 'AI is transforming industries.' } }) }) ``` ```python import requests url = "https://api.1min.ai/api/features" headers = { "Content-Type": "application/json", "API-KEY": "YOUR_API_KEY" } data = { "type": "CONTENT_EXPANDER", "model": "gpt-4o", "conversationId": "CONTENT_EXPANDER", "promptObject": { "tone": "informative", "numberOfWord": 100, "prompt": "AI is transforming industries." } } response = requests.post(url, headers=headers, json=data) ``` -------------------------------- ### Get Dzine Style List API Requests Source: https://docs.1min.ai/docs/api/ai-for-image/image-generator/dzine-image-generation Examples of how to retrieve the list of available style codes using different programming languages. ```curl curl --location 'https://api.1min.ai/api/dzine/styles' \ --header 'API-KEY: ' ``` ```javascript fetch('https://api.1min.ai/api/dzine/styles', { method: 'GET', headers: { 'API-KEY': 'YOUR_API_KEY' } }) .then(response => response.json()) .then(data => console.log(data)); ``` ```python import requests url = "https://api.1min.ai/api/dzine/styles" headers = { "API-KEY": "YOUR_API_KEY" } response = requests.get(url, headers=headers) styles = response.json() ``` -------------------------------- ### Generate Image with Flux Schnell (Python) Source: https://docs.1min.ai/docs/api/ai-for-image/image-generator/flux-schnell-image-generation This Python example uses the `requests` library to send a POST request for image generation. Replace 'YOUR_API_KEY' with your actual API key before execution. ```python import requests url = "https://api.1min.ai/api/features" headers = { "Content-Type": "application/json", "API-KEY": "YOUR_API_KEY" } data = { "type": "IMAGE_GENERATOR", "model": "black-forest-labs/flux-schnell", "promptObject": { "prompt": "Modern minimalist logo design, clean lines, professional", "aspect_ratio": "1:1", "num_inference_steps": 4, "go_fast": True, "megapixels": "1", "output_quality": 80 } } response = requests.post(url, headers=headers, json=data) ``` -------------------------------- ### Generate Image with Flux Pro 1.1 using JavaScript Source: https://docs.1min.ai/docs/api/ai-for-image/image-generator/flux-pro-1-1-image-generation This JavaScript example demonstrates how to make a POST request using the Fetch API to generate an image. Remember to replace 'YOUR_API_KEY' with your valid API key. ```javascript fetch('https://api.1min.ai/api/features', { method: 'POST', headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_API_KEY' }, body: JSON.stringify({ type: 'IMAGE_GENERATOR', model: 'black-forest-labs/flux-1.1-pro', promptObject: { prompt: 'A majestic mountain landscape at golden hour with dramatic clouds', aspect_ratio: '16:9', output_quality: 90, safety_tolerance: 2, prompt_upsampling: true } }) }) ``` -------------------------------- ### GET /api/dzine/styles - Get Dzine Style List Source: https://docs.1min.ai/docs/api/ai-for-image/image-generator/dzine-image-generation Retrieves a list of all available style codes and their properties for Dzine image generation. ```APIDOC ## GET /api/dzine/styles ### Description Retrieves a list of all available style codes and their properties, which can be used in the image generation endpoint. ### Method GET ### Endpoint `https://api.1min.ai/api/dzine/styles` ### Request Headers - **API-KEY** (string) - Required - Your API key for authentication. ### Response #### Success Response (200) - **styleList** (array) - An array of style objects. - **name** (string) - Human-readable style name. - **base_model** (string) - Model type: "S" (Standard) or "X" (Extended). - **style_code** (string) - Unique style identifier to use in generation requests. - **cover_url** (string) - Preview image URL showing the style. - **style_intensity.txt2img** (number) - Recommended intensity for text-to-image (0-1). - **style_intensity.img2img** (number) - Recommended intensity for image-to-image (0-1). - **total** (number) - The total number of available styles. #### Response Example ```json { "styleList": [ { "name": "No Style v2", "base_model": "S", "style_code": "Style-7feccf2b-f2ad-43a6-89cb-354fb5d928d2", "cover_url": "https://static.stylar.ai/stylar_admin/common/style_avatar/6ce8b5158b63c56d32cd8305a73ecab8/1721212364855681_11_312.jpg", "style_intensity": { "img2img": 0, "txt2img": 0 } }, { "name": "Anime", "base_model": "S", "style_code": "Style-a1b2c3d4-e5f6-7890-abcd-ef1234567890", "cover_url": "https://static.stylar.ai/.../anime_style.jpg", "style_intensity": { "img2img": 0.8, "txt2img": 0.9 } } ], "total": 208 } ``` ### Example Request (cURL) ```bash curl --location 'https://api.1min.ai/api/dzine/styles' \ --header 'API-KEY: ' ``` ``` -------------------------------- ### Professional Quality Settings Source: https://docs.1min.ai/docs/api/ai-for-image/image-generator/magic-art-7.0-image-generation Recommended configuration parameters for achieving professional-grade results. ```json # Optimal settings for commercial work { "stylize": 150, "chaos": 20, "weird": 0, "mode": "fast" } ``` -------------------------------- ### SRT Format Example Source: https://docs.1min.ai/docs/api/ai-for-video/caption-generator/caption-generator-tag This is an example of the SubRip Text (SRT) format for subtitles, commonly used for video captioning. It includes sequence numbers and timecodes. ```srt 1 00:00:00,000 --> 00:00:03,240 Welcome to this video tutorial on AI technology. 2 00:00:03,240 --> 00:00:07,080 Today we'll explore the latest developments in machine learning. ``` -------------------------------- ### Get Recraft Style List (Python) Source: https://docs.1min.ai/docs/api/ai-for-image/image-generator/recraft-image-generation Use the Python requests library to get the list of available styles and substyles for a specified Recraft model version. ```python import requests url = "https://api.1min.ai/api/recraft/styles" headers = { "API-KEY": "YOUR_API_KEY" } params = { "taskType": "recraftv3" } response = requests.get(url, headers=headers, params=params) styles = response.json() ``` -------------------------------- ### Generate Images with Magic Art 5.2 Source: https://docs.1min.ai/docs/api/ai-for-image/image-generator/magic-art-5.2-image-generation Examples for invoking the image generation endpoint using different programming environments. ```curl curl --location 'https://api.1min.ai/api/features' \ --header 'API-KEY: ' \ --header 'Content-Type: application/json' \ --data '{ "type": "IMAGE_GENERATOR", "model": "magic-art", "promptObject": { "prompt": "Generate a simple image", "mode": "fast", "n": 4, "isNiji6": false, "aspect_width": 3, "aspect_height": 2, "stylize": 150, "chaos": 20, "maintainModeration": true } }' ``` ```javascript fetch('https://api.1min.ai/api/features', { method: 'POST', headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_API_KEY' }, body: JSON.stringify({ type: 'IMAGE_GENERATOR', model: 'magic-art', promptObject: { prompt: 'Generate a simple image', mode: 'fast', n: 4, isNiji6: false, aspect_width: 3, aspect_height: 2, stylize: 150, chaos: 20, maintainModeration: true } }) }) ``` ```python import requests url = "https://api.1min.ai/api/features" headers = { "Content-Type": "application/json", "API-KEY": "YOUR_API_KEY" } data = { "type": "IMAGE_GENERATOR", "model": "magic-art", "promptObject": { "prompt": "Generate a simple image", "mode": "fast", "n": 4, "isNiji6": False, "aspect_width": 3, "aspect_height": 2, "stylize": 150, "chaos": 20, "maintainModeration": True } } response = requests.post(url, headers=headers, json=data) ``` -------------------------------- ### Text-to-Video with Reference Image (JavaScript) Source: https://docs.1min.ai/docs/api/ai-for-video/text-to-video/sora-text-to-video This JavaScript fetch request demonstrates how to generate a video with a reference image. Replace 'YOUR_API_KEY' with your valid API key. ```javascript fetch('https://api.1min.ai/api/features', { method: 'POST', headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_API_KEY' }, body: JSON.stringify({ type: 'TEXT_TO_VIDEO', model: 'sora-2-pro', conversationId: 'TEXT_TO_VIDEO', promptObject: { prompt: 'Camera slowly zooms in on the landscape as birds fly across the sky', seconds: 12, size: '1792x1024', reference_image_path: 'uploads/user123/landscape.jpg', reference_image_name: 'landscape.jpg', reference_image_type: 'image/jpeg' } }) }) ``` -------------------------------- ### Legacy AI Feature API Request Example Source: https://docs.1min.ai/docs/api/chat-with-ai-api This is an example of a request payload for the legacy AI Feature API. It uses a flat structure for prompt parameters. ```json { "type": "CHAT_WITH_AI", "model": "gpt-4o-mini", "promptObject": { "prompt": "Hello!", "isMixed": false, "webSearch": true, "numOfSite": 3, "maxWord": 500 } } ``` -------------------------------- ### Manual Extension API Requests Source: https://docs.1min.ai/docs/api/ai-for-image/image-extender/clipdrop-image-extender Examples of how to trigger the image extension process using cURL or the JavaScript fetch API. ```curl curl --location 'https://api.1min.ai/api/features' \ --header 'API-KEY: ' \ --header 'Content-Type: application/json' \ --data '{ "type": "IMAGE_EXTENDER", "model": "clipdrop", "promptObject": { "imageUrl": "https://example.com/image.jpg", "left": 500, "right": 500 } }' ``` ```javascript fetch('https://api.1min.ai/api/features', { method: 'POST', headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_API_KEY' }, body: JSON.stringify({ type: 'IMAGE_EXTENDER', model: 'clipdrop', promptObject: { imageUrl: 'https://example.com/image.jpg', left: 500, right: 500 } }) }) ``` -------------------------------- ### API Response Format Example Source: https://docs.1min.ai/docs/api/ai-for-image/face-swapper/dzine-face-swapper Example of the JSON response format received after a successful face swap operation, including details about the AI record and results. ```json { "aiRecord": { "uuid": "e40dd9ef-0944-4ce5-bc90-1edd2548619a", "userId": "f944dd01-da40-405c-b698-708269eb9664", "teamId": "7d530bad-357c-4f6e-b627-16f043c9a16b", "teamUser": { "teamId": "7d530bad-357c-4f6e-b627-16f043c9a16b", "userId": "f944dd01-da40-405c-b698-708269eb9664", "userName": "test", "userAvatar": null, "status": "ACTIVE", "role": "ADMIN", "creditLimit": 100000000, "usedCredit": 8370000, "createdAt": "2025-10-31T06:24:14.102Z", "createdBy": "SYSTEM", "updatedAt": "2025-11-05T15:54:56.422Z", "updatedBy": "SYSTEM" }, "model": "dzine", "type": "FACE_SWAPPER", "metadata": null, "rating": null, "feedback": null, "conversationId": null, "status": "SUCCESS", "createdAt": "2025-11-05T15:59:57.291Z", "aiRecordDetail": { "promptObject": { "n": 1, "swapImageUrl": "development/images/target_person.jpg", "output_format": "webp", "targetImageUrl": "development/images/source_face.jpg" }, "resultObject": [ "development/images/2025_11_05_22_59_58_236_378180.webp" ], "responseObject": {} }, "additionalData": null, "temporaryUrl": "" } } ``` -------------------------------- ### New Chat with AI API Request Example Source: https://docs.1min.ai/docs/api/chat-with-ai-api This example demonstrates the request payload for the new Chat with AI API. It features a structured 'promptObject' with nested settings. ```json { "type": "UNIFY_CHAT_WITH_AI", "model": "gpt-4o-mini", "promptObject": { "prompt": "Hello!", "settings": { "historySettings": { "isMixed": false }, "webSearchSettings": { "webSearch": true, "numOfSite": 3, "maxWord": 500 } } } } ``` -------------------------------- ### Generate Image with Python Requests Source: https://docs.1min.ai/docs/api/ai-for-image/image-generator/dzine-image-generation A Python example using the requests library to call the 1min.ai image generation API. Replace 'YOUR_API_KEY' with your actual API key. ```python import requests url = "https://api.1min.ai/api/features" headers = { "Content-Type": "application/json", "API-KEY": "YOUR_API_KEY" } data = { "type": "IMAGE_GENERATOR", "model": "dzine", "promptObject": { "prompt": "A serene mountain landscape at sunset with vibrant autumn colors", "style_code": "Style-7feccf2b-f2ad-43a6-89cb-354fb5d928d2", "style_base_model": "S", "size": "1024x1024", "n": 1, "style_intensity": 0.8, "quality": "HIGH", "output_format": "webp" } } response = requests.post(url, headers=headers, json=data) ``` -------------------------------- ### API Response Format Example Source: https://docs.1min.ai/docs/api/ai-for-image/search-and-replace/stable-image-core-search-and-replace This is an example of the JSON response structure you can expect after executing an API request. It includes details about the AI record, user information, and the results of the operation. ```json { "aiRecord": { "uuid": "s1r2p3l4-v5e6-7890-abcd-ef1234567890", "userId": "user-12345", "teamId": "team-67890", "teamUser": { "teamId": "team-67890", "userId": "user-12345", "userName": "John Doe", "userAvatar": "https://example.com/avatar.jpg", "status": "ACTIVE", "role": "ADMIN", "creditLimit": 100000000, "usedCredit": 35000, "createdAt": "2025-01-01T00:00:00.000Z", "createdBy": "SYSTEM", "updatedAt": "2025-01-15T15:30:00.000Z", "updatedBy": "SYSTEM" }, "model": "stable-image", "type": "SEARCH_AND_REPLACE", "metadata": null, "rating": null, "feedback": null, "conversationId": null, "status": "SUCCESS", "createdAt": "2025-01-15T15:30:00.000Z", "aiRecordDetail": { "promptObject": { "imageUrl": "development/images/2025_02_16_15_00_19_886_banana.jpg", "search_prompt": "banana", "prompt": "a purple eggplant", "output_format": "png" }, "resultObject": [ "development/images/2025_01_15_15_30_45_001_search_replaced.png" ], "responseObject": {} }, "additionalData": null, "temporaryUrl": "https://s3.us-east-1.amazonaws.com/asset.1min.ai/development/images/2025_01_15_15_30_45_001_search_replaced.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=EXAMPLE_CREDENTIAL&X-Amz-Date=20250115T153000Z&X-Amz-Expires=604800&X-Amz-Signature=example_signature&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject" } } ``` -------------------------------- ### Generate Image with Flux Dev API (JavaScript) Source: https://docs.1min.ai/docs/api/ai-for-image/image-generator/flux-dev-image-generation This JavaScript fetch example demonstrates how to make a POST request to the image generation API. Replace 'YOUR_API_KEY' with your actual API key and customize the promptObject. ```javascript fetch('https://api.1min.ai/api/features', { method: 'POST', headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_API_KEY' }, body: JSON.stringify({ type: 'IMAGE_GENERATOR', model: 'black-forest-labs/flux-dev', promptObject: { prompt: 'A futuristic cityscape at sunset with flying cars and neon lights', aspect_ratio: '16:9', num_inference_steps: 28, guidance: 3.5, megapixels: '1', output_quality: 85 } }) }) ``` -------------------------------- ### Generate Images with GPT Image 1 Source: https://docs.1min.ai/docs/api/ai-for-image/image-generator/gpt-image-1-image-generation Examples of how to call the image generation endpoint using various programming environments. ```curl curl --location 'https://api.1min.ai/api/features' \ --header 'API-KEY: ' \ --header 'Content-Type: application/json' \ --data '{ "type": "IMAGE_GENERATOR", "model": "gpt-image-1", "promptObject": { "prompt": "A serene Japanese garden with cherry blossoms and a traditional tea house", "n": 1, "size": "1536x1024", "quality": "high", "style": "natural", "output_format": "png", "background": "opaque" } }' ``` ```javascript fetch('https://api.1min.ai/api/features', { method: 'POST', headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_API_KEY' }, body: JSON.stringify({ type: 'IMAGE_GENERATOR', model: 'gpt-image-1', promptObject: { prompt: 'A serene Japanese garden with cherry blossoms and a traditional tea house', n: 1, size: '1536x1024', quality: 'high', style: 'natural', output_format: 'png', background: 'opaque' } }) }) ``` ```python import requests url = "https://api.1min.ai/api/features" headers = { "Content-Type": "application/json", "API-KEY": "YOUR_API_KEY" } data = { "type": "IMAGE_GENERATOR", "model": "gpt-image-1", "promptObject": { "prompt": "A serene Japanese garden with cherry blossoms and a traditional tea house", "n": 1, "size": "1536x1024", "quality": "high", "style": "natural", "output_format": "png", "background": "opaque" } } response = requests.post(url, headers=headers, json=data) ``` -------------------------------- ### Send Image Editing Request with Python (requests) Source: https://docs.1min.ai/docs/api/ai-for-image/image-text-editor/flux-canny-dev-image-text-editor This Python code uses the `requests` library to send an image editing request. Ensure you have the library installed (`pip install requests`) and replace 'YOUR_API_KEY' with your actual API key. ```python import requests url = "https://api.1min.ai/api/features" headers = { "Content-Type": "application/json", "API-KEY": "YOUR_API_KEY" } data = { "type": "IMAGE_EDITOR", "model": "black-forest-labs/flux-canny-dev", "promptObject": { "imageUrl": "development/images/2025_02_16_15_42_40_711_human.jpg", "prompt": "Create detailed line art with enhanced edge detection", "num_outputs": 2, "num_inference_steps": 50, "guidance": 5.0, "seed": 42, "output_quality": 90, "disable_safety_checker": False, "megapixels": "1", "format": "webp" } } response = requests.post(url, headers=headers, json=data) ``` -------------------------------- ### GET /recraft/styles Source: https://docs.1min.ai/docs/api/ai-for-image/image-generator/recraft-image-generation Retrieves a list of available styles for image generation. ```APIDOC ## GET /recraft/styles ### Description Retrieves a list of supported style options available for image generation. ### Method GET ### Endpoint /recraft/styles ### Response #### Success Response (200) - **styles** (array) - A list of available style objects. ``` -------------------------------- ### Send Image Inpainting Request with JavaScript Source: https://docs.1min.ai/docs/api/ai-for-image/image-mask-editor/flux-fill-dev-image-mask-editor This JavaScript fetch example demonstrates how to make a POST request to the image inpainting API. Remember to replace 'YOUR_API_KEY' with your valid API key. ```javascript fetch('https://api.1min.ai/api/features', { method: 'POST', headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_API_KEY' }, body: JSON.stringify({ type: 'IMAGE_INPAINTER', model: 'black-forest-labs/flux-fill-dev', promptObject: { imageUrl: 'development/images/2025_02_16_15_35_49_260_banana.jpg', maskUrl: 'development/images/2025_02_16_15_36_38_743_image.png', prompt: 'a ripe red apple with glossy skin and natural lighting', num_inference_steps: 28, guidance: 3.5, megapixels: '1', output_quality: 85 } }) }) ``` -------------------------------- ### GET /api/recraft/styles Source: https://docs.1min.ai/docs/api/ai-for-image/background-replacer/recraft-background-replacer Retrieves the complete list of available styles and substyles for each Recraft model version. ```APIDOC ## GET https://api.1min.ai/api/recraft/styles ### Description Retrieve the complete list of available styles and substyles for each Recraft model version before performing background replacement. ### Method GET ### Endpoint https://api.1min.ai/api/recraft/styles ### Parameters #### Query Parameters - **taskType** (string) - Required - Model version: `recraftv3` ### Response #### Success Response (200) - **styleList** (array) - List of available styles - **total** (number) - Total count of styles #### Response Example { "styleList": [ { "model": "recraftv3", "style": "digital_illustration", "substyle": "2d_art_poster" } ], "total": 1 } ``` -------------------------------- ### Tips for Best Results Source: https://docs.1min.ai/docs/api/ai-for-image/image-extender/stable-image-extender This snippet provides guidance and best practices for using the image extension API to achieve optimal results. ```APIDOC ## Tips for Best Results 1. **Input Image Quality**: Use high-quality source images for optimal results * Higher resolution inputs produce better extended content * Clear, well-lit images extend more successfully than dark or blurry ones 2. **Extension Planning**: Consider the intended use before setting extension values * **Web banners**: Focus on horizontal extension (left/right) * **Social media**: Consider platform-specific aspect ratios * **Print materials**: Plan for standard print dimensions 3. **Content Considerations**: AI performs better with certain image types * **Natural scenes**: Landscapes, skies, and outdoor environments extend excellently * **Architectural**: Buildings and structures with clear patterns work well * **Portraits**: Consider background complexity when extending around subjects 4. **Directional Balance**: Think about visual weight and composition * Extend toward less complex areas for more natural results * Consider lighting direction when extending backgrounds * Maintain compositional balance with symmetric extensions 5. **Format Selection**: Choose output format based on final use * **PNG**: Best for images requiring transparency or maximum quality * **JPEG**: Ideal for photographs and web use with smaller file sizes * **WebP**: Modern format with excellent compression for digital applications ``` -------------------------------- ### Replace Background API Requests Source: https://docs.1min.ai/docs/api/ai-for-image/background-replacer/recraft-background-replacer Examples for sending a background replacement request with a prompt object. ```curl curl --location 'https://api.1min.ai/api/features' \ --header 'API-KEY: ' \ --header 'Content-Type: application/json' \ --data '{ "type": "BACKGROUND_REPLACER", "model": "recraft", "promptObject": { "imageUrl": "images/2026_01_07_09_33_18_380_room.png", "prompt": "a beautiful tropical beach with palm trees and sunset", "n": 1, "style": "vector_illustration", "substyle": "bold_stroke" } }' ``` ```javascript const body = JSON.stringify({ type: 'BACKGROUND_REPLACER', model: 'recraft', promptObject: { imageUrl: 'images/2026_01_07_09_33_18_380_room.png', prompt: 'a beautiful tropical beach with palm trees and sunset', n: 1, style: 'vector_illustration', substyle: 'bold_stroke' } }); fetch('https://api.1min.ai/api/features', { method: 'POST', headers: { 'API-KEY': 'YOUR_API_KEY', 'Content-Type': 'application/json' }, body: body }) ``` ```python import requests url = "https://api.1min.ai/api/features" headers = { "API-KEY": "YOUR_API_KEY", "Content-Type": "application/json" } payload = { "type": "BACKGROUND_REPLACER", "model": "recraft", "promptObject": { "imageUrl": "images/2026_01_07_09_33_18_380_room.png", "prompt": "a beautiful tropical beach with palm trees and sunset", "n": 1, "style": "vector_illustration", "substyle": "bold_stroke" } } response = requests.post(url, headers=headers, json=payload) ``` -------------------------------- ### Non-Streaming JSON Response Structure Source: https://docs.1min.ai/docs/api/ai-feature-api Example of a complete JSON response returned for non-streaming features. ```json { "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 } } ```