### Initialize Hermes Setup Wizard Source: https://docs.gmicloud.ai/agents/set-up-hermes-agent-with-gmi-cloud Run this command in your terminal to start the interactive configuration process. ```text hermes setup ``` -------------------------------- ### Verify OpenCode Installation Source: https://docs.gmicloud.ai/coding-tools/opencode Check the installed version of OpenCode to ensure the setup was successful. ```bash opencode --version ``` -------------------------------- ### List Available Models Example Source: https://docs.gmicloud.ai/model-quickstarts/audio/minimax-tts-speech-2-6-turbo Example cURL request to list all available models. ```bash curl -X GET "https://api.example.com/api/v1/apikey/models" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Install OpenCode Source: https://docs.gmicloud.ai/coding-tools/opencode Execute this command in your terminal to install the OpenCode agent. ```bash curl -fsSL https://opencode.ai/install | bash ``` -------------------------------- ### Get Model Information Endpoint and Example Source: https://docs.gmicloud.ai/model-quickstarts/video/kling-image2video-v2-1-pro Fetch specific details for the Kling Image2Video V2.1 Pro model. ```text GET /api/v1/ie/requestqueue/apikey/models/Kling-Image2Video-V2.1-Pro ``` ```bash curl --location 'https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/models/Kling-Image2Video-V2.1-Pro' \ --header 'Authorization: Bearer YOUR_API_KEY' ``` -------------------------------- ### Install GMI Cloud SDK Source: https://docs.gmicloud.ai/inference-engine/api-reference/video-sdk-reference Use pip to install the required package in your environment. ```bash pip install gmicloud ``` -------------------------------- ### List Requests Endpoint and Example Source: https://docs.gmicloud.ai/model-quickstarts/video/kling-image2video-v2-1-pro Retrieve a list of requests for the Kling Image2Video V2.1 Pro model using a GET request. ```text GET /api/v1/ie/requestqueue/requests?model_id=Kling-Image2Video-V2.1-Pro ``` ```bash curl --location 'https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests?model_id=Kling-Image2Video-V2.1-Pro' \ --header 'Authorization: Bearer YOUR_API_KEY' ``` -------------------------------- ### Get Model Information Example Source: https://docs.gmicloud.ai/model-quickstarts/video/veo-3-1-generate-preview cURL command to fetch information for the Veo 3.1 Generate Preview model. ```bash curl -X GET "https://api.example.com/api/v1/apikey/models/veo-3.1-generate-preview" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Install Kilo Code CLI Source: https://docs.gmicloud.ai/coding-tools/kilo Install the Kilo Code CLI globally using npm. ```bash npm install -g @kilocode/cli ``` -------------------------------- ### List Requests Example Source: https://docs.gmicloud.ai/model-quickstarts/image/flux-kontext-pro Example cURL command to list all requests for the Flux Kontext Pro model. ```bash curl -X GET "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests?model_id=flux-kontext-pro" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Verify Kilo Installation Source: https://docs.gmicloud.ai/coding-tools/kilo Check the installed version of the Kilo CLI. ```bash kilo --version ``` -------------------------------- ### Install Hermes Agent Source: https://docs.gmicloud.ai/agents/set-up-hermes-agent-with-gmi-cloud Executes the one-line installer script to set up the Hermes Agent and its dependencies. ```bash curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash ``` -------------------------------- ### Install the GMI Cloud plugin Source: https://docs.gmicloud.ai/agents/openclaw Use the OpenClaw CLI to install the official GMI Cloud provider plugin. ```bash openclaw plugins install clawhub:openclaw-gmicloud-provider ``` -------------------------------- ### Install Droid CLI Source: https://docs.gmicloud.ai/coding-tools/factory Executes the installation script for the Droid CLI tool. ```bash curl -fsSL https://app.factory.ai/cli | sh ``` -------------------------------- ### API Key Name Example Source: https://docs.gmicloud.ai/api-reference/organizations/create-an-api-key Example value for the API key name field. ```text My Service API Key ``` -------------------------------- ### API Request Examples Source: https://docs.gmicloud.ai/model-quickstarts/text/qwen-qwen3-coder-480b-a35b-instruct-fp8 Examples of how to send a chat completion request to the model using Shell and Python. ```bash curl --request POST \ --url https://api.gmi-serving.com/v1/chat/completions \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer *************' \ --data '{ "model": "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8", "messages": [ {"role": "system", "content": "You are a helpful AI assistant"}, {"role": "user", "content": "List 3 countries and their capitals."} ], "temperature": 0, "max_tokens": 500 }' ``` ```python import requests import json url = "https://api.gmi-serving.com/v1/chat/completions" headers = { "Content-Type": "application/json", "Authorization": "Bearer *************" } payload = { "model": "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8", "messages": [ {"role": "system", "content": "You are a helpful AI assistant"}, {"role": "user", "content": "List 3 countries and their capitals."} ], "temperature": 0, "max_tokens": 500 } response = requests.post(url, headers=headers, json=payload) print(json.dumps(response.json(), indent=2)) ``` -------------------------------- ### Install Anthropic SDK Source: https://docs.gmicloud.ai/model-quickstarts/text/anthropic-claude-sonnet-4 Install the required Python package to use the Anthropic SDK. ```bash pip install anthropic ``` -------------------------------- ### List Requests Example Source: https://docs.gmicloud.ai/model-quickstarts/audio/minimax-tts-speech-2-6-turbo Example cURL request to list requests for the Minimax TTS model. ```bash curl -X GET "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests?model_id=minimax-tts-speech-2.6-turbo" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### List Models Response Example Source: https://docs.gmicloud.ai/model-quickstarts/image/gemini-2-5-flash-image Example JSON response containing a list of available model IDs. ```json { "model_ids": [ "gemini-2.5-flash-image", "gemini-3-pro-image-preview", "other-model-1" ] } ``` -------------------------------- ### Launch Kilo in Project Source: https://docs.gmicloud.ai/coding-tools/kilo Navigate to the project directory and start the Kilo session. ```bash cd ~/your-project kilo ``` -------------------------------- ### Get Model Information Example Source: https://docs.gmicloud.ai/model-quickstarts/audio/minimax-tts-speech-2-6-turbo Example cURL request to fetch specific model information. ```bash curl -X GET "https://api.example.com/api/v1/apikey/models/minimax-tts-speech-2.6-turbo" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Verify Droid Installation Source: https://docs.gmicloud.ai/coding-tools/factory Checks the installed version of the Droid CLI to confirm successful setup. ```bash droid --version ``` -------------------------------- ### Client.__init__(email, password) Source: https://docs.gmicloud.ai/inference-engine/api-reference/video-sdk-reference Initializes the GMI Cloud client with user credentials. ```APIDOC ## Client.__init__(email, password) ### Description Initializes the GMI Cloud client instance. ### Parameters - **email** (str) - Optional - Your GMI Cloud email. - **password** (str) - Optional - Your GMI Cloud password. ``` -------------------------------- ### Verify Hermes Installation Source: https://docs.gmicloud.ai/agents/set-up-hermes-agent-with-gmi-cloud Checks the installed version of the Hermes Agent to confirm successful setup. ```bash hermes --version ``` -------------------------------- ### Get Organization DB Error Example Source: https://docs.gmicloud.ai/api-reference/invitations/accept-invitation-by-key Example of an error response when a database error occurs during an organization retrieval request. ```yaml group: organization code: 1201 message: Get organization encountered DB error. traces: - DB error occurred. ``` -------------------------------- ### Launch OpenCode in a Project Source: https://docs.gmicloud.ai/coding-tools/opencode Navigate to your project directory and start the OpenCode terminal interface. ```bash cd your-project opencode ``` -------------------------------- ### Get user password reset data error example Source: https://docs.gmicloud.ai/api-reference/me/update-user-password Example JSON response for an error encountered during password reset data retrieval. ```json group: user code: 201 message: Get user password reset data encountered error. traces: - error occurred. ``` -------------------------------- ### Get Model Information Request Source: https://docs.gmicloud.ai/model-quickstarts/video/kling-text2video-v2-1-master Example cURL command to fetch information for the Kling-Text2Video-V2.1-Master model. ```bash curl --location 'https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/models/Kling-Text2Video-V2.1-Master' \ --header 'Authorization: Bearer YOUR_API_KEY' ``` -------------------------------- ### Perform Function Calling with GPT-5.5 Source: https://docs.gmicloud.ai/model-quickstarts/text/openai-gpt-5-5 Examples demonstrating how to define tools and perform function calling with the GPT-5.5 model. ```bash curl https://api.gmi-serving.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $GMI_API_KEY" \ -d '{ "model": "openai/gpt-5.5", "messages": [ { "role": "user", "content": "What is the weather like in Boston today?" } ], "tools": [ { "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": ["celsius", "fahrenheit"] } }, "required": ["location"] } } } ], "tool_choice": "auto" }' ``` ```python from openai import OpenAI endpoint = "https://api.gmi-serving.com/v1/" model_name = "openai/gpt-5.5" api_key = "" client = OpenAI( base_url=f"{endpoint}", api_key=api_key ) tools = [ { "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA", }, "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}, }, "required": ["location"], }, } } ] messages = [{"role": "user", "content": "What's the weather like in Boston today?"}] completion = client.chat.completions.create( model=model_name, messages=messages, tools=tools, tool_choice="auto" ) print(completion) ``` -------------------------------- ### Get Model Information Request Source: https://docs.gmicloud.ai/model-quickstarts/image/flux-kontext-pro Example cURL request to fetch information for the flux-kontext-pro model. ```bash curl -X GET "https://api.example.com/api/v1/apikey/models/flux-kontext-pro" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Basic Python SDK usage Source: https://docs.gmicloud.ai/model-quickstarts/text/anthropic-claude-opus-4-7 Initialize the client with a custom base URL and generate a simple message. ```python from anthropic import Anthropic # Initialize client with custom base URL client = Anthropic( api_key="$GMI_API_KEY", base_url="https://api.gmi-serving.com" ) # Basic message message = client.messages.create( model="anthropic/claude-opus-4.7", max_tokens=100, messages=[ {"role": "user", "content": "What is 2+2? Reply with just the number."} ] ) print(message.content[0].text) print(f"Usage: input={message.usage.input_tokens}, output={message.usage.output_tokens}") ``` -------------------------------- ### Perform Function Calling with XiaomiMiMo MiMo-V2.5-Pro Source: https://docs.gmicloud.ai/model-quickstarts/text/xiaomimimo-mimo-v2-5-pro Examples demonstrating how to define tools and perform function calling using the GMI API. ```bash curl https://api.gmi-serving.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $GMI_API_KEY" \ -d '{ "model": "XiaomiMiMo/MiMo-V2.5-Pro", "messages": [ { "role": "user", "content": "What is the weather like in Boston today?" } ], "tools": [ { "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": ["celsius", "fahrenheit"] } }, "required": ["location"] } } } ], "tool_choice": "auto" }' ``` ```python from openai import OpenAI endpoint = "https://api.gmi-serving.com/v1/" model_name = "XiaomiMiMo/MiMo-V2.5-Pro" api_key = "" client = OpenAI( base_url=f"{endpoint}", api_key=api_key ) tools = [ { "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA", }, "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}, }, "required": ["location"], }, } } ] messages = [{"role": "user", "content": "What's the weather like in Boston today?"}] completion = client.chat.completions.create( model=model_name, messages=messages, tools=tools, tool_choice="auto" ) print(completion) ``` -------------------------------- ### Configure Migration Tools Source: https://docs.gmicloud.ai/migration/s3-to-vast-migration Initialize the configuration for AWS CLI and rclone to authenticate with your source and destination storage providers. ```bash aws configure rclone config ``` -------------------------------- ### Get Model Information Example Source: https://docs.gmicloud.ai/model-quickstarts/video/kling-image2video-v2-1-standard cURL command to fetch model information for the Kling Image2Video V2.1 Standard model. ```bash curl --location 'https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/models/Kling-Image2Video-V2.1-Standard' \ --header 'Authorization: Bearer YOUR_API_KEY' ``` -------------------------------- ### Initialize Client with Direct Credentials Source: https://docs.gmicloud.ai/inference-engine/api-reference/video-sdk-reference Pass credentials directly to the Client constructor if not using environment variables. ```python from gmicloud import Client client = Client( email="", password="" ) ``` -------------------------------- ### CURL Request for Video Generation Source: https://docs.gmicloud.ai/model-quickstarts/video/kling-v3-image-to-video Example of a POST request to initiate video generation using start and end frame guidance with audio enabled. ```bash curl -X POST "[https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests](https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests)" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kling-v3-image-to-video", "payload": { "image": "[https://example.com/start_frame.jpg](https://example.com/start_frame.jpg)", "image_tail": "[https://example.com/end_frame.jpg](https://example.com/end_frame.jpg)", "prompt": "A cinematic shot of a dragon taking flight from a cliffside.", "duration": "5", "sound": "on" } }' ``` -------------------------------- ### Not Found Response Example Source: https://docs.gmicloud.ai/api-reference/baremetals/update-baremetal-server Example of a 404 Not Found response body. ```yaml example: reason: resource 12345678-1234-2234-3234-xxxxxxxxxxxxxx was not found ``` -------------------------------- ### Launch Droid Source: https://docs.gmicloud.ai/coding-tools/factory Starts the Droid CLI to begin the onboarding and authentication process. ```bash droid ``` -------------------------------- ### Conflict Error Example Source: https://docs.gmicloud.ai/api-reference/containers/update-container Example response body for a 409 Conflict error. ```yaml reason: timestamp mismatched ``` -------------------------------- ### Enable web search Source: https://docs.gmicloud.ai/model-quickstarts/text/openai-gpt-5-2-chat Integrate web search capabilities by adding the web_search_preview tool. ```bash curl https://api.gmi-serving.com/v1/responses \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $GMI_API_KEY" \ -d '{ "model": "openai/gpt-5.2-chat", "tools": [{ "type": "web_search_preview" }], "input": "What was a positive news story from today?" }' ``` -------------------------------- ### API Key Scope Example Source: https://docs.gmicloud.ai/api-reference/organizations/create-an-api-key Example value for the API key scope field. ```text ie_model ``` -------------------------------- ### Basic Python SDK Usage Source: https://docs.gmicloud.ai/model-quickstarts/text/anthropic-claude-sonnet-4 Initialize the Anthropic client with a custom base URL to point to the GMI API. ```python from anthropic import Anthropic # Initialize client with custom base URL client = Anthropic( api_key="$GMI_API_KEY", base_url="https://api.gmi-serving.com" ) # Basic message message = client.messages.create( model="anthropic/claude-sonnet-4", max_tokens=100, messages=[ {"role": "user", "content": "What is 2+2? Reply with just the number."} ] ) print(message.content[0].text) print(f"Usage: input={message.usage.input_tokens}, output={message.usage.output_tokens}") ``` -------------------------------- ### Initialize the GMI Cloud Client Source: https://docs.gmicloud.ai/inference-engine/api-reference/video-sdk-reference Initializes the client using environment variables for authentication. ```python from gmicloud import Client # Initialize client (uses environment variables by default) client = Client() ``` -------------------------------- ### Error Status Message Schema Example Source: https://docs.gmicloud.ai/api-reference/me/create-an-ssh-key Example of a validation error response structure. ```json { "group": "request", "code": 0, "validationDetail": [ { "field": "email", "expression": "required", "originalValue": "", "reason": "This field is required." } ] } ``` -------------------------------- ### Service Unavailable Response Example Source: https://docs.gmicloud.ai/api-reference/baremetals/update-baremetal-server Example of a 503 Service Unavailable response body. ```yaml example: reason: database is unavailable ``` -------------------------------- ### Create Auth Token Request Schema Example Source: https://docs.gmicloud.ai/api-reference/me/create-an-auth-token Example values for the email and password fields required to request an authentication token. ```json email: john_doe@example.com password: john_doe_password ``` -------------------------------- ### Image-to-Video Configuration Examples Source: https://docs.gmicloud.ai/model-quickstarts/video/wan-ai-wan2-1-i2v-14b-720p JSON payloads for different animation scenarios including landscape, portrait, artistic, product, and nature styles. ```json { "prompt": "A serene mountain lake with gentle ripples and flowing water motion", "path_to_image": "your_image_data_here", "video_length": 10, "prompt_extend": true, "seed": 12345 } ``` ```json { "prompt": "A person walking through a forest with flowing hair and natural movement", "path_to_image": "your_image_data_here", "video_length": 5, "prompt_extend": false, "seed": -1 } ``` ```json { "prompt": "A painting coming to life with flowing brushstrokes and dynamic colors", "path_to_image": "your_image_data_here", "video_length": 10, "prompt_extend": true, "seed": 42 } ``` ```json { "prompt": "A product rotating smoothly with subtle lighting changes and professional presentation", "path_to_image": "your_image_data_here", "video_length": 5, "prompt_extend": false, "seed": 789 } ``` ```json { "prompt": "Flowers blooming with gentle swaying motion and natural wind effects", "path_to_image": "your_image_data_here", "video_length": 10, "prompt_extend": true, "seed": -1 } ``` -------------------------------- ### Unauthorized Response Examples Source: https://docs.gmicloud.ai/api-reference/baremetals/update-baremetal-server Examples of 401 Unauthorized responses for expired or invalid tokens. ```yaml Expired access token.: summary: Expired access token. value: code: 1 group: auth_verify message: Expired access token. Invalid access token.: summary: Invalid access token. value: code: 0 group: auth_verify message: Invalid access token. ``` -------------------------------- ### Bad Request Response Example Source: https://docs.gmicloud.ai/api-reference/baremetals/update-baremetal-server Example of a 400 Bad Request response body. ```yaml example: reason: resources.CPU is a required property ``` -------------------------------- ### Submit Transition Request Source: https://docs.gmicloud.ai/model-quickstarts/video/pixverse-v6-transition Example cURL command to initiate a video transition request. ```bash curl -X POST "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "pixverse-v6-transition", "payload": { "prompt": "A cinematic transition from day to night over a city skyline.", "first_frame_img": "https://example.com/day_city.jpg", "last_frame_img": "https://example.com/night_city.jpg", "duration": 5, "quality": "1080p", "generate_audio_switch": true } }' ``` -------------------------------- ### List Requests Example Source: https://docs.gmicloud.ai/model-quickstarts/video/veo-3-1-generate-preview cURL command to list requests for the Veo 3.1 Generate Preview model using an API key. ```bash curl -X GET "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests?model_id=veo-3.1-generate-preview" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Submit Video Generation Requests Source: https://docs.gmicloud.ai/model-quickstarts/video/minimax-hailuo-02 Examples for generating videos using text prompts or image-to-video inputs. ```bash curl -X POST "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "Minimax-Hailuo-02", "payload": { "prompt": "A calm beach with seagulls flying across the sky [Pan Left]", "duration": 6, "resolution": "512P", "prompt_optimizer": true } }' ``` ```bash curl -X POST "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "Minimax-Hailuo-02", "payload": { "prompt": "Extend this scene into a mystical forest journey", "duration": 10, "resolution": "768P", "first_frame_image": "https://example.com/frame.jpg", "fast_pretreatment": true } }' ``` -------------------------------- ### Get Model Information Source: https://docs.gmicloud.ai/model-quickstarts/video/minimax-hailuo-02 Retrieve details for the Minimax-Hailuo-02 model using a GET request. ```bash curl -X GET "https://api.example.com/api/v1/apikey/models/Minimax-Hailuo-02" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Perform Function Calling with GPT-5 Source: https://docs.gmicloud.ai/model-quickstarts/text/openai-gpt-5 Demonstrates how to define tools and perform function calling using the OpenAI GPT-5 model. ```bash curl https://api.gmi-serving.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $GMI_API_KEY" \ -d '{ "model": "openai/gpt-5", "messages": [ { "role": "user", "content": "What is the weather like in Boston today?" } ], "tools": [ { "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": ["celsius", "fahrenheit"] } }, "required": ["location"] } } } ], "tool_choice": "auto" }' ``` ```python from openai import OpenAI endpoint = "https://api.gmi-serving.com/v1/" model_name = "openai/gpt-5" api_key = "" client = OpenAI( base_url=f"{endpoint}", api_key=api_key ) tools = [ { "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA", }, "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}, }, "required": ["location"], }, } } ] messages = [{"role": "user", "content": "What's the weather like in Boston today?"}] completion = client.chat.completions.create( model=model_name, messages=messages, tools=tools, tool_choice="auto" ) print(completion) ``` -------------------------------- ### Check Request Status Example Source: https://docs.gmicloud.ai/model-quickstarts/image/flux-kontext-pro Example cURL command to fetch the status of a request by its ID. ```bash curl -X GET "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests/550e8400-e29b-41d4-a716-446655440000" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Perform Function Calling with GPT-5.2 Source: https://docs.gmicloud.ai/model-quickstarts/text/openai-gpt-5-2 Demonstrates how to define tools and request function execution using the OpenAI API. ```bash curl https://api.gmi-serving.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $GMI_API_KEY" \ -d '{ "model": "openai/gpt-5.2", "messages": [ { "role": "user", "content": "What is the weather like in Boston today?" } ], "tools": [ { "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": ["celsius", "fahrenheit"] } }, "required": ["location"] } } } ], "tool_choice": "auto" }' ``` ```python from openai import OpenAI endpoint = "https://api.gmi-serving.com/v1/" model_name = "openai/gpt-5.2" api_key = "" client = OpenAI( base_url=f"{endpoint}", api_key=api_key ) tools = [ { "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA", }, "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}, }, "required": ["location"], }, } } ] messages = [{"role": "user", "content": "What's the weather like in Boston today?"}] completion = client.chat.completions.create( model=model_name, messages=messages, tools=tools, tool_choice="auto" ) print(completion) ``` -------------------------------- ### Example Coding Tasks Source: https://docs.gmicloud.ai/coding-tools/opencode Examples of natural language prompts to provide to OpenCode for code-related tasks. ```text Fix the broken tests in this project ``` ```text Explain what this codebase does ``` ```text Refactor this function to be more readable ``` -------------------------------- ### Generate Video with Reference Assets Source: https://docs.gmicloud.ai/model-quickstarts/video/seedance-2-0-fast-260128 Include reference asset IDs or image URLs to maintain style or character consistency. ```bash curl -X POST "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "seedance-2-0-fast-260128", "payload": { "prompt": "The character walks through a neon-lit alley", "reference_asset_ids": ["asset-id-abc123"], "reference_images": ["https://example.com/style-ref.jpg"], "duration": 10, "resolution": "720p", "ratio": "adaptive" } }' ```