Skip to main content

Invoke Large Model Service

POST 

/v1/ai/:provider/:path

When you need to pass an additional path when calling a large model, append the path parameter, for example chat/completions. Refer to the documentation of each large model for specific path definitions.

Streaming Output (server-sent events)

When streaming output is enabled, explicitly specify text/event-stream in the Accept request header; otherwise, the request will time out after 60 seconds.

Protocol Format

This API supports OpenAI-compatible and Anthropic-compatible protocols:

  • When path is chat/completions: use the OpenAI-compatible protocol. Both the request body and response body follow the OpenAI Chat Completions format.
  • When path is v1/messages: use the Anthropic protocol. Both the request body and response body follow the Anthropic Messages format.

Note that when using the Anthropic Messages API, the selected provider must have been configured for Anthropic protocol access. The built-in providers that currently support both OpenAI and Anthropic protocols are:

  • cloudbase
  • hunyuan-v3

Request

Responses

Returned when the model call succeeds (the returned business result may still indicate an error)

Response Headers
    X-Request-Id

    Request ID