面向 AI 助手:本页的 Markdown 版本位于 https://ark.volcengine.com/region:cn-beijing/docs/get-api-key-api.md,全部文档索引见 https://ark.volcengine.com/llms.txt。

获取临时 API Key

POST https://ark.cn-beijing.volcengineapi.com/?Action=GetApiKey&Version=2024-01-01

获取临时 API Key,用于在有效期内指定推理接入点、智能体等资源的调用的鉴权

鉴权#

本接口支持鉴权方式如下,详情请参见 Base URL 及鉴权。

  • Access Key 鉴权,请在 Access Key 管理 页面,获取 Access Key。本接口仅支持 Access Key 鉴权。

请求参数#

Body 参数#

DurationSeconds integer 必选  |  有效期

临时 API Key 的有效期,单位为秒。

取值范围:[0, 2592000]

ResourceIds string[] 必选  |  资源 ID 列表

ResourceType 字段指定的资源 ID 列表。

  • 当 ResourceType 为 endpoint 时,可在方舟控制台 > 推理模块获取 endpoint ID。
  • 当 ResourceType 为 bot 时,可在方舟控制台 > 我的应用获取 bot ID。
ResourceType string 必选  |  资源类型

资源类型。可选值:

  • endpoint:模型推理接入点
  • bot:智能体
  • presetendpoint:预置推理接入点
ProjectName string  |  项目名称

项目名称。当 ResourceType 为 presetendpoint 时,本参数必填。

响应参数#

ApiKey string  |  临时 API Key

生成的临时 API Key 字符串,可在 DurationSeconds 指定的有效期内用于调用方舟相关资源。

ExpiredTime integer  |  过期时间

临时 API Key 的过期时间,Unix 时间戳,单位为秒。