Volcengine API Query Assistant
Answer user questions about Volcengine APIs by querying the API Explorer for authoritative, up-to-date information.
Applicable Scenarios
| Scenario | Example Questions |
|---|
| Find an API | "How do I list ECS instances?", "Is there a batch tag creation API?" |
| Query parameters |
"What are the required params for RunInstances?", "What values does ChargeType accept?" |
| Response structure | "What fields does DescribeInstances return?", "What statuses can Status have?" |
| Parameter dependencies | "If I set Ipv6Isp, how should I fill Ipv6MaskLen?", "When is SpotPriceLimit required?" |
| Pagination | "How do I paginate instance queries?", "How does NextToken work?" |
| Error codes | "What does InvalidInstanceId.NotFound mean?", "CreateVpc returns QuotaExceeded" |
| Browse services | "Which APIs does ECS have?", "What operations does VPC support?" |
| API comparison | "What's the difference between DescribeInstances and DescribeInstancesByIds?" |
Workflow
Step 1: Understand User Intent
Determine what the user is looking for:
| Intent | Signal | Query Path |
|---|
| Find an API | Describes an operation but doesn't know the API name | Search (2e) or Services (2a) -> API list (2c) -> Details (2d) |
| Query parameters |
Knows the API name, asks about params/enums/required fields | Go directly to Details (2d) |
|
Query response | Asks about return fields or status values | Go directly to Details (2d), focus on response schema |
|
Query parameter dependencies | Asks "when is X required?" or "how does X relate to Y?" | Go directly to Details (2d), focus on conditional rules in descriptions |
|
Query error codes | Provides an error code or error message | Error code handling (Step 3) |
|
Browse a service | Asks what capabilities a service offers | Services (2a) -> API list (2c) |
|
Compare APIs | Asks about differences between two APIs | Query Details (2d) for each, compare params and functionality |
Step 2: Query API Information Progressively
Start from the appropriate sub-step based on what is already known. When the user describes a requirement in natural language, Search (2e) is often faster than browsing level by level.
2a. Query service list (when the service is unknown)
CODEBLOCK0
Each service in the response contains:
- -
ServiceCode: service identifier (e.g., ecs, vpc) - INLINECODE3 : Chinese name (e.g., "cloud server", "virtual private cloud")
- INLINECODE4 : product identifier (e.g.,
ECS, VPC) - INLINECODE7 :
regional or INLINECODE9
Match the most appropriate ServiceCode based on the user's description.
2b. Query version list (when the version is unknown)
CODEBLOCK1
Each version contains:
- -
Version: version string (e.g., 2020-04-01) - INLINECODE13 :
1 indicates the default version
Prefer the version with IsDefault=1. If none is marked default, use the latest version.
2c. Query API list (when the specific API is unknown)
CODEBLOCK2
The response groups APIs by category. Each API contains:
- -
Action: API name (e.g., DescribeInstances) - INLINECODE18 : Chinese name (e.g., "Query instance list")
- INLINECODE19 : group name (e.g., "Instance", "Image")
- INLINECODE20 : functional description
- INLINECODE21 : usage scenarios
- INLINECODE22 : constraints and caveats
Match user intent using Action, NameCn, and Description.
2d. Query API details (core step)
CODEBLOCK3
Returns the full Swagger/OpenAPI specification for the API. Extract key information as follows.
HTTP Method
The key under paths["/{ActionName}"] (get or post) indicates the HTTP method.
Request Parameters
Parameter location depends on the HTTP method:
GET requests: parameters are in paths["/{ActionName}"].get.parameters. Each parameter includes:
- -
name: parameter name - INLINECODE31 : whether it is required
- INLINECODE32 : data type
- INLINECODE33 : parameter description (often contains enum values, conditional rules, and value ranges)
- INLINECODE34 : allowed values (if any)
- INLINECODE35 : default value (if any)
- INLINECODE36 : example value (if any)
Arrays and nested objects in GET parameters use naming conventions:
- - Arrays:
ParamName.N (N starts from 1), e.g., InstanceIds.1, INLINECODE39 - Nested objects:
Parent.Child, e.g., TagFilters.N.Key, INLINECODE42
POST requests: parameters are in paths["/{ActionName}"].post.requestBody.content["application/json"].schema, using JSON Schema:
- -
properties: parameter definitions, keyed by name - INLINECODE45 : array of required parameter names
POST parameters often have nested structures that require recursive parsing:
- -
type: object -> inspect properties for child parameters - INLINECODE48 -> inspect
items for element structure - INLINECODE50 -> look up the definition in
components.schemas and expand recursively
Present nested parameters in a tree structure:
CODEBLOCK4
Parameter Dependencies
Many parameters have conditional dependencies, typically described in the description field. Watch for:
- - Conditionally required: e.g., "required when
EnableIpv6 is true" - Mutually exclusive: e.g., "when
Ipv6CidrBlock is specified, Ipv6MaskLen is ignored" - Value constraints: e.g., "when
Ipv6Isp is BGP, only 56 is supported" - Prerequisites: e.g., "
TagFilters.N.Values.N requires TagFilters.N.Key to be set first"
Highlight these dependencies in the answer to help users avoid misconfiguration.
Pagination Parameters
Volcengine APIs use two common pagination patterns, identifiable from the Swagger parameters:
- - Token-based: uses
MaxResults (page size) + NextToken (continuation token). The response includes NextToken; an empty value means the last page. - Offset-based: uses
PageSize + PageNumber (or Offset/Limit). The response includes TotalCount.
Specify which pagination pattern the API uses, along with default values and upper limits.
Response Structure
The response schema is defined at paths["/{ActionName}"].{method}.responses["200"].content["application/json"].schema, and may reference components.schemas via $ref.
Key response information:
- - Field names, types, and descriptions
- Enum fields and their possible values (e.g.,
Status: RUNNING / STOPPED / CREATING) - Nested object structures (e.g., fields within each item in an
Instances array)
The info.x-demo section also provides useful reference — responseDemo[0].Code shows the complete response structure with example values.
Request/Response Examples
In the info.x-demo array:
- -
requestDemo[0].Code: request example (shows how parameters are filled) - INLINECODE76 : response example (shows the full return structure with sample values)
These are official examples and highly valuable. Proactively include them in the answer.
Associated Error Codes
In paths["/{ActionName}"].{method}.responses["x-error-code"].content["application/json"].schema.oneOf, each error code contains:
- -
code: error code identifier (e.g., InvalidInstanceId.NotFound) - INLINECODE80 : HTTP status code (e.g., 400, 404, 409, 429, 500)
- INLINECODE81 : English description
- INLINECODE82 : Chinese description
2e. Search APIs (quick lookup)
When the user describes a requirement in natural language, searching is often the fastest approach. This can be used alongside steps 2a–2c.
CODEBLOCK5
Search terms can be in Chinese or English. If one keyword yields poor results, try synonyms, different granularity, or English Action-name style (e.g., "DescribeXxx").
Each result contains:
- -
BizInfo.Action: API name - INLINECODE84 : service identifier
- INLINECODE85 : service Chinese name
- INLINECODE86 : version
- INLINECODE87 : matched highlight text
After finding the target API, use step 2d to get full details.
Step 3: Handle Error Code Queries
Error code queries need special handling because the same error code (e.g., InvalidParameter) may appear across dozens of APIs with different meanings.
Common Error Code Categories
| Category | Common Patterns | Typical Cause |
|---|
| Parameter error | INLINECODE89 , InvalidParameterValue, INLINECODE91 | Typo in parameter name, value outside enum range, missing required parameter |
| Resource not found |
InvalidXxx.NotFound,
ResourceNotFound | Wrong resource ID, resource in a different region, already deleted |
| Resource status |
InvalidXxx.InvalidStatus,
IncorrectInstanceStatus | Current resource state does not allow this operation (e.g., modifying config without stopping the instance) |
| Quota/limit |
QuotaExceeded,
LimitExceeded | Account quota or API rate limit exceeded |
| Permission denied |
UnauthorizedOperation,
Forbidden | IAM policy not authorized, sub-account lacks permissions |
| Throttling |
Throttling,
RequestLimitExceeded | API call rate too high — reduce request rate or use exponential backoff |
| Server error |
InternalError,
ServiceUnavailable | Temporary server-side issue, usually retryable |
| Resource conflict |
ResourceInUse,
DuplicateXxx,
OperationConflict | Resource is in use or name already exists |
When the user provides a specific API name
Query the API Swagger via step 2d and locate the error code in x-error-code. This is the most accurate approach because the same error code can have different meanings across APIs.
Combine the description (Chinese) and message (English) fields to provide:
- 1. Error meaning
- Specific trigger conditions in the context of this API
- Troubleshooting steps and resolution suggestions
When the user provides only the error code
- 1. Ask for context first: ask which API triggered the error — this enables precise diagnosis. The same
InvalidParameter means entirely different things in RunInstances vs. CreateVpc. - If the user provides a service name but no API name: infer the most likely API from the error pattern and context, then query its Swagger to confirm.
- Fallback search: if the user cannot provide more context, use the error code search endpoint:
CODEBLOCK6
Each result contains:
- -
Type: INLINECODE114 - INLINECODE115 : service identifier
- INLINECODE116 : service Chinese name
- INLINECODE117 : version
- INLINECODE118 : error code documentation link
- INLINECODE119 : matched highlight text
Since the same error code appears across multiple services, results may be numerous. Filter by any context the user has provided (service name, operation type, scenario).
Step 4: Compose the Answer
Organize a clear, professional answer based on the question type. Core principle: center on the user's question — extract the information the user needs rather than dumping the entire Swagger.
Finding an API
- 1. Recommend the API and explain why
- Briefly describe its functionality and use case
- List core required parameters
- If multiple candidates exist, compare their use cases and let the user choose
Querying Parameters
- 1. State the HTTP method (GET/POST)
- Required parameters first: list with type, description, and enum values
- Use tree structure for nested parameters, marking required/optional at each level
- Parameter dependencies: highlight conditional requirements, mutual exclusions, and value constraints
- Describe the pagination pattern and default values separately
- Show the request example (from x-demo)
- Group optional parameters by function (filters, sorting, advanced config) and list briefly
Querying Response Structure
- 1. List key return fields with type and description
- Show all possible values for enum fields
- Use tree structure for nested objects
- Show the response example (from x-demo responseDemo)
Querying Error Codes
- 1. Error meaning (Chinese and English descriptions)
- Error category (parameter error / resource not found / permission denied, etc.)
- Common causes
- Specific troubleshooting steps and resolution suggestions
- For throttling errors, recommend a retry strategy
Browsing Service Capabilities
- 1. Organize the API list by INLINECODE120
- Show Action name + Chinese name + one-line description for each API
- If there are many APIs, prioritize core/commonly-used ones
Comparing APIs
- 1. Describe the functional purpose of each API
- Compare applicable scenarios
- Compare parameter differences (which is simpler, which is more flexible)
- Provide a usage recommendation
Query Efficiency Tips
- - API name known: go directly to 2d — one step
- Service name known: 2b -> 2c -> 2d, or search in parallel via 2e
- Only a natural-language description: prefer 2e search — faster than browsing level by level
- Completely uncertain: combine 2a (service list) + 2e (keyword search)
- Error code lookup: if an API name is available, go to 2d; otherwise, ask the user for context first
Important Notes
- - Always fetch the latest data from the API Explorer endpoints — Volcengine APIs are updated frequently, so do not rely on memory
- Match the answer language to the user's language (Chinese question -> Chinese answer, English -> English)
- If the user's description is ambiguous, list possible options and ask for confirmation rather than guessing
- If the user needs runnable SDK code, direct them to the
volcengine-sdk-generator skill - If the user needs CLI-based operations, direct them to the
volcengine-cli skill - When presenting parameter information, enum values, conditional rules, and value ranges in the description field are the most valuable content — do not omit them
- If a network error occurs during queries, inform the user and suggest retrying later
Volcengine API 查询助手
通过查询API Explorer获取权威、最新的信息,回答用户关于火山引擎API的问题。
适用场景
| 场景 | 示例问题 |
|---|
| 查找API | 如何列出ECS实例?, 是否有批量创建标签的API? |
| 查询参数 |
RunInstances的必填参数有哪些?, ChargeType接受哪些值? |
| 响应结构 | DescribeInstances返回哪些字段?, Status可以有哪些状态? |
| 参数依赖 | 如果设置了Ipv6Isp,应该如何填写Ipv6MaskLen?, 什么时候需要SpotPriceLimit? |
| 分页 | 如何对实例查询进行分页?, NextToken是如何工作的? |
| 错误码 | InvalidInstanceId.NotFound是什么意思?, CreateVpc返回QuotaExceeded |
| 浏览服务 | ECS有哪些API?, VPC支持哪些操作? |
| API对比 | DescribeInstances和DescribeInstancesByIds有什么区别? |
工作流程
步骤1:理解用户意图
确定用户正在寻找什么:
| 意图 | 信号 | 查询路径 |
|---|
| 查找API | 描述了一个操作但不知道API名称 | 搜索(2e)或服务(2a) -> API列表(2c) -> 详情(2d) |
| 查询参数 |
知道API名称,询问参数/枚举/必填字段 | 直接进入详情(2d) |
|
查询响应 | 询问返回字段或状态值 | 直接进入详情(2d),关注响应模式 |
|
查询参数依赖 | 询问什么时候X是必填的?或X和Y有什么关系? | 直接进入详情(2d),关注描述中的条件规则 |
|
查询错误码 | 提供了一个错误码或错误信息 | 错误码处理(步骤3) |
|
浏览服务 | 询问一个服务提供哪些能力 | 服务(2a) -> API列表(2c) |
|
对比API | 询问两个API之间的区别 | 查询每个API的详情(2d),比较参数和功能 |
步骤2:逐步查询API信息
根据已知信息从适当的子步骤开始。当用户用自然语言描述需求时,搜索(2e)通常比逐级浏览更快。
2a. 查询服务列表(当服务未知时)
GET https://api.volcengine.com/api/common/explorer/services
响应中的每个服务包含:
- - ServiceCode:服务标识符(例如,ecs,vpc)
- ServiceCn:中文名称(例如,云服务器,私有网络)
- Product:产品标识符(例如,ECS,VPC)
- RegionType:regional 或 global
根据用户的描述匹配最合适的 ServiceCode。
2b. 查询版本列表(当版本未知时)
GET https://api.volcengine.com/api/common/explorer/versions?ServiceCode={ServiceCode}
每个版本包含:
- - Version:版本字符串(例如,2020-04-01)
- IsDefault:1 表示默认版本
优先选择 IsDefault=1 的版本。如果没有标记为默认,则使用最新版本。
2c. 查询API列表(当具体API未知时)
GET https://api.volcengine.com/api/common/explorer/apis?ServiceCode={ServiceCode}&Version={Version}&APIVersion={Version}
响应按类别对API进行分组。每个API包含:
- - Action:API名称(例如,DescribeInstances)
- NameCn:中文名称(例如,查询实例列表)
- ApiGroup:组名(例如,实例,镜像)
- Description:功能描述
- UsageScenario:使用场景
- Attentions:约束和注意事项
使用 Action、NameCn 和 Description 匹配用户意图。
2d. 查询API详情(核心步骤)
GET https://api.volcengine.com/api/common/explorer/api-swagger?ServiceCode={ServiceCode}&Version={Version}&APIVersion={Version}&ActionName={ActionName}
返回API的完整Swagger/OpenAPI规范。按如下方式提取关键信息。
HTTP方法
paths[/{ActionName}] 下的键(get 或 post)表示HTTP方法。
请求参数
参数位置取决于HTTP方法:
GET请求: 参数位于 paths[/{ActionName}].get.parameters。每个参数包括:
- - name:参数名称
- required:是否必填
- schema.type:数据类型
- schema.description:参数描述(通常包含枚举值、条件规则和取值范围)
- schema.enum:允许的值(如果有)
- schema.default:默认值(如果有)
- schema.example:示例值(如果有)
GET参数中的数组和嵌套对象使用命名约定:
- - 数组:ParamName.N(N从1开始),例如,InstanceIds.1,InstanceIds.2
- 嵌套对象:Parent.Child,例如,TagFilters.N.Key,TagFilters.N.Values.N
POST请求: 参数位于 paths[/{ActionName}].post.requestBody.content[application/json].schema,使用JSON Schema:
- - properties:参数定义,按名称键控
- required:必填参数名称的数组
POST参数通常具有需要递归解析的嵌套结构:
- - type: object -> 检查 properties 以获取子参数
- type: array -> 检查 items 以获取元素结构
- $ref: #/components/schemas/XxxObject -> 在 components.schemas 中查找定义并递归展开
以树形结构呈现嵌套参数:
- - InstanceId (string, required):实例ID
- DatabasePrivileges (array, optional):数据库权限列表
- AccountName (string, required):账号名称
- AccountPrivilege (string, required):权限类型 — 枚举:ReadWrite, ReadOnly, ...
- AccountPrivilegeDetail (string, optional):权限详情,逗号分隔
参数依赖
许多参数具有条件依赖关系,通常在 description 字段中描述。注意:
- - 条件必填:例如,当 EnableIpv6 为 true 时必填
- 互斥:例如,当指定了 Ipv6CidrBlock 时,Ipv6MaskLen 被忽略
- 值约束:例如,当 Ipv6Isp 为 BGP 时,仅支持 56
- 前置条件:例如,TagFilters.N.Values.N 需要先设置 TagFilters.N.Key
在回答中突出显示这些依赖关系,以帮助用户避免配置错误。
分页参数
火山引擎API使用两种常见的分页模式,可从Swagger参数中识别:
- - 基于Token:使用 MaxResults(每页大小)+ NextToken(连续令牌)。响应包括 NextToken;空值表示最后一页。
- 基于偏移量:使用 PageSize + PageNumber(或 Offset/Limit)。响应包括 TotalCount。
指定API使用哪种分页模式,以及默认值和上限。
响应结构
响应模式定义在 paths[/{ActionName}].{method}.responses[200].content[application/json].schema,并可能通过 $ref 引用 components.schemas。
关键响应信息:
- - 字段名称、类型和描述
- 枚举字段及其可能的值(例如,Status:RUNNING / STOPPED / CREATING)
- 嵌套对象结构(例如,Instances 数组中每个项内的字段)
info.x-demo 部分也提供了有用的参考 — responseDemo[0].Code 显示了带有示例值的完整响应结构。
请求/响应示例
在 info.x-demo 数组中:
- - requestDemo[0].Code:请求示例(显示参数如何填写)
- responseDemo[0].Code:响应示例(显示带有示例值的完整返回结构)
这些是官方示例,非常有价值。主动将它们包含在回答中。
关联错误码
在 paths[/{ActionName}].{method}.responses[x-error-code].content[application/json].schema.oneOf 中,每个错误码包含:
- - code:错误码标识符(例如,InvalidInstanceId.NotFound)
- http_code:HTTP状态码(例如,400, 404, 409, 429, 500)
- message:英文描述
- description:中文描述
####