Related Documentation
Minimum Version
Kong Gateway - 3.13
Tags
#ai

You can proxy requests to Dashscope AI models through AI Gateway using the AI Proxy and AI Proxy Advanced plugins. This reference documents all supported AI capabilities, configuration requirements, and provider-specific details needed for proper integration.

Upstream paths

AI Gateway automatically routes requests to the appropriate Dashscope API endpoints. The following table shows the upstream paths used for each capability.

Capability Upstream path or API
Chat completions /compatible-mode/v1/chat/completions
Embeddings /compatible-mode/v1/embeddings
Image generations /api/v1/services/aigc/multimodal-generation/generation
Image edits /api/v1/services/aigc/image2image/image-synthesis

Supported capabilities

The following tables show the AI capabilities supported by Dashscope provider when used with the AI Proxy or the AI Proxy Advanced plugin.

Set the plugin’s route_type based on the capability you want to use. See the tables below for supported route types.

Text generation

Support for Dashscope basic text generation capabilities including chat, completions, and embeddings:

Capability Route type Streaming Model example Min version
Chat completions llm/v1/chat qwen-plus 3.13
Embeddings llm/v1/embeddings text-embedding-v1 3.13

Image

Support for Dashscope image generation and editing capabilities:

Capability Route type Model example Min version
Generations image/v1/images/generations qwen-image-plus 3.13
Edits image/v1/images/edits qwen-image-plus 3.13

For requests with large payloads, consider increasing config.max_request_body_size to three times the raw binary size.

Supported image sizes and formats vary by model. Refer to your provider’s documentation for allowed dimensions and requirements.

Dashscope base URL

The base URL is https://dashscope.aliyuncs.com or https://dashscope-intl.aliyuncs.com, where {route_type_path} is determined by the capability.

AI Gateway uses this URL automatically. You only need to configure a URL if you’re using a self-hosted or Dashscope-compatible endpoint, in which case set the upstream_url plugin option.

Configure Dashscope with AI Proxy

To use Dashscope with AI Gateway, configure the AI Proxy or AI Proxy Advanced.

Here’s a minimal configuration for chat completions:

For more configuration options and examples, see:

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!