{
  "openapi": "3.1.0",
  "info": {
    "title": "Runware API - Qwen3.5-397B",
    "summary": "Large MoE reasoning model with ultra-long context and strong coding and agent performance",
    "description": "Qwen3.5-397B is a frontier Qwen large language model for reasoning, coding, search, and agent workflows. The underlying open-weight flagship uses a sparse MoE design with 397B total parameters and 17B activated parameters, supports 262K native context extensible to about 1M tokens, and is designed for high-throughput long-context inference.",
    "version": "1.0.0",
    "x-model-id": "alibaba-qwen3-5-397b",
    "x-air-id": "alibaba:qwen@3.5-397b",
    "x-status": "coming-soon",
    "x-creator": {
      "id": "alibaba",
      "name": "Alibaba",
      "logo": "https://assets.runware.ai/cd72ed4c-ef94-4962-a44b-cbe38b3bf6ea.png"
    },
    "x-capabilities": [
      "text-to-text",
      "image-to-text",
      "video-to-text"
    ],
    "x-released-at": "2026-02-16T00:00:00Z",
    "x-cover-image": "https://assets.runware.ai/c20f2bc6-542a-4216-ace4-73fbdadd60f9.jpeg"
  },
  "servers": [
    {
      "url": "https://api.runware.ai/v1",
      "description": "Runware REST API"
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Runware API Key (e.g., Bearer <your-key>)"
      }
    },
    "schemas": {
      "AuthenticationTask": {
        "title": "Authentication",
        "description": "Authenticates a connection using an API key. Can be sent as the first element of the request array as an alternative to using the Authorization header.",
        "type": "object",
        "x-response-schema": "https://schemas.runware.ai/responses/utilities/authentication.json",
        "properties": {
          "taskType": {
            "const": "authentication",
            "title": "Task Type",
            "description": "The type of task to perform."
          },
          "apiKey": {
            "title": "API Key",
            "description": "Your Runware API key.",
            "type": "string"
          },
          "connectionSessionUUID": {
            "title": "Connection Session UUID",
            "description": "Optional session UUID to resume a previous connection and receive any buffered results.",
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "taskType",
          "apiKey"
        ],
        "additionalProperties": false
      },
      "RequestBody": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "model": {
              "title": "Model",
              "description": "Identifier of the model to use for generation.",
              "type": "string",
              "const": "alibaba:qwen@3.5-397b"
            },
            "inputs": {
              "title": "Inputs",
              "description": "The unified payload wrapper for complex media assets dictating image, video or audio inference constraints.",
              "type": "object",
              "properties": {
                "images": {
                  "title": "Images",
                  "description": "Array of image inputs (UUID, URL, Data URI, or Base64).",
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "title": "Image",
                    "description": "Image input (UUID, URL, Data URI, or Base64).",
                    "type": "string",
                    "anyOf": [
                      {
                        "format": "uuid"
                      },
                      {
                        "format": "uri"
                      },
                      {
                        "pattern": "^data:image\\/[a-zA-Z]+;base64,[a-zA-Z0-9+/=]+$"
                      },
                      {
                        "pattern": "^[a-zA-Z0-9+/=]+$"
                      }
                    ]
                  }
                },
                "videos": {
                  "title": "Videos",
                  "description": "Array of video inputs (UUID, URL, or Base64).",
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "title": "Video",
                    "description": "Video input (UUID or URL).",
                    "type": "string",
                    "anyOf": [
                      {
                        "format": "uuid"
                      },
                      {
                        "format": "uri"
                      }
                    ]
                  }
                }
              },
              "additionalProperties": false
            },
            "seed": {
              "title": "Seed",
              "description": "Random seed for reproducible generation. When not provided, a random seed is generated in the unsigned 32-bit range.",
              "type": "integer",
              "minimum": 0,
              "maximum": 4294967295
            },
            "settings": {
              "title": "Settings",
              "description": "Global inference settings.",
              "type": "object",
              "properties": {
                "systemPrompt": {
                  "title": "System Prompt",
                  "description": "System-level instruction that guides the model's behavior and output style across the entire generation.",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 262144
                },
                "temperature": {
                  "title": "Temperature",
                  "description": "Controls randomness in generation. Lower values produce more deterministic outputs, higher values increase variation and creativity.",
                  "type": "number",
                  "multipleOf": 0.01,
                  "minimum": 0,
                  "maximum": 2,
                  "default": 0.6
                },
                "topP": {
                  "title": "Top-P",
                  "description": "Nucleus sampling parameter that controls diversity by limiting the probability mass. Lower values make outputs more focused, higher values increase diversity.",
                  "type": "number",
                  "multipleOf": 0.01,
                  "minimum": 0,
                  "maximum": 1,
                  "default": 0.95
                },
                "frequencyPenalty": {
                  "title": "Frequency Penalty",
                  "description": "Penalizes tokens based on their frequency in the output so far. A value of 0.0 disables the penalty.",
                  "type": "number",
                  "multipleOf": 0.01,
                  "minimum": 0,
                  "default": 0,
                  "maximum": 2
                },
                "maxTokens": {
                  "title": "Max Tokens",
                  "description": "Maximum number of tokens to generate in the response.",
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 65536
                },
                "minP": {
                  "title": "Min-P",
                  "description": "Minimum probability threshold. Tokens with probability below this value are excluded from sampling.",
                  "type": "number",
                  "multipleOf": 0.01,
                  "minimum": 0,
                  "maximum": 1,
                  "default": 0
                },
                "presencePenalty": {
                  "title": "Presence Penalty",
                  "description": "Encourages the model to introduce new topics. A value of 0.0 disables the penalty.",
                  "type": "number",
                  "multipleOf": 0.01,
                  "minimum": 0,
                  "default": 0,
                  "maximum": 2
                },
                "repetitionPenalty": {
                  "title": "Repetition Penalty",
                  "description": "Penalizes tokens that have already appeared in the output. A value of 1.0 disables the penalty.",
                  "type": "number",
                  "multipleOf": 0.01,
                  "minimum": 0,
                  "default": 1,
                  "maximum": 2
                },
                "stopSequences": {
                  "title": "Stop Sequences",
                  "description": "Array of sequences that will cause the model to stop generating further tokens when encountered.",
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "thinkingLevel": {
                  "title": "Thinking Level",
                  "description": "Controls the depth of internal reasoning the model performs before generating a response.",
                  "type": "string",
                  "enum": [
                    "off",
                    "high"
                  ],
                  "default": "high"
                },
                "topK": {
                  "title": "Top-K",
                  "description": "Top-K sampling parameter that limits the number of highest-probability tokens considered at each step.",
                  "type": "integer",
                  "minimum": 1,
                  "default": 20,
                  "maximum": 100
                }
              },
              "additionalProperties": false
            },
            "messages": {
              "title": "Messages",
              "description": "Array of chat messages forming the conversation context.",
              "type": "array",
              "minItems": 1,
              "items": {
                "title": "Message",
                "description": "A single chat message with a role and content.",
                "type": "object",
                "properties": {
                  "role": {
                    "title": "Role",
                    "description": "The role of the message author.",
                    "type": "string",
                    "enum": [
                      "user",
                      "assistant"
                    ]
                  },
                  "content": {
                    "title": "Content",
                    "description": "The text content of the message.",
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "role",
                  "content"
                ],
                "additionalProperties": false
              }
            },
            "taskType": {
              "title": "Task Type",
              "description": "Identifier for the type of task being performed",
              "type": "string",
              "const": "textInference"
            },
            "taskUUID": {
              "title": "Task UUID",
              "description": "UUID v4 identifier for tracking tasks and matching async responses. Must be unique per task.",
              "type": "string",
              "format": "uuid"
            },
            "webhookURL": {
              "title": "Webhook URL",
              "description": "Specifies a webhook URL where JSON responses will be sent via HTTP POST when generation tasks complete. For batch requests with multiple results, each completed item triggers a separate webhook call as it becomes available.",
              "type": "string",
              "format": "uri"
            },
            "includeCost": {
              "title": "Include Cost",
              "description": "Include task cost in the response.",
              "type": "boolean",
              "default": false
            },
            "deliveryMethod": {
              "title": "Delivery Method",
              "description": "Determines how the API delivers task results.",
              "type": "string",
              "oneOf": [
                {
                  "const": "sync",
                  "description": "Returns complete results directly in the API response."
                },
                {
                  "const": "async",
                  "description": "Returns an immediate acknowledgment with the task UUID. Poll for results using getResponse."
                },
                {
                  "const": "stream",
                  "description": "Streams results token-by-token as they are generated."
                }
              ],
              "default": "sync"
            },
            "numberResults": {
              "title": "Number of Results",
              "description": "Number of results to generate. Each result uses a different seed, producing variations of the same parameters.",
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "maximum": 4
            },
            "includeUsage": {
              "title": "Include Usage",
              "description": "Include token usage statistics in the response.",
              "type": "boolean",
              "default": false
            }
          },
          "additionalProperties": false,
          "required": [
            "taskType",
            "taskUUID",
            "model",
            "messages"
          ]
        },
        "description": "You must always POST an array of task objects."
      },
      "ResponseBody": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Unknown response structure"
            }
          }
        }
      },
      "ErrorResponse": {
        "title": "Error Response",
        "description": "Standard error response returned by the Runware API.",
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "code",
                "message"
              ],
              "additionalProperties": true,
              "properties": {
                "code": {
                  "type": "string",
                  "description": "A short identifier for the error (e.g., invalidApiKey, timeoutProvider)."
                },
                "message": {
                  "type": "string",
                  "description": "A human-readable explanation of what went wrong."
                },
                "parameter": {
                  "type": "string",
                  "description": "The request parameter related to the error, if applicable."
                },
                "taskType": {
                  "type": "string",
                  "description": "The task type of the request that failed."
                },
                "taskUUID": {
                  "type": "string",
                  "description": "The unique identifier of the failed request."
                },
                "documentation": {
                  "type": "string",
                  "description": "A link to relevant documentation."
                }
              }
            }
          }
        },
        "required": [
          "errors"
        ],
        "additionalProperties": false
      }
    }
  },
  "paths": {
    "/": {
      "post": {
        "summary": "Run Qwen3.5-397B",
        "description": "Qwen3.5-397B is a frontier Qwen large language model for reasoning, coding, search, and agent workflows. The underlying open-weight flagship uses a sparse MoE design with 397B total parameters and 17B activated parameters, supports 262K native context extensible to about 1M tokens, and is designed for high-throughput long-context inference.",
        "operationId": "run_alibaba_qwen3_5_397b",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — Missing or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — No valid API key provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — Insufficient account balance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — The API key lacks permissions for this request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests — Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server Error — Something went wrong on Runware's end.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable — Temporarily unavailable (maintenance or capacity).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "apiKeyAuth": []
    }
  ]
}