Invoke Large Model Service
POST/v1/ai/:model/:path
When invoking large models, if you need to pass an additional path, you can append the path
parameter, such as v1/chat/completions
. Refer to the documentation of each large model for specific path definitions.
Streaming Output (server-sent events)
When enabling streaming output, explicitly specify text/event-stream
in the Accept
request header; otherwise, the request will time out after 60 seconds.
Request
Path Parameters
The model code to be invoked, which can be any one of the model groups provided by the following platforms:
hunyuan-exp
: Hunyuan Trial
deepseek
: Trial
or enter any other custom model group configured on the console.
The invocation path for the large model, such as v1/chat/completions
- application/json
Body
required
Refer to the documentation of each large model for passing request parameters.
object
Responses
- 200
- 400
- 404
- default
When invoking large models is successful, it returns (not necessarily the correct result).
Response Headers
X-Request-Id string
Request ID
- application/json
- text/event-stream
- Schema
- Example (from schema)
Schema
{
"created": 1723618716,
"id": "xxx",
"model": "hunyuan",
"version": "202403121316",
"choices": [
{
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "I am an AI assistant developed by Tencent. How can I help you?"
}
}
],
"search_info": {
"mindmap": {}
},
"processes": {},
"usage": {
"prompt_tokens": 11,
"completion_tokens": 14,
"total_tokens": 25
}
}
- Schema
Schema
string
Request failed.
Response Headers
X-Request-Id string
Request ID
- application/json
- Schema
- Example (from schema)
- AIModelConfigMissing
- AIModelParamInvalid
- AIModelRequestFailed
Schema
Error code
Error message
Request ID
{
"code": "string",
"message": "string",
"requestId": "string"
}
{
"code": "AI_MODEL_CONFIG_MISSING",
"message": "xxx",
"requestId": "xxx"
}
{
"code": "AI_MODEL_PARAM_INVALID",
"message": "xxx",
"requestId": "xxx"
}
{
"code": "AI_MODEL_REQUEST_FAILED",
"message": "xxx",
"requestId": "xxx"
}
Request failed.
Response Headers
X-Request-Id string
Request ID
- application/json
- Schema
- Example (from schema)
- FeatureNotConfigured
- AIModelNotFound
Schema
Error code
Error message
Request ID
{
"code": "string",
"message": "string",
"requestId": "string"
}
{
"code": "ENV_FEATURE_NOT_CONFIGURED",
"message": "xxx",
"requestId": "xxx"
}
{
"code": "AI_MODEL_NOT_FOUND",
"message": "xxx",
"requestId": "xxx"
}
General error message. See https://docs.cloudbase.net/error-code/service
Response Headers
X-Request-Id string
Request ID
- application/json
- Schema
- Example (from schema)
- InvalidHost
Schema
Error code
Error message
Request ID
{
"code": "string",
"message": "string",
"requestId": "string"
}
{
"code": "INVALID_HOST",
"message": "xxx",
"requestId": "xxx"
}