
# 服务预测失败，报错APIG.XXXX
请求在APIG（API网关）出现问题被拦截，报错APIG.XXXX。
常见报错：
- [APIG.0101 预测地址错误]
- [APIG.0201 请求体内容过大]
- [APIG.0301 鉴权失败]
- [APIG.1009 AppKey和AppSecret不匹配]
查看更多的APIG（API网关）错误码含义及处理方案可参考[API错误码](https://support.huaweicloud.com/usermanual-apig/apig_03_0048.html)API错误码。
 #### APIG.0101 预测地址错误
当预测的地址有问题时，APIG（API网关）将拦截请求，报错"APIG.0101":"The API does not exist or has not been published in the environment"，请到在线服务详情界面，"调用指南"页签中获取正确的API接口地址。
![](https://support.huaweicloud.com/trouble-modelarts/public_sys-resources/note_3.0-zh-cn.png)
如果您在配置文件url中有定义路径，需要在API调用body体中调用路径后拼接自定义路径，例如：您定义url为"/predictions/poetry"，那么在API调用时路径为"{API接口地址}/predictions/poetry"。
图1获取API接口地址   
![](https://support.huaweicloud.com/trouble-modelarts/figure/zh-cn_image_0000001552058645.png "点击放大")
 #### APIG.0201 请求体内容过大
请求体内容过大时，APIG（API网关）会拦截请求，报错"APIG.0201":"Request entity too large"。请减少预测请求内容后重试。
当使用API调用地址预测时，请求体的大小限制是12MB，超过12MB时，请求会被拦截。
使用ModelArts console的预测页签进行的预测，由于console的网络链路的不同，要求请求体的大小不超过8MB。
图2请求报错APIG.0201   
![](https://support.huaweicloud.com/trouble-modelarts/figure/zh-cn_image_0000001449575513.png "点击放大")
 #### APIG.0301 鉴权失败
通过API进行服务预测，或者使用Token进行APP认证，需要获取正确的Token鉴权，当Token不合法时，APIG（API网关）拦截请求，报错"APIG.0301":"Incorrect IAM authentication information： decrypt token fail"。请获取正确的token填入X-Auth-Token，进行预测。如何获取Token请参考[获取IAM用户Token](https://support.huaweicloud.com/api-iam/iam_30_0001.html)。
 #### APIG.1009 AppKey和AppSecret不匹配
当服务预测使用的AppKey和AppSecret不匹配时，报错"APIG.1009"："AppKey or AppSecret is invalid"。
查询AppKey和AppSecret，使用APP认证访问在线服务，请参考[访问在线服务（APP认证）](https://support.huaweicloud.com/usermanual-standard-modelarts/inference-modelarts-0025.html)。
