本篇文档主要介绍在使用大模型服务平台阿里云百炼中常见问题。
计费相关
API/SDK相关
-
如何查看错误码信息?
阿里云百炼模型服务的API调用将返回状态码以标识调用结果。通用状态码由阿里云百炼约定,各算法模型还可能在通用状态码的基础上增加自定义的状态码和状态信息。请通过返回结果中的
code
和status
字段定位调用成功或失败的详细信息。HTTP 返回码
错误代码 Code
错误信息 Message
说明
-
-
error.AuthenticationError: No api key provided. You can set by dashscope.api_key = your_api_key in code, or you can set it via environment variable DASHSCOPE_API_KEY= your_api_key.
使用DashScope SDK 时未提供API Key。
具体配置API Key的方法,请参见 将API Key配置到环境变量 。
-
-
openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
未传入API Key。您可以参考 常见问题 将 API Key 正确配置到环境变量,或将 API Key 作为明文写入代码中(不建议)。
-
mismatched_model
The model 'xxx' for this request does not match the rest of the batch. Each batch must contain requests for a single model.
在单个 Batch 任务中,所有请求都必须选用同一个模型。请根据 输入文件格式 检查您的输入文件。
-
duplicate_custom_id
The custom_id 'xxx' for this request is a duplicate of another request. The custom_id parameter must be unique for each request in a batch.
在单个 Batch 任务中,每条请求的 ID 必须唯一。请根据 输入文件格式 检查您的输入文件,确保所有请求 ID 不重复。
-
model_not_found
"The provided model 'xxx' is not supported by the Batch API.
当前模型暂不支持 Batch 调用,或者可能存在模型名称拼写错误。请参考 支持的模型列表 ,确认支持 Batch 调用的模型及其正确名称。
400
invalid_parameter_error
current user api does not support http call.
Qwen3 开源版模型不支持非流式输出,请使用 流式输出 。
400
invalid_parameter_error
This model only support stream mode, please enable the stream parameter to access the model.
模型仅支持 流式输出 ,请使用流式输出方式调用模型。
400
InvalidParameter
Required parameter(s) missing or invalid, please check the request parameters.
接口调用参数不合法。
400
APIConnectionError
Connection error.
本地网络问题。通常是因为开启了代理,请关闭或者重启代理。
400
InvalidParameter
Temperature should be in [0.0, 2.0)
temperature 参数设置未在[0.0, 2.0)的范围内。参数的取值范围请参见 通义千问 API 文档 。
400
invalid_request_error
'temperature' must be Float
temperature 参数设置未在[0.0, 2.0)的范围内。参数的取值范围请参见 通义千问 API 文档 。
400
InvalidParameter
Range of top_p should be (0.0, 1.0]
top_p 参数设置未在(0.0, 1.0]的范围内。参数的取值范围请参见 通义千问 API 文档 。
400
invalid_request_error
'top_p' must be Float
top_p 参数设置未在(0.0, 1.0]的范围内。参数的取值范围请参见 通义千问 API 文档 。
400
InvalidParameter
Presence_penalty should be in [-2.0, 2.0]
presence_penalty 参数设置未在 [-2.0, 2.0]的范围内。参数的取值范围请参见 通义千问 API 文档 。
400
InvalidParameter
Range of max_tokens should be [1, 2000]
max_tokens 参数设置未在 [1, 模型最大输出 Token 数]的范围内。模型最大输出 Token 数请参见 模型列表 。
400
InvalidParameter
Range of n should be [1, 4]
n 参数设置未在 [1, 4]的范围内。参数的取值范围请参见 通义千问 API 文档 。
400
InvalidParameter
Range of seed should be [0, 9223372036854775807]
使用 DashScope 方式调用大模型 API 时,seed 参数设置未在 [0, 9223372036854775807]的范围内。参数的取值范围请参见 通义千问 API 文档 。
400
invalid_request_error
-1 is lesser than the minimum of 0 - 'seed'
或
'seed' must be Integer
使用 OpenAI 兼容方式调用大模型 API 时,seed 参数设置未在 [0, 2 31 -1]的范围内。参数的取值范围请参见 通义千问 API 文档 。
400
InvalidParameter
The "stop" parameter must be of type "str", "list[str]", "list[int]", or "list[list[int]]", and all elements within the list must be of the same type.
stop 参数不符合"str", "list[str]", "list[int]", 或"list[list[int]]"格式。参数的详细说明请参见 通义千问 API 文档 。
400
InvalidParameter
Parameter top_k be greater than or equal to 0
top_k 参数不可以为负数。参数的取值范围请参见 通义千问 API 文档 。
400
InvalidParameter
Repetition_penalty should be greater than 0.0
repetition_penalty 参数不可以为负数。参数的取值范围请参见 通义千问 API 文档 。
400
InvalidParameter
Value error, batch size is invalid, it should not be larger than xx.
调用Embedding模型时输入内容行数超过模型上限,具体行数限制请参考 Embedding 。
400
InvalidParameter
Range of input length should be [1, xxxx]
调用模型时输入内容长度超过模型上限,具体限制请参考 模型列表 。
400
InvalidParameter
The provided URL does not appear to be valid. Ensure it is correctly formatted.
在使用 视觉理解模型 、 全模态(Qwen-Omni)模型 时传入数据的 URL 不符合要求,需要是http:// 、 https://、 data: 、 file://开头。
如果开头是data:, 在 Base64 编码数据前需要包含
"base64"
,否则也会报错。400
InvalidParameter
Input should be a valid dictionary or instance of GPT3Message
messages 字段的构造格式不符合要求,例如括号数量不匹配、缺少必要的键值对等。
400
invalid_request_error
'audio' output only support with stream=true
在使用 (Qwen-Omni)模型 时,未使用流式输出方式。
400
InvalidParameter
Either \"prompt\" or \"messages\" must exist and cannot both be none
prompt和messages字段不能都为空。
原因可能是格式错误,例如 通过HTTP调用DashScope服务 (非OpenAI兼容方式)时,messages需放入input对象中,而不是与model参数并列。
{ "model": "指定模型", "input": { "messages": [ {"role": "user", "content": "你是谁"}, "parameters": { "result_format": "message" }
400
InvalidParameter
'messages' must contain the word 'json' in some form, to use 'response_format' of type 'json_object'.
在开启JSON结构化输出功能时,未在System Message或User Message指引模型以JSON格式输出,如:“请以JSON格式输出。”。
400
InvalidParameter
Too many files provided.
提供的file-id数量超限,请确保file-id数量小于100。
400
InvalidParameter
File [id:file-fe-***********] exceeds size limit.
提供的file-id文件大小超限,请确保文件小于150 MB。
400
InvalidParameter
File [id:file-fe-***********] exceeds page limits (15000 pages).
提供的file-id文件页数超限,请确保文件页数小于15000页。
400
InvalidParameter
File [id:file-fe-***********] content blank.
提供的file-id文件内容为空,请确保文件内容符合要求。
400
InvalidParameter
Total message token length exceed model limit (10000000 tokens).
输入总长度超过了10,000,000 Token,请确保message长度符合要求。
400
DataInspectionFailed
data_inspection_failed
Input or output data may contain inappropriate content.
Input data may contain inappropriate content.
Output data may contain inappropriate content.
数据检查错误,输入或者输出包含疑似敏感内容被绿网拦截。
400
BadRequest.EmptyInput
Required input parameter missing from request.
请求的输入不能为空。
400
BadRequest.EmptyParameters
Required parameter "parameters" missing from request.
请求的参数不能为空。
400
BadRequest.EmptyModel
Required parameter "model" missing from request.
请求输入的模型不能为空。
400
InvalidURL
Invalid URL provided in your request.
请求的URL错误。
400
InvalidParameter
The video modality input does not meet the requirements because: the range of sequence images shoule be (4, 80)/(4,512).
使用通义千问VL模型进行视频理解,且以图像列表方式传入时,图像数量不符合要求。详情可参见 视觉理解 。
-
Qwen2.5-VL系列模型:最少传入4张图片,最多512张图片其他模型:
-
最少传入4张图片,最多80张图片
400
InvalidParameter
Exceeded limit on max bytes per data-uri item : 10485760'.
使用OpenAI SDK向 Qwen-VL模型 、 QVQ模型 、 Qwen-Omni 模型 传入的本地图像或视频大小不符合要求
-
传入本地文件:需要保证Base64编码后的视频或图像需小于10MB。
-
传入文件URL:传入图像时,单个文件本身的大小不超过10 MB;传入视频文件时,Qwen2.5-VL系列模型支持传入的单个视频本身大小不超过1 GB,其他模型不超过150MB。
400
InvalidParameter
The image length and width do not meet the model restrictions. [absolute aspect ratio must be smaller than 200, got n / m].
The image length and width do not meet the model restrictions. [height:n or width:m must be larger than 10].
传入通义千问VL模型的图像尺寸(长度和宽度)不符合模型的要求。
图像尺寸需满足以下要求:
-
图像的宽度和高度均不小于10像素。
-
宽高比不应超过200:1或1:200。
400
InvalidParameter
The file format is illegal and cannot be opened.
-
图像文件格式非法,无法打开。
-
通义千问VL模型支持的图像格式如下:BMP、DIB、ICNS、ICO、JPEG、JPEG2000、PNG、SGI、TIFF、WEBP。
400
InvalidParameter
Failed to download multimodal content.
Download the media resource timed out during the data inspection process.
无法下载多模态文件或者下载超时。有以下两种可能的原因:
-
网络原因,请检查您的网络连接是否正常。
-
该文件的URL为OSS的内网URL。由于OSS内网与阿里云百炼服务不互通,请勿使用OSS内网URL。
400
InvalidParameter
Don't have authorization to access the media resource during the data inspection process.
该媒体文件没有访问权限。
可能的原因:调用模型时,传入的OSS中带签名的文件URL已经过期。请确保在文件URL的有效期内访问该文件。
400
invalid_value
Invalid value: vide. Supported values are: 'text','image_url','video_url' and 'video'.
使用OpenAI SDK调用模型时,content参数type属性的取值不正确。支持的取值有text、image_url、video或video_url。
400
InvalidParameter
Invalid video file.
传入的视频文件无效。
400
InvalidParameter
The video modality input does not meet the requirements because: The video file is too long.
传入通义千问VL模型或者Qwen-Omni 模型的视频时长超过限制:
-
Qwen2.5-VL模型支持的视频时长应在2秒至10分钟之间。
-
其他通义千问VL或Qwen-Omni 模型支持的视频时长应在2秒至40秒之间。
400
Arrearage
Access denied, please make sure your account is in good standing.
400
UnsupportedOperation
The operation is unsupported on the referee object.
关联的对象不支持该操作(可以根据实际情况修改)。
400
FlowNotPublished
Flow has not published yet, please publish flow and try again.
流程未发布,请发布流程后再重试。
400
InvalidSchema
Database schema is invalid for text2sql.
请输入数据库Schema信息。
400
InvalidSchemaFormat
Database schema format is invalid for text2sql.
输入数据表信息格式异常。
400
FaqRuleBlocked
Input or output data is blocked by faq rule.
命中FAQ规则干预模块。
400
CustomRoleBlocked
Input or output data may contain inappropriate content with custom rule.
请求或响应内容没有通过自定义策略。
400
InternalError.Algo
Missing Content-Length of multimodal url.
URL请求的响应头信息缺失
Content-Length
字段。如果问题无法解决,请尝试使用其他图片链接。400
InvalidParameter
Wrong Content-Type of multimodal url
-
URL请求的响应头信息
Content-Type
字段不正确。如果问题无法解决,请尝试使用其他图片链接。 -
通义千问VL模型支持的Content Type为:image/bmp、image/bmp、image/icns、image/x-icon、image/jpeg、image/jp2、image/png、image/sgi、image/tiff、image/webp。详情可参见 通义千问VL模型支持的图像 。
400
invalid_request_error
Payload Too Large.
执行Batch任务时,上传的JSONL文件大小超出允许的最大限制。
为了顺利完成上传,请检查并确保文件大小符合规定限制,或者考虑将大文件分割成多个较小的文件进行上传。JSONL文件格式请参考 输入文件格式 。
401
InvalidApiKey
invalid_api_key
Invalid API-key provided.
Incorrect API key provided.
可能原因一: 请求中的 API Key 错误。请重新 获取API Key 。
可能原因二:请求中的dashscope.base_http_api_url或base_url错误。请检查URL中的域名,确保其为
dashscope-intl.aliyuncs.com
。403
AccessDenied
access_denied
Access denied.
无权访问此 API。
403
Workspace.AccessDenied
Workspace access denied.
无权限访问业务空间的应用或者模型。
-
如果调用子业务空间的模型,请参考 子业务空间的模型调用 。
-
您也可以改为使用主账号的API KEY,主账号具有所有业务空间的权限。
403
Model.AccessDenied
Model access denied.
子账号无权限访问业务空间的模型。请确认以下步骤:
-
调用时,是否传入了业务空间标识(目前子账号无法访问默认业务空间的应用或模型)。
-
是否已对子账号访问的业务空间做了授权。
-
是否对访问的业务空间做了模型的访问授权。
具体详情请参考文档 子业务空间的模型调用 的前提条件。
403
AccessDenied.Unpurchased
Access to model denied. Please make sure you are eligible for using the model.
您可能还未开通阿里云百炼服务:您需要注册或登录阿里云账号,然后前往 模型列表 开通模型服务。
404
WorkSpaceNotFound
WorkSpace can not be found.
用户空间信息不存在。
404
ModelNotFound
model_not_found
Model can not be found.
The model xx does not exist.
当前访问的模型不存在。
404
ModelNotFound
model_not_found
The model xx does not exist or you do not have access to it.
您还未开通阿里云百炼服务,您需要前往 模型列表 开通模型服务。
408
RequestTimeOut
-
Request timed out, please try again later.
-
Response timeout!
-
I/O error on POST request for "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions": timeout
-
请求超时,您可尝试再次发起请求。
-
可能是因为输出内容很长导致超时,您可尝试采用流式输出方式发起请求,具体操作请参见 流式输出 。
413
BadRequest.TooLarge
Payload Too Large.
接入层网关返回请求体过大错误,如果错误是由MSE网关层直接拦截,则没有 code,并且 message 不能自定义。如果是RESTful网关拦截,则返回code。
415
BadRequest.InputDownloadFailed
Failed to download the input file: xxx.
下载输入文件失败,可能是由于下载超时、下载失败或者文件超过限额大小,错误信息可以指出更详细的内容。
415
BadRequest.UnsupportedFileFormat
Input file format is not supported.
输入文件的格式不受支持。
429
Throttling
Requests throttling triggered.
接口调用触发限流。
429
Throttling
-
Too many fine-tune job in running, please retry later.
-
Only 20 fine-tune job in running or succeeded allowed per user.
资源的创建触发平台限制。您可以删除不再使用的模型。
429
Throttling.RateQuota
Requests rate limit exceeded, please try again later.
调用频次触发限流,比如每秒钟请求次数。您可以查阅 限流 文档了解对应模型的限流条件。建议等待一段时间后再尝试调用。
429
Throttling.AllocationQuota
insufficient_quota
Allocated quota exceeded, please increase your quota limit.
You exceeded your current quota, please check your plan and billing details.
一段时间调用量触发限流,比如每分钟生成Token数。
429
LimitRequests
limit_requests
You exceeded your current requests list
超出调用限制,您需等到不满足限流条件时才能再次调用,部分模型支持申请提高限额,具体请查看 限流 文档。
429
Throttling.AllocationQuota
Free allocated quota exceeded.
免费额度已经到期或者耗尽,并且该模型未支持计费访问。
429
PrepaidBillOverdue
The prepaid bill is overdue.
业务空间预付费账单到期。
429
PostpaidBillOverdue
The postpaid bill is overdue.
模型推理商品已失效。
429
CommodityNotPurchased
Commodity has not purchased yet.
业务空间未订购。
500
InternalError
internal_error
An internal error has occured, please try again later or contact service support.
内部错误。
-
如果您使用 (Qwen-Omni)模型 ,需要使用流式输出方式。
500
InternalError.Algo
An internal error has occured during execution, please try again later or contact service support.
内部算法错误。
500
InternalError.Algo
Role must be in [user, assistant]
在使用 Qwen-MT模型 时,请确保messages数组中仅包含一个元素,且该元素必须是用户消息(User Message)。
500
SystemError
system_error
An system error has occured, please try again later.
系统错误。
500
InternalError.Timeout
An internal timeout error has occured during execution, please try again later or contact service support.
异步任务从网关提交给算法服务层之后等待时间 3 小时,如果在这期间始终没有结果,则超时。
500
RewriteFailed
Failed to rewrite content for prompt.
调用改写prompt的大模型失败。
500
RetrivalFailed
Failed to retrieve data from documents.
文档检索失败。
500
AppProcessFailed
Failed to proceed application request.
应用流程处理失败。
500
ModelServiceFailed
Failed to request model service.
模型服务调用失败。
500
InvokePluginFailed
Failed to invoke plugin.
插件调用失败。
503
ModelUnavailable
Model is unavailable, please try again later.
模型暂时无法提供服务。
503
ModelServingError
Too many requests. Your requests are being throttled due to system capacity limits. Please try again later.
我们的网络资源目前处于饱和状态,暂时无法处理您的请求,您可以稍后再进行尝试。
NetworkError
network_error
Can not find api-key.
环境变量配置没有生效,您可以重启客户端或IDE后重试。更多情况请参考 常见问题 。
-
-
如何安装SDK?
阿里云百炼目前支持Java、Python编程语言的SDK,点击 安装SDK 查看详情。
-
Assistant API 调用 function call ,用户需要依次调用两个本地函数,现在支持吗?
a. 目前不支持分别调用两个函数。
b. 手动创建两个Assistant API,分别分配两个Assistant API的使用返回。
-
Assistant API 为什么没有memory相关的能力?Assistant API 有memory相关的能力吗?
memory是一个较为复杂的配置功能,在Assistant API 中实现较为复杂。
产品相关
-
如何开通阿里云百炼服务?
登录阿里云账号,访问 阿里云百炼大模型服务平台 。 在首页/模型广场,均可点击开通模型服务,按需开通即可。详细内容请查看: 产品开通 。
-
开通阿里云百炼服务后如何关闭?
目前,阿里云百炼服务开通后暂不支持关闭。如果您通过API来调用模型/应用,您只需要在控制台的 API-KEY 页面中删除API-KEY即可避免后续的调用。
-
如何体验大模型服务?
可通过 模型体验中心 进行体验。
-
阿里云百炼和通义千问的区别是什么?
阿里云百炼是一个提供模型的平台,包含通义千问系列的模型。
-
如何实现业务数据隔离,使不同业务线的同学数据之间不关联?
可以通过主账号给不同子账号授予不同的业务空间权限,不同业务空间的数据互不影响,存在隔离。详细操作内容点击 如何使用业务空间 查看。
-
阿里云百炼是否保存模型调用时传入的数据?
-
通过模型API调用模型时,阿里云百炼不会保存对话数据。调用过程只对调用状态进行脱敏日志记录,调用结束后对明文的提示词以及应答结果进行销毁,不会保存数据。
-
通过Assistant API调用模型时,阿里云百炼会保存对话数据以增强用户体验,目前暂无数据失效日期。
-
通过阿里云百炼应用调用模型时:对话历史记录默认缓存60分钟,缓存的对话轮数通过“携带上下文轮数”参数指定。如果60分钟内发生一次对话,缓存的失效时间会往后延60分钟。如果60分钟内没有发生对话,对话历史记录将失效,即数据被销毁。
-
阿里云严格保护数据隐私,绝不会将您的数据用于模型训练。同时,您在构建应用或训练大模型过程中传输的数据都会经过加密,确保数据安全。
-
模型中心
-
所谓大模型参数是怎么存储的?
可以通过魔搭下载模型,会有模型结构的JSON,可以参考JSON内容。一般情况下用开源的Python组件,去解析组件,会有向量信息,可能理解会有点难度。但是可以了解存储过程。
-
通义千问系列模型支持多少种语言?
14种, 分别是中文、英文、阿拉伯语、西班牙语、法语、葡萄牙语、德语、意大利语、俄语、日语、韩语、越南语、泰语、印度尼西亚语。
-
当前模型可以对接结构化数据吗?比如MySQL和hive等。
当前不支持。但已经在开发中,优先对接RDS服务。
-
请问Qwen2、千问-MAX等模型的文字生成速度对所有用户都是固定的吗,有没有调速的途径?
这个速度不是固定的,跟线上资源和用户所有请求有关。
-
咱们模型限流触发后,一般需要等多长时间再次尝试呢?
这个就和具体限流值相关。比如有的客户的限流是120qpm,执行2次请求每1秒,那比如0.2秒的时候提交了2次请求,再提交就会被限流,然后需要等0.8秒。