Embeddings文本向量化API 异常返回 异常返回时: http code 返回非200。 http body 中返回 error 结构,error结构中包含code、type、message、param等信息,具体可见OpenAPI接口文档中的error结构描述及错误码部分介绍。 错误结果示例 plaintext { "error" : { "code" : "500001", "type" : "INVOKEMODELERROR", "message" : "服务接口异常,请联系管理员" } } 请求示例代码 plaintext 假设慧聚平台用户组AppKey884c8fc4054548a7b1ca1123592f5b7,模型ID96dcaaaaaaaaaaaa5ff55ea377831a,以此为例进行说明。 curl方式请求 plaintext curl request POST url header 'Accept: /' header 'AcceptEncoding: gzip, deflate, br' header 'Authorization: Bearer 884c8fc4054548a7b1ca1123592f5b7' header 'ContentType: application/json' data '{ "model": "4b38a36cabe247c8a996206984c9e2a61", "input" : "A cute baby sea otter" }' python方式请求 plaintext import json import requests URL " headers { "Authorization": "Bearer 884c8fc4054548a7b1ca1123592f5b7", "ContentType": "application/json" } data { "model": "4b38a36cabe247c8a996206984c9e2a61", "input" : "A cute baby sea otter" } try: response requests.post(URL, headersheaders, jsondata) if response.statuscode ! 200: print(response.json()) else: embeddings response.json()["data"][0]["embeddings"] except Exception as e: print(f"Exception: {e}")