Skip to content

MaaS image-1 API Documentation

Version History

Version Number Date Modifications
v0.1.0-beta 2025-08-15 Initial version

Request Protocol

Http

Generate Image:

Parameter Name Value
Authorization Bearer {YOUR AK}
Content-Type application/json

Request URL

https://genaiapi.cloudsway.net/v1/ai/{YOUR ENDPOINT}/google/chat/completions

Request Body:

Supported Parameters for Google Model Chat Completions API

Basic Parameters

Parameter Support Status Description
messages ✅ Supported Supports the following message types:
- System messages
- User messages (supports text and image_url types, image_url supports Cloud Storage URI or base64 encoding)
- Assistant messages
- Tool messages
- Function messages (deprecated but remains compatible)
model ✅ Supported Model name
max_tokens/max_completion_tokens ✅ Supported Maximum number of tokens in response
temperature ✅ Supported Sampling temperature
top_p ✅ Supported Nucleus sampling parameter
n ✅ Supported Number of generated results
stream ✅ Supported Streaming output
stop ✅ Supported Stop sequence
presence_penalty ✅ Supported Presence penalty
frequency_penalty ✅ Supported Frequency penalty
seed ✅ Supported Corresponds to Gemini's GenerationConfig.seed

Multimodal Input

Parameter Support Status Description
input_audio ✅ Supported Supports URI or blob format, all valid MIME types
image_url ✅ Supported Supports URI or blob format, detail parameter is unified across the request

Tools and Functions

Parameter Support Status Description
tools ✅ Supported Tool definitions
tool_choice ✅ Supported Options: none, auto, required (ANY mode), validated (VALIDATED mode)
functions ⚠️ Deprecated Remains compatible
function_call ⚠️ Deprecated Remains compatible

Gemini-specific Parameters

{
  "extra_body": {
    "google": {
      "safety_settings": "Safety settings",
      "cached_content": "Cached content",
      "thinking_config": "Thinking configuration"
    }
  },
  "extra_part": {
    "google": {
      "thought": "Explicitly mark thinking content"
    }
  }
}

Request Demo:

curl --location 'https://genaiapi.cloudsway.net/v1/ai/{YOUR ENDPOINT}/google/chat/completions' \
--header 'Authorization: Bearer {YOUR AK}' \
--header 'Content-Type: application/json' \
--data '{
    "temperature": 1,
    "model": "gemini-2.5-flash",
    "messages": [
        {
            "role": "user",
            "content": "hi"

        }
    ],
    "stream": false
}'