SuperAPI AI Directory

arkcli-code-example

Coding & development

View repository

Updated 10-16 04:43

About this skill

arkcli +code-example

Prerequisites: First read ../arkcli-shared/SKILL.md to learn about authentication, global parameters, and security rules.

Generates multilingual SDK sample invocation code for a specified foundation model, and writes it to a local file. The data source is Volcengine Ark OpenTOP OpenGetSampleCode。

When to use

  • The user says "generate sample code / SDK example / curl command / how do I call this model", and already knows the model name
  • Wants to save the multilingual invocation templates for a certain foundation model locally

Anti-routing(do not use this command):

  • Just wants to try out the model's behavior → ../arkcli-chat/SKILL.md(text/multimodal chat) or ../arkcli-gen/SKILL.md(image/video generation)
  • Doesn't know the model name yet → first ../arkcli-models/SKILL.md models search/get
  • Needs to create an endpoint first → ../arkcli-deploy/SKILL.md
  • Speech models (TTS / ASR / dubbing / narration / podcast / voice / real-time speech interaction, or doubao-seed-tts-* / doubao-seed-asr-* / seedasr-*) → do not use +code-example。models search Being searchable does not mean OpenGetSampleCode has an example; do not interpret the backend ModelVersion required as "adding a version will make generation work"; state that the current arkcli does not support sample code for speech models.

Quick start

# 拿某基础模型的全部语言示例(写入 ./ark-examples/<model>/)
arkcli +code-example --model doubao-seedream-5-0

# 指定版本 + 只看 Python + 结构化输出
arkcli +code-example --model doubao-seedream-5-0 --version 260128 --language python --format json
  • --model Required, can pass a foundation model name or a merged ID (doubao-seedream-5-0-260128)
  • --version Optional; when not passed, the CLI derives it automatically (split the version from the merged ID → find ArkModels match → GetFoundationModel get PrimaryVersion fallback), and only errors out requiring an explicit --version
  • if none can be obtained ModelVersion Internal mechanism: API constraint finetune_inference, foundation model keeps quick_access
  • --language Optional:python / go / java / node / curl(shell is an alias of curl ), default all
  • --output-dir Optional, default ./ark-examples/<model>
  • --format json Outputs structured entries (including language / io_type / install / code)
  • Speech models have no arkcli sample code path; when TTS / ASR / speech interaction is matched, stop at arkcli models search <keyword> discovery description, do not continue calling this command

0.1.17 changes: the old --endpoint-id has been removed — the new data source fetches code by foundation model and no longer supports fetching code by existing endpoint ID. If you need to point to an endpoint, after generation manually change the model="..." in the code to your ep-xxx。

Command list

Command Description
arkcli +code-example --model <name> [--version <ver>] [--language <lang>] [--output-dir <dir>] [--format json] Generate multilingual sample code and write it locally

Output forms

  • Local file: subdirectories by "IO task type" (aligned with the backend IOType dimension), files split by language under the same type; for languages with installation steps, the installation commands are written into the file header comment.
  • Structured JSON:--format json when set, gives entries expanded by (语言 × IO 类型) .
  • Human-readable: by default prints each code block in backend order.

For detailed parameters, directory structure examples, common flows, and FAQ, see references/arkcli-code-example.md。

Reference