How to Integrate DeepSeek with Alibaba Cloud Native API Gateway: A Step‑by‑Step Guide
This article explains the concepts, evolution, and core capabilities of API gateways, then provides a detailed, cloud‑native tutorial on configuring Alibaba Cloud's API Gateway to connect with DeepSeek, covering prerequisites, service setup, AI API creation, multi‑model routing, and debugging procedures.
Introduction
API gateways are not new, but the popularity of DeepSeek has renewed interest in them. The article reviews upstream/downstream concepts, evolution, classifications, core capabilities, and shows how to integrate DeepSeek with an API gateway.
API Gateway Related Concepts
An API (Application Programming Interface) defines how software components communicate. Alibaba Cloud APIs let developers manage cloud resources. API types include HTTP API, REST API, WebSocket API, and AI‑optimized API.
HTTP API: Routing‑centric, suitable for scenarios without a unified specification.
REST API: Resource‑oriented, follows OpenAPI standards, ideal for API‑First and cross‑team collaboration.
WebSocket API: Enables bidirectional real‑time communication for AI, IoT, etc.
AI API: Tailored for AI gateways with plugins for model routing, content safety, authentication, and more.
An API gateway sits between clients and backend services, handling authentication, traffic control, rate limiting, caching, and security.
Evolution and Classification of API Gateways
API gateways have evolved alongside software architectures: monolith → vertical → SOA → microservices → cloud‑native → AI‑native. Different stages yield different gateway forms, such as traffic gateways, ESB gateways, microservice gateways, cloud‑native gateways, and AI gateways.
Key Types
Traffic Gateway: Balances load across multiple services, improving scalability and availability.
Enterprise Service Bus (ESB) Gateway: Standardizes integration between heterogeneous systems using SOA principles.
Microservice Gateway: Manages routing, load balancing, rate limiting, circuit breaking, and security for microservices (e.g., Spring Cloud Gateway).
Cloud‑Native Gateway: Works with Kubernetes Ingress/Gateway API, offering elastic scaling and combined traffic‑ and service‑gateway features (e.g., Envoy, Higress).
AI Gateway: Extends cloud‑native gateways with AI‑specific capabilities such as multi‑model switching, content safety, semantic caching, token quota management, and fallback handling (e.g., Higress, Kong).
Core Capabilities and Application Scenarios
Capabilities are grouped by user role:
API Development: API‑First design, lifecycle management, testing, publishing, monitoring, and security.
API Supply: Providing stable, secure APIs with features like security, gray‑release, and caching.
API Consumption: Auditing calls, quota limiting, backend protection, and rate limiting.
Integrating DeepSeek with Alibaba Cloud Native API Gateway
Prerequisites
Create a VPC with a public NAT gateway and bind an Elastic IP.
Provision a Cloud‑Native API Gateway instance within that VPC.
Scenario 1 – Integrated Model
The gateway already includes several large‑model providers (Alibaba Cloud Baichuan, DeepSeek, OpenAI, Azure, Claude, etc.). Configure an AI service by selecting the provider, setting the service address (default), and entering the API‑KEY.
Scenario 2 – Generic Model
For models not pre‑integrated, define a custom service address that supports the OpenAI protocol or a self‑hosted DeepSeek service on PAI/FC.
Scenario 3 – Multi‑Model Proxy
Combine integrated and generic models to create a multi‑model service with fallback handling. Define routing rules such as:
Model name pattern DeepSeek-* → PAI DeepSeek.
Model name pattern ep-* → Volcano Engine DeepSeek.
On error or rate‑limit, fallback to Alibaba Cloud DeepSeek.
Step‑by‑Step Configuration
Log in to the Cloud‑Native API Gateway console.
Select the target instance and region.
Navigate to Services and create a new AI service, specifying source, provider, address, and API‑KEY.
Create an AI API, set domain, instance, enable request observability, choose Multi‑Model Service , and add the previously created services.
Enable Fallback and add fallback services (e.g., Alibaba Cloud DeepSeek).
Use the Debug tab to test model names; the gateway routes requests according to the defined patterns and fallback rules.
References
[1] https://help.aliyun.com/zh/vpc/user-guide/create-and-manage-a-vpc
[2] https://help.aliyun.com/zh/vpc/user-guide/use-the-snat-feature-of-an-internet-nat-gateway-to-access-the-internet
[3] https://help.aliyun.com/zh/api-gateway/cloud-native-api-gateway/user-guide/create-gateway
[4] https://help.aliyun.com/zh/api-gateway/cloud-native-api-gateway/use-cases/pai-deployment-model-access-ai-gateway
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Alibaba Cloud Native
We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
