DashScope Native Text / Multimodal Generation

Alibaba Bailian native synchronous protocol; streaming is enabled through the X-DashScope-SSE header

POST/api/v1/services/aigc/text-generation/generation

Use this endpoint when the Bailian native request format ({model, input, parameters}) is required. If you only need to call text models such as Qwen, we recommend using OpenAI-Compatible Chat Completions directly. Available models are determined by the response from List Models (protocols includes dashscope).

Authorizations

AuthorizationstringRequired

Bearer Token authentication.

Authorization: Bearer YOUR_API_KEY

Endpoints

POST /api/v1/services/aigc/text-generation/generation          # Text generationPOST /api/v1/services/aigc/multimodal-generation/generation    # Multimodal generation

Request Headers

Header Required Description
Authorization Yes Bearer YOUR_API_KEY
Content-Type Yes application/json
X-DashScope-SSE Required for streaming Set to enable to enable SSE streaming output (Bailian native semantics, not a body field); incremental output is controlled by parameters.incremental_output
X-DashScope-DataInspection No Enhanced content safety inspection (optional official Bailian header)

Request Examples

curl --request POST \  --url https://api.maitoken.net/api/v1/services/aigc/text-generation/generation \  --header 'Authorization: Bearer <token>' \  --header 'Content-Type: application/json' \  --data '{    "model": "qwen3-max",    "input": {      "messages": [        { "role": "user", "content": "Hello, please introduce yourself" }      ]    },    "parameters": {      "result_format": "message"    }  }'
curl --request POST \  --url https://api.maitoken.net/api/v1/services/aigc/text-generation/generation \  --header 'Authorization: Bearer <token>' \  --header 'Content-Type: application/json' \  --header 'X-DashScope-SSE: enable' \  --data '{    "model": "qwen3-max",    "input": {      "messages": [        { "role": "user", "content": "Hello, please introduce yourself" }      ]    },    "parameters": {      "result_format": "message",      "incremental_output": true    }  }'

Notes

  • Request body and response fields follow the official Alibaba Bailian documentation; the platform does not rewrite fields
  • Service/action combinations not included in the allowlist return a 404 unsupported_endpoint
  • For asynchronous image/video generation, see DashScope Image Generation and DashScope Video Generation