This document describes how to call the Ling series model inference service directly provided by AntDigital on the Alibaba Cloud Model Studio platform.
Activate the service
- Go to the Model Studio console, search for Ling, find the antdigital/Ling-3.1-flash model card, and click Activate Now.
- In the pop-up window, confirm the activation and authorization.
Getting started
Prerequisites
- You have obtained and configured an API key.
- If you call the service using a software development kit (SDK), you must install the SDK.
- Thinking mode (default, or
enable_thinking: true): The model outputs its reasoning process (reasoning_content). - Non-thinking mode (
enable_thinking: false): The model directly outputs the result without the reasoning process.
preserve_thinking parameter to pass the thinking process in multi-turn conversations. For more information, see Multi-turn conversation.
The following example calls antdigital/Ling-3.1-flash in thinking mode with streaming output.
enable_thinkingis not a standard OpenAI parameter. In the OpenAI Python SDK, pass it viaextra_body. In the Node.js SDK, pass it as a top-level parameter.- For streaming output,
include_usageinstream_optionssupports onlytrue. Passingfalsereturns an error.
- Python
- Node.js
- curl
Other features
| Feature | Supported | Notes |
|---|---|---|
| Multi-turn conversation | Supported | — |
| Function calling | Supported | Supports streaming tool call arguments through tool_stream. Does not support parallel_tool_calls |
| Partial mode | Supported | — |
| Context cache | Supported | Implicit cache. Input tokens that hit the cache are billed at 20% of the input price |
| Structured output | Supported | response_format supports only {"type": "json_object"}. json_schema is not supported |
| Web search | Unsupported | — |
| Multimodal input | Unsupported | Supports only text input |
thinking_budget, reasoning_effort, parallel_tool_calls, seed, logprobs, top_logprobs, enable_code_interpreter, enable_search, search_options, and skill.
Models and pricing
| Model | Description |
|---|---|
| antdigital/Ling-3.1-flash | Hybrid thinking model with thinking mode enabled by default. Context length: 1,048,576 tokens |
In thinking mode, the chain-of-thought is billed as output tokens.