语言 | V1/V2 | V3 |
Python | import volcengine.maas | from volcenginesdkarkruntime import Ark |
Go | import "github.com/volcengine/volc-sdk-golang/service/maas" | import "github.com/volcengine/volcengine-go-sdk/service/arkruntime" |
Java | import com.volcengine.service.maas.MaasService | import com.volcengine.ark.runtime.service.ArkService |
| V1 | V2 | V3 |
域名 | maas-api.ml-platform-cn-beijing.volces.com | maas-api.ml-platform-cn-beijing.volces.com | ark.cn-beijing.volces.com |
path前缀 | /api/v1 | /api/v2 | /api/v3 |
旧版API URL | 新版API URL |
api/v1/chat | api/v3/chat/completions |
api/v2/endpoint/endpoint_id/chat | api/v3/chat/completions |
api/v2/endpoint/endpoint_id/embeddings | api/v3/embeddings |
api/v2/endpoint/endpoint_id/tokenization | api/v3/tokenization |
/api/v2/endpoint/endpoint_id/classification | 暂不支持 |
/api/v2/endpoint/endpoint_id/images/quick-gen | 暂不支持 |
/api/v2/endpoint/endpoint_id/images/flex-gen | 暂不支持 |
/api/v2/endpoint/endpoint_id/audio/speech | 暂不支持 |
api/v2/endpoint/:endpoint_id/chat | api/v3/chat/completions | 备注 |
choices | choices | - |
usage | usage | - |
extra | - | v3 无对标参数。 |
api/v2/endpoint/:endpoint_id/chat | api/v3/chat/completions | 备注 |
choices | choices | v3 兼容 openai 的接口协议,流式场景下,返回的 choices[0].delta 等同于 v1 的 choice.message。 |
usage | usage | - |
extra | - | v3 无对标参数。 |
api/v2/endpoint/:endpoint_id/embeddings | api/v3/embeddings | 备注 |
:endpoint_id | model | v2 在 url path 中,v3 在 body 中通过 model 字段传递。 |
input | input | - |
encoding_format | encoding_format | v3 支持 encoding_format 取值为 float 或 base64。 |
user | user | - |
api/v2/endpoint/:endpoint_id/embeddings | api/v3/embeddings | 备注 |
object | object | - |
data | data | - |
usage | usage | - |
api/v2/endpoint/:endpoint_id/tokenization | api/v3/tokenization | 备注 |
:endpoint_id | model | v2 在 url path 中,v3 在 body 中通过 model 字段传递。 |
text | text | v3 的 text 可以输入一个字符串,或者一个字符串列表。 |