### Install ModelsLab Go SDK Source: https://docs.modelslab.com/sdk/golang Initialize your Go project and install the ModelsLab SDK using go mod. ```bash go mod init your-project go get github.com/modelslab/modelslab-go ``` -------------------------------- ### System Details Request Example Source: https://docs.modelslab.com/enterprise-api/image-to-video-ultra/system-details Send a POST request to the system_details endpoint to get information about your server. Requires an enterprise API key for authorization. ```bash --request POST 'https://modelslab.com/api/v1/enterprise/image_to_video_ultra/system_details' \ ``` -------------------------------- ### Install ModelsLab SDK Source: https://docs.modelslab.com/sdk/typescript Commands to install the SDK using npm or yarn. ```bash npm install modelslab ``` ```bash yarn add modelslab ``` -------------------------------- ### Quick Start Image Generation Source: https://docs.modelslab.com/sdk/typescript Basic example for generating an image using the Community API. ```javascript import { Client, Community } from "modelslab"; const client = new Client("your-api-key"); const community = new Community(client.key); const result = await community.textToImage({ key: client.key, prompt: "A beautiful sunset over mountains, photorealistic, 8k", model_id: "flux", width: 512, height: 512, samples: 1, num_inference_steps: 30, guidance_scale: 7.5 }); if (result.status === "success") { console.log("Generated image:", result.output[0]); } else if (result.status === "processing") { console.log("Processing, request ID:", result.id); } ``` -------------------------------- ### ModelsLab CLI Examples Source: https://docs.modelslab.com/guides/model-selection Command-line interface examples for various ModelsLab operations, including image generation, chat interactions, video generation, and configuration settings. ```bash # Generate image with specific model modelslab generate image --prompt "sunset over mountains" --model flux # Chat with an LLM modelslab generate chat --message "Explain AI" --model meta-llama-3-8B-instruct # Generate video modelslab generate video --prompt "ocean waves" --model seedance-t2v # Set a default model modelslab config set generation.default_model flux ``` -------------------------------- ### Install ModelQ via Package Managers Source: https://docs.modelslab.com/open-source/modelq/installation Use these commands to install the ModelQ library in your Python environment. ```bash pip install modelq ``` ```bash pip install git+https://github.com/ModelsLab/modelq.git ``` -------------------------------- ### Install ModelsLab Skills Source: https://docs.modelslab.com/agent-skills Command to install all available ModelsLab skills via npx. ```bash npx skills add modelslab/skills --all ``` -------------------------------- ### Get ModelQ CLI Version Source: https://docs.modelslab.com/open-source/modelq/usage Prints the currently installed version of the ModelQ command-line interface. ```bash modelq version ``` -------------------------------- ### Update Server Request Example (Java) Source: https://docs.modelslab.com/enterprise-api/image-to-video-ultra/update-server A Java example using OkHttp to send a POST request for updating your dedicated server. Remember to insert your enterprise API key. ```java OkHttpClient client = new OkHttpClient().newBuilder() .build(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\n \"key\": \"\"\n}"); Request request = new Request.Builder() .url("https://modelslab.com/api/v1/enterprise/image_to_video_ultra/update_server") .method("POST", body) .addHeader("Content-Type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### Wallet Balance Response Example Source: https://docs.modelslab.com/agents-api/billing-and-wallet Example JSON response for a wallet balance check, including the current balance and currency. ```json { "data": { "balance": 75.50, "currency": "USD" }, "error": null, "meta": { "request_id": "..." } } ``` -------------------------------- ### Install ModelsLab Python SDK Source: https://docs.modelslab.com/sdk/python Use pip to install the package. Requires Python 3.7 or higher. ```bash pip install modelslab_py ``` -------------------------------- ### System Details API Response Example Source: https://docs.modelslab.com/enterprise-api/image-to-video-ultra/system-details Example response from the system_details endpoint, indicating no images are currently queued for processing. ```json { "model_count": 0, "queue_time": 0, "status": "ok" } ``` -------------------------------- ### ControlNet Normal API Example (SD 1.5) Source: https://docs.modelslab.com/image-generation/controlnet/controlnet-main Example for using the ControlNet Normal model. This requires an init_image and your API key. It's useful for controlling surface details and lighting. ```json { "key": "your_api_key", "controlnet_model": "normal", "controlnet_type": "normal", "model_id": "realistic-vision-51", "auto_hint": "yes", "guess_mode": "no", "prompt": "a woman, posing", "negative_prompt": null, "init_image": "https://images-ext-1.discordapp.net/external/ZOjUvfZxcvlnt84xav_fDdIzXPuuMXcW9fA46OaZSTs/https/i.pinimg.com/736x/9d/09/ff/9d09ff904e082395f71aa12f5c83ea77.jpg", "mask_image": null, "width": "512", "height": "512", "samples": "1", "scheduler": "UniPCMultistepScheduler", "num_inference_steps": "30", "safety_checker": "no", "enhance_prompt": "yes", "guidance_scale": 7.5, "strength": 0.55, "seed": null, "webhook": null } ``` -------------------------------- ### Restart Server Implementation Examples Source: https://docs.modelslab.com/enterprise-api/image-to-video-ultra/restart-server Language-specific implementations for the restart server endpoint. ```javascript var myHeaders = new Headers();myHeaders.append("Content-Type", "application/json");var raw = JSON.stringify({ "key": ""});var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow'};fetch("https://modelslab.com/api/v1/enterprise/image_to_video_ultra/restart_server", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error)); ``` ```php ""];$curl = curl_init();curl_setopt_array($curl, array( CURLOPT_URL => 'https://modelslab.com/api/v1/enterprise/image_to_video_ultra/restart_server', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode($payload), CURLOPT_HTTPHEADER => array( 'Content-Type: application/json' ),));$response = curl_exec($curl);curl_close($curl);echo $response; ``` ```javascript var request = require('request');var options = { 'method': 'POST', 'url': 'https://modelslab.com/api/v1/enterprise/image_to_video_ultra/restart_server', 'headers': { 'Content-Type': 'application/json' }, body: JSON.stringify({ "key": "" })};request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body);}); ``` ```python import requestsimport jsonurl = "https://modelslab.com/api/v1/enterprise/image_to_video_ultra/restart_server"payload = json.dumps({ "key": ""})headers = { 'Content-Type': 'application/json'}response = requests.request("POST", url, headers=headers, data=payload)print(response.text) ``` ```java OkHttpClient client = new OkHttpClient().newBuilder() .build();MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{\n \"key\": \"\"\n}");Request request = new Request.Builder() .url("https://modelslab.com/api/v1/enterprise/image_to_video_ultra/restart_server") .method("POST", body) .addHeader("Content-Type", "application/json") .build();Response response = client.newCall(request).execute(); ``` -------------------------------- ### Example Good Captions for Song Generation Source: https://docs.modelslab.com/guides/song-generation-guide These examples demonstrate how to combine style, emotion, instruments, and other dimensions to create detailed and effective captions for song generation. ```text A modern reggaeton track with strong flamenco influence, featuring female vocal with reverb, deep sub-bass, crisp percussion, and plucked synth guitar riff ``` ```text Lo-fi hip-hop beat with warm vinyl crackle, mellow piano chords, subtle jazz drums, and atmospheric pad textures ``` ```text 80s synthwave pop with bright synth leads, punchy drum machine, nostalgic atmosphere, and powerful female vocals ``` -------------------------------- ### Initialize Community API Source: https://docs.modelslab.com/sdk/python Setup the client for accessing community fine-tuned models. ```python from modelslab_py.core.client import Client from modelslab_py.core.apis.community import Community from modelslab_py.schemas.community import Text2Image, Image2Image, Inpainting, ControlNet client = Client(api_key="your_api_key") api = Community(client=client, enterprise=False) ``` -------------------------------- ### ControlNet Depth API Example (SD 1.5) Source: https://docs.modelslab.com/image-generation/controlnet/controlnet-main This example demonstrates using the ControlNet Depth model for image generation. Provide your API key and an init_image for depth-based control. ```json { "key": "your_api_key", "controlnet_model": "depth", "controlnet_type": "depth", "model_id": "realistic-vision-51", "auto_hint": "yes", "guess_mode": "no", "prompt": "baby, smiling", "negative_prompt": null, "init_image": "https://img.freepik.com/free-photo/adorable-baby-boy-smiling-camera-blurred-background_132075-10819.jpg", "mask_image": null, "width": "512", "height": "512", "samples": "1", "scheduler": "UniPCMultistepScheduler", "num_inference_steps": "30", "safety_checker": "no", "enhance_prompt": "yes", "guidance_scale": 7.5, "strength": 0.55, "seed": null, "webhook": null, "track_id": null } ``` -------------------------------- ### Install ModelsLab PHP SDK Source: https://docs.modelslab.com/sdk/php Methods to add the SDK to your project via Composer. ```bash composer require modelslab/php ``` ```json { "require": { "modelslab/php": "^1.0.2" } } ``` -------------------------------- ### ControlNet Canny API Example (SD 1.5) Source: https://docs.modelslab.com/image-generation/controlnet/controlnet-main Use this example to generate images with ControlNet using the Canny edge detection model. Ensure you have a valid API key and provide an init_image. ```json { "key": "your_api_key", "controlnet_model": "canny", "controlnet_type": "canny", "model_id": "realistic-vision-51", "auto_hint": "yes", "guess_mode": "no", "prompt": "a girl, wearing red bikini, looking at camera, ocean in background", "negative_prompt": "human, unstructure, (black object, white object), colorful background, nsfw", "init_image": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/qyA2waUVja192VOgQ3WwIRuKxJzRpA-metaZDc3NTFmOGE3NjgxYzA4MGQ1Yjg3NjA2ZjFlYzU1YTMuanBn-.jpg", "mask_image": null, "width": "512", "height": "512", "samples": "1", "scheduler": "UniPCMultistepScheduler", "num_inference_steps": "30", "safety_checker": "no", "enhance_prompt": "yes", "guidance_scale": 7.5, "strength": 0.55, "seed": null, "webhook": null, "track_id": null } ``` -------------------------------- ### Initialize Video API Client Source: https://docs.modelslab.com/sdk/python Sets up the client and API instance for video generation operations. Requires an API key. ```python from modelslab_py.core.client import Client from modelslab_py.core.apis.video import Video client = Client(api_key="your_api_key") api = Video(client=client, enterprise=False) ``` -------------------------------- ### Initialize API Instances Source: https://docs.modelslab.com/sdk/typescript Create instances for different API services using the client key. ```javascript import { Community, Audio, Video, ImageEditing } from "modelslab"; // Create instances with your API key const community = new Community(client.key); const audio = new Audio(client.key); const video = new Video(client.key); const imageEditing = new ImageEditing(client.key); ``` -------------------------------- ### Workflow Request Body Example Source: https://docs.modelslab.com/workflows-api/run-workflow Provide workflow parameters in the request body. Use the Get Workflow Schema endpoint to discover available parameters for your specific workflow. ```json { "prompt": "A beautiful sunset over mountains", "negative_prompt": "blurry, low quality", "width": 1024, "height": 1024 } ``` -------------------------------- ### Create Stripe SetupIntent Source: https://docs.modelslab.com/agents-api/billing-and-wallet Creates a Stripe SetupIntent for headless card tokenization, allowing for secure saving of payment methods. ```APIDOC ## POST /api/agents/v1/billing/setup-intent ### Description Initiates a Stripe SetupIntent, which is used to securely collect and save a customer's payment details for future use. This is part of the headless card tokenization flow. ### Method POST ### Endpoint /api/agents/v1/billing/setup-intent ### Auth Bearer token ### Response #### Success Response (200) - **client_secret** (string) - The client secret for the SetupIntent, used to confirm the setup on the client side. #### Response Example { "client_secret": "seti_1JfPKxSDo1BGXG2x..._secret_... } ``` -------------------------------- ### Initialize Basic Go Client Source: https://docs.modelslab.com/sdk/golang Create a new ModelsLab client instance using only your API key. ```go import "github.com/modelslab/modelslab-go/pkg/client" // Simple client c := client.New("your-api-key") ``` -------------------------------- ### Configure Client Source: https://docs.modelslab.com/sdk/typescript Methods for initializing the client with API keys and custom settings. ```javascript import { Client } from "modelslab"; // Method 1: Direct API key const client = new Client("your-api-key"); // Method 2: Environment variable // Reads from process.env.API_KEY when called without args const clientFromEnv = new Client(); // Method 3: With custom settings // new Client(apiKey, retries, timeoutSeconds) const clientCustom = new Client("your-api-key", 5, 10); ``` -------------------------------- ### Get Uploaded Voices Source: https://docs.modelslab.com/voice-cloning/voice-list Allows you to get a list of all uploaded voices associated with your account. ```APIDOC ## POST /voice/voice_list ### Description Retrieves all uploaded voices for the account. ### Method POST ### Endpoint /api/v6/voice/voice_list ### Parameters #### Request Body - **key** (string) - Required - Your API Key used for request authorization - **type** (string) - Optional - Type of voices to retrieve. Allowed values: "manual", "trained", "voice_cover". Defaults to "manual". ### Request Example ```json { "key": "YOUR_API_KEY", "type": "trained" } ``` ### Response #### Success Response (200) - **status** (string) - Status of the request. Enum: "success", "error". - **voices** (array) - Array of available voices. Each voice object contains: - **voice_id** (string) - Unique identifier for the voice. - **name** (string) - Display name of the voice. - **language** (string) - Language of the voice. #### Response Example ```json { "status": "success", "voices": [ { "voice_id": "123e4567-e89b-12d3-a456-426614174000", "name": "Example Voice", "language": "en-US" } ] } ``` #### Error Response (400) - **status** (string) - Status of the request. Must be "error". - **message** (string) - Error message description. #### Error Response Example ```json { "status": "error", "message": "Invalid API Key" } ``` ``` -------------------------------- ### Initialize Video API Client Source: https://docs.modelslab.com/sdk/dart Instantiate the client with your API key and then create a Video API instance. ```dart import 'package:modelslab/core/apis/video.dart'; import 'package:modelslab/core/apis/base.dart'; import 'package:modelslab/schemas/video.dart'; import 'package:modelslab/core/client.dart'; var client = Client(key: "Your api key"); var api = Video(client: client); ``` -------------------------------- ### Payment link response example Source: https://docs.modelslab.com/agents-api/billing-and-wallet Example JSON response returned when creating a payment link. ```json { "payment_url": "https://checkout.stripe.com/c/pay/cs_live_...", "session_id": "cs_live_...", "purpose": "fund", "amount": 25, "expires_at": "2026-02-20T12:30:00Z", "instructions": "Forward this URL to the user. They will complete payment on Stripe's hosted checkout page. After payment, they are redirected to ModelsLab's success page where the session_id is displayed for copy-to-clipboard. Use the session_id to confirm the payment via POST /wallet/confirm-checkout or POST /subscriptions/confirm-checkout." } ``` -------------------------------- ### Serve ModelQ API via CLI Source: https://docs.modelslab.com/open-source/modelq/usage Starts a FastAPI server to enable task submission to ModelQ over HTTP. Configure host, port, and log level as needed. ```bash modelq serve-api --app-path main:modelq_app --host 0.0.0.0 --port 8000 --log-level info ``` -------------------------------- ### Manage ModelsLab Skills via CLI Source: https://docs.modelslab.com/agent-skills Use these commands to install all skills, specific skills, or list available options. ```bash # Install all ModelsLab skills npx skills add modelslab/skills --all # Install a specific skill npx skills add modelslab/skills --skill modelslab-image-generation # List available skills npx skills add modelslab/skills --list ``` -------------------------------- ### Chat Completion API (Python Example) Source: https://docs.modelslab.com/guides/model-selection Example of how to use the Chat Completion API with Python requests. ```Python import requests response = requests.post( "https://modelslab.com/api/v7/llm/chat/completions", json={ "key": "your_api_key", "model_id": "meta-llama-3-8B-instruct", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Explain quantum computing briefly."} ], "max_tokens": 200, "temperature": 0.7 } ) data = response.json() print(data["choices"][0]["message"]["content"]) ``` -------------------------------- ### Initialize Go Client with Custom Configuration Source: https://docs.modelslab.com/sdk/golang Configure the ModelsLab client with custom settings including API key, base URL, and timeouts. ```go import ( "time" "github.com/modelslab/modelslab-go/pkg/client" ) config := &client.Config{ APIKey: "your-api-key", BaseURL: "https://modelslab.com/api/", FetchRetry: 10, FetchTimeout: 2 * time.Second, HTTPTimeout: 30 * time.Second, } c := client.NewWithConfig(config) ``` -------------------------------- ### Install Skills to Specific Agents Source: https://docs.modelslab.com/agent-skills Target specific MCP-compatible agents like Claude Code or Cursor during the installation process. ```bash npx skills add modelslab/skills --all -a claude-code -a cursor ``` -------------------------------- ### POST /text-to-video-ultra/system_details Source: https://docs.modelslab.com/enterprise-api/text-to-video-ultra/system-details Retrieve system details by sending a POST request with your API key. ```APIDOC ## POST /text-to-video-ultra/system_details ### Description This endpoint returns information about your server. ### Method POST ### Endpoint https://modelslab.com/api/v1/enterprise/text-to-video-ultra/system_details ### Request Body - **key** (string) - Required - Your API key ### Request Example ```json { "key": "enterprise_api_key" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation (e.g., "success"). - **message** (string) - A message describing the outcome of the operation. #### Error Response (401) - **status** (string) - Indicates the status of the error (e.g., "error"). - **message** (string) - A message describing the error (e.g., "Invalid API Key"). #### Response Example ```json { "status": "success", "message": "Operation completed successfully" } ``` ``` -------------------------------- ### Update Server Response Example Source: https://docs.modelslab.com/enterprise-api/image-to-video-ultra/update-server This is an example of a successful response when updating your dedicated server. It indicates the server is being updated and the operation was successful. ```json { "message": "server updating", "status": "success" } ``` -------------------------------- ### Magic Mix API Request Example Source: https://docs.modelslab.com/enterprise-api/image-editing/magic-mix This is an example of a cURL request to the Magic Mix endpoint. Ensure your API key is included for authorization. ```curl curl --request POST 'https://modelslab.com/api/v1/enterprise/image_editing/magic_mix' \ ``` -------------------------------- ### Wallet Transactions Response Example Source: https://docs.modelslab.com/agents-api/billing-and-wallet Example JSON response structure for wallet transactions, showing item details, counts, and wallet summary. ```json { "data": { "items": [ { "id": 456, "source": "stripe", "transaction_id": "pi_xxx", "type": "credit", "amount": 25.00, "status": "success", "usecase": "wallet_funding", "created_at": "2026-02-15T10:00:00Z" } ], "count": 1, "total": 12, "wallet": { "balance": 75.50, "currency": "USD", "total_credited": 150.00, "amount_used": 74.50 } }, "error": null, "meta": { "request_id": "..." } } ``` -------------------------------- ### Fetch System Details using Java Source: https://docs.modelslab.com/enterprise-api/image-to-video-ultra/system-details Implement the system_details request in Java using OkHttpClient. The request body must be created with MediaType set to application/json. ```java OkHttpClient client = new OkHttpClient().newBuilder() .build(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\n \"key\": \"\"\n}"); Request request = new Request.Builder() .url("https://modelslab.com/api/v1/enterprise/image_to_video_ultra/system_details") .method("POST", body) .addHeader("Content-Type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### ControlNet for Guided Image Generation Source: https://docs.modelslab.com/sdk/python Generate images guided by a control image and a specified ControlNet model (e.g., Canny, depth, pose). ```python schema = ControlNet( model_id="flux", controlnet_model="canny", # canny, depth, pose, etc. controlnet_image="https://example.com/control-image.jpg", prompt="A beautiful house, photorealistic", width=512, height=512 ) response = api.controlnet(schema) ``` -------------------------------- ### Text-to-Video Generation with Go Source: https://docs.modelslab.com/sdk/golang Create a video from a text prompt using the specified model. Ensure the client is initialized with your API key. ```go package main import ( "context" "encoding/json" "fmt" "github.com/modelslab/modelslab-go/pkg/apis/video" "github.com/modelslab/modelslab-go/pkg/client" videoSchema "github.com/modelslab/modelslab-go/pkg/schemas/video" ) func main() { c := client.New("your-api-key") videoAPI := video.New(c, false) req := videoSchema.Text2VideoRequest{ Prompt: "A cat playing with a ball in a sunny garden", ModelID: "cogvideox", } resp, err := videoAPI.TextToVideo(context.Background(), &req) if err != nil { panic(err) } prettyJSON, _ := json.MarshalIndent(resp, "", " ") fmt.Println(string(prettyJSON)) } ``` -------------------------------- ### Subscription plans response structure Source: https://docs.modelslab.com/agents-api/subscriptions Example JSON response showing the structure of subscription plans and pay-as-you-go configuration. ```json { "data": { "subscription_plans": [ { "id": 10, "name": "Basic Enterprise", "category": "enterprise", "period": "monthly", "type": "basic", "price": 249.0, "api_call_limit": 0, "rate_limit": 0, "features": ["Unlimited Images", "No Rate Limiter", "..."] } ], "pay_as_you_go": { "available": true, "description": "Pay only for what you use with wallet-based billing. No subscription required.", "minimum_topup_usd": 10.00, "currency": "USD", "auto_payments": { "supported": true, "description": "Automatically top up your wallet when balance drops below a threshold.", "configure_endpoint": "PUT /api/agents/v1/wallet/auto-funding", "disable_endpoint": "DELETE /api/agents/v1/wallet/auto-funding" }, "fund_endpoint": "POST /api/agents/v1/wallet/fund" }, "count": 37 } } ``` -------------------------------- ### Update Server Request Example (Node.js) Source: https://docs.modelslab.com/enterprise-api/image-to-video-ultra/update-server A Node.js example for updating your dedicated server. This snippet uses the 'request' library and requires your enterprise API key. ```javascript var request = require('request'); var options = { 'method': 'POST', 'url': 'https://modelslab.com/api/v1/enterprise/image_to_video_ultra/update_server', 'headers': { 'Content-Type': 'application/json' }, body: JSON.stringify({ "key": "" }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); ``` -------------------------------- ### Configure ModelsLab Client Source: https://docs.modelslab.com/sdk/php Methods for initializing the client with direct keys or custom options, and using environment variables. ```php 'https://modelslab.com/api/', 'fetch_retry' => 10, 'fetch_timeout' => 2 ]); ``` ```bash export MODELSLAB_API_KEY="your-actual-api-key" # Or export API_KEY="your-actual-api-key" ``` ```php $modelslab = new ModelsLab(getenv('MODELSLAB_API_KEY')); ``` -------------------------------- ### Payment Status Response Example Source: https://docs.modelslab.com/agents-api/billing-and-wallet This is an example of the JSON response you might receive when checking a PaymentIntent's status. The `status` field can be `succeeded`, `pending`, or `failed`. ```json { "data": { "status": "succeeded", "payment_intent_id": "pi_xxx", "amount": 25.00, "currency": "usd" }, "error": null, "meta": { "request_id": "..." } } ``` -------------------------------- ### Run Go Application Source: https://docs.modelslab.com/sdk/golang Execute your Go program from the command line. ```bash go run main.go ``` -------------------------------- ### Initialize Image Editing API Client Source: https://docs.modelslab.com/sdk/python Sets up the client and API instance for image editing operations. Requires an API key. ```python from modelslab_py.core.client import Client from modelslab_py.core.apis.image_editing import Image_editing client = Client(api_key="your_api_key") api = Image_editing(client=client, enterprise=False) ``` -------------------------------- ### POST /qwen/system_details Source: https://docs.modelslab.com/enterprise-api/qwen/system-details This endpoint returns information about your server. It requires an enterprise API key in the request body. ```APIDOC ## POST /qwen/system_details ### Description This endpoint returns information about your server. ### Method POST ### Endpoint https://modelslab.com/api/v1/enterprise/qwen/system_details ### Request Body - **key** (string) - Required - Your API key ### Request Example { "key": "enterprise_api_key" } ### Response #### Success Response (200) - **status** (string) - Example: success - **message** (string) - Example: Operation completed successfully #### Error Response (401) - **status** (string) - Example: error - **message** (string) - Example: Error message #### Response Example { "status": "success", "message": "Operation completed successfully" } ``` -------------------------------- ### Webhook Example for Training Status Updates Source: https://docs.modelslab.com/image-generation/train-model/lora-finetune This JSON payload is an example of a webhook notification you might receive, indicating the status of your model training. It includes status, logs, and the model ID. ```json { "status": "success", "training_status": "deploying_gpu", "logs": "it will take upto 25 minutes", "model_id": "F5jvdzGnYi" } ``` -------------------------------- ### ControlNet MLSD API Example (SD 1.5) Source: https://docs.modelslab.com/image-generation/controlnet/controlnet-main This example shows how to use the ControlNet MLSD (Mobile Line Segment Detection) model. Provide an init_image and your API key for architectural or line-based generation. ```json { "key": "your_api_key", "controlnet_model": "mlsd", "controlnet_type": "mlsd", "model_id": "realistic-vision-51", "auto_hint": "yes", "guess_mode": "no", "prompt": "ROOM INTERIOR, OLD SCHOOL, VINTAGE", "negative_prompt": null, "init_image": "https://images-ext-1.discordapp.net/external/f_MuFioFIYcAuhbGrCXkiDfRJq1nZd-L0z_DibDpMc0/https/i.pinimg.com/736x/8a/2b/1e/8a2b1e6ca4779d787ae3c98b7b1100b2.jpg", "mask_image": null, "width": "512", "height": "512", "samples": "1", "scheduler": "UniPCMultistepScheduler", "num_inference_steps": "30", "safety_checker": "no", "enhance_prompt": "yes", "guidance_scale": 7.5, "strength": 0.55, "seed": null, "webhook": null, "track_id": null } ``` -------------------------------- ### POST /enterprise/video/system_details Source: https://docs.modelslab.com/enterprise-api/video/system-details Retrieves information about the server using an enterprise API key. ```APIDOC ## POST /enterprise/video/system_details ### Description This endpoint returns information about your server. ### Method POST ### Endpoint https://modelslab.com/api/v1/enterprise/video/system_details ### Request Body - **key** (string) - Required - Your API key ### Request Example { "key": "enterprise_api_key" } ### Response #### Success Response (200) - **status** (string) - Status of the operation - **message** (string) - Description of the result #### Response Example { "status": "success", "message": "Operation completed successfully" } #### Error Response (401) - **status** (string) - Status of the error - **message** (string) - Error message ``` -------------------------------- ### GET /api/agents/v1/wallet/coupons/validate Source: https://docs.modelslab.com/agents-api/billing-and-wallet Validates a coupon code before attempting to redeem it. ```APIDOC ## GET /api/agents/v1/wallet/coupons/validate ### Description Validate a coupon before redeeming. ### Method GET ### Endpoint /api/agents/v1/wallet/coupons/validate ### Parameters #### Query Parameters - **coupon_code** (string) - Required - The coupon code to validate ``` -------------------------------- ### GET /fetch-video Source: https://docs.modelslab.com/mcp-web-api/tools-reference Retrieves the status and results of a video generation request. ```APIDOC ## GET /fetch-video ### Description Retrieve the status and results of a video generation request. ### Method GET ### Endpoint /fetch-video ### Parameters #### Query Parameters - **id** (string) - Required - Request ID from a previous video generation call ``` -------------------------------- ### File Input Options in Go Source: https://docs.modelslab.com/sdk/golang Demonstrates how to provide file inputs using URLs, Base64 encoded data, or local file paths with the Modelslab Go SDK. ```go import "github.com/modelslab/modelslab-go/pkg/schemas/base" // URL input imageURL := "https://example.com/image.jpg" fileInput := base.FileInput{ URL: &imageURL, } ``` ```go base64Data := "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ..." fileInput := base.FileInput{ Base64: &base64Data, } ``` ```go // File path (for local files) filePath := "/path/to/image.jpg" fileInput := base.FileInput{ FilePath: &filePath, } ``` -------------------------------- ### GET /fetch-image Source: https://docs.modelslab.com/mcp-web-api/tools-reference Retrieve the status and results of an image generation request. ```APIDOC ## GET /fetch-image ### Description Retrieve the status and results of an image generation request. ### Method GET ### Endpoint /fetch-image ### Parameters #### Query Parameters - **id** (integer) - Required - Request ID from a previous generation call ``` -------------------------------- ### System Details Source: https://docs.modelslab.com/enterprise-api/image-to-video-ultra/overview Get information about the current status of your dedicated server. ```APIDOC ## GET /enterprise-api/image-to-video-ultra/system-details ### Description Get information about your server status. ### Method GET ### Endpoint /enterprise-api/image-to-video-ultra/system-details ``` -------------------------------- ### GET /enterprise-api/flux-headshot/fetch Source: https://docs.modelslab.com/enterprise-api/flux-headshot/overview Fetches the status of queued or currently processing requests. ```APIDOC ## GET /enterprise-api/flux-headshot/fetch ### Description This endpoint fetches queued or processing requests. ### Method GET ### Endpoint /enterprise-api/flux-headshot/fetch ```