Prerequisites: First read
../arkcli-shared/SKILL.mdto 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.mdmodels 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 searchBeing searchable does not mean OpenGetSampleCode has an example; do not interpret the backendModelVersion requiredas "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
--modelRequired, can pass a foundation model name or a merged ID (doubao-seedream-5-0-260128)--versionOptional; when not passed, the CLI derives it automatically (split the version from the merged ID → findArkModelsmatch → GetFoundationModel getPrimaryVersionfallback), and only errors out requiring an explicit--version- if none can be obtained
ModelVersionInternal mechanism: API constraintfinetune_inference, foundation model keepsquick_access --languageOptional:python/go/java/node/curl(shellis an alias ofcurl), default all--output-dirOptional, default./ark-examples/<model>--format jsonOutputs structured entries (includinglanguage/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-idhas 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 themodel="..."in the code to yourep-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
IOTypedimension), 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 jsonwhen 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
- references/arkcli-code-example.md — complete command manual
- arkcli-models / arkcli-deploy / arkcli-infer-endpoint / arkcli-shared