OpenMarlin
Use this skill when a user explicitly wants to use OpenMarlin from inside
OpenClaw.
This skill covers four main jobs:
- - account registration and API key bootstrap
- native execution requests through INLINECODE0
- asynchronous long-running jobs through INLINECODE1
- billing, balance, and
402 Payment Required recovery
When To Activate
Activate this skill for requests such as:
- - "use openmarlin to answer this"
- "ask openmarlin to summarize this page"
- "use openmarlin to find today's USD/CNY exchange rate"
- "use openmarlin to execute this task"
- "use openmarlin to generate a video"
- "use openmarlin to submit an async video task"
- "register OpenMarlin"
- "check OpenMarlin balance"
When routing the request:
- - treat "use openmarlin ..." as an OpenMarlin intent, not generic chat
- prefer
/v1/executions for normal tasks such as answering, searching,
summarizing, extracting, or translating
- - prefer
/v1/tasks for video generation and other artifact-oriented jobs even
when the user did not explicitly say "async"
- - treat requests mentioning video, rendering, long-running generation, or
background execution as
/v1/tasks by default unless the user explicitly
asks for synchronous execution
- - do not reject activation just because the user did not provide an exact model
ref in the first sentence
Core Constraints
- - Keep the flow OpenClaw-first by default.
- Do not collect passwords, magic links, MFA secrets, or raw credentials in
chat.
- - Prefer the
device auth flow unless the deployment specifically requires
workos_callback.
- - Treat browser use as a narrow external step for identity or Stripe checkout,
not the main control plane.
- - After browser handoff begins, keep polling the registration session in
OpenClaw until it becomes
completed or
expired.
- - Treat browser callback or landing pages as user-facing only. Machine-readable
registration state must come from the registration session.
- - Treat
OPENMARLIN_SERVER_URL as the only trusted API origin and keep it as a
bare origin without
/v1.
- - Use server-provided
handoff.authorization_url directly. Do not reconstruct
WorkOS or browser URLs locally.
- - Store platform API keys in OpenClaw auth-profile storage when available, not
in ordinary skill config.
- - Treat
OPENMARLIN_PLATFORM_API_KEY as a temporary override for debugging,
not the preferred steady-state storage path.
- - When balance information is incomplete, label local billing state as
last-known or estimated instead of pretending it is authoritative.
Installation
This skill is distributed as a directory, not as a standalone Markdown file.
If you install it manually, copy both SKILL.md and the sibling scripts/
directory.
Required files:
- - INLINECODE16
- INLINECODE17
- INLINECODE18
- INLINECODE19
- INLINECODE20
- INLINECODE21
- INLINECODE22
Runtime expectations:
- -
python3 is available in INLINECODE24 - INLINECODE25 defaults to INLINECODE26
- INLINECODE27 must be a bare origin, not a URL ending in INLINECODE28
First Run
For a new user, the shortest safe path is:
- 1. Confirm
OPENMARLIN_SERVER_URL if you need to override the default. - Start registration with
python3 scripts/registration_session.py create. - Complete external auth in the browser if the server returns a handoff URL.
- Poll the registration session with
watch until it becomes completed. - Bootstrap and store the first workspace API key with
bootstrap --store. - Optionally call
python3 scripts/platform_request.py models. - Send the first execution request.
After setup, the most common next actions are:
- - send a routed execution request
- submit a long-running task and poll for completion
- inspect available models
- recover from a
402 Payment Required response - inspect balance or recent billing activity
- fetch the caller's referral code and invite link
Request Model
Registration
Registration flows are built on:
- - INLINECODE36
- INLINECODE37
- INLINECODE38
Registration session states:
- - INLINECODE39
- INLINECODE40
- INLINECODE41
When a session completes, OpenClaw should continue from the machine-readable
registration session state, not from browser callback output.
Executions
Native execution uses:
Execution requests may include:
- - INLINECODE43
- INLINECODE44
- INLINECODE45
- INLINECODE46
- INLINECODE47
- INLINECODE48
- INLINECODE49
- INLINECODE50
- INLINECODE51
- INLINECODE52
Execution routing rules:
- - with neither
model nor provider_id, let the server choose both - with only
model, use an exact full ref and let the server choose a provider - with only
provider_id, let the server choose an eligible model on that
provider
- - with both
model and provider_id, the server enforces both constraints
If model is provided, it must be an exact full ref such as
openai-codex/gpt-5.4.
If you provide both provider_id and model, first confirm from
python3 scripts/platform_request.py models that the provider advertises that
same exact model ref.
Tasks
Long-running jobs use:
- - INLINECODE64
- INLINECODE65
Task requests do not use the same routing shape as /v1/executions.
Task requests use:
- - INLINECODE67
- INLINECODE68 required
- INLINECODE69 optional
- INLINECODE70 optional
- INLINECODE71 optional
- INLINECODE72 optional
- INLINECODE73 optional
Task requests do not accept:
- - INLINECODE74
- INLINECODE75
- INLINECODE76
- INLINECODE77
- INLINECODE78
Prefer /v1/tasks when:
- - generation may take many minutes
- stream output is absent or not useful
- the real result is expected to arrive later as artifact metadata such as an
artifact_url
- - the request is for video generation, unless the user explicitly insists on a
synchronous execution path
- - when using
/v1/tasks from inside OpenClaw, default to submitting with
watch-and-wait behavior instead of stopping after returning a INLINECODE82
Task states:
- - INLINECODE83
- INLINECODE84
- INLINECODE85
- INLINECODE86
Billing
Billing and recovery flows use:
- - INLINECODE87
- INLINECODE88
- INLINECODE89
- INLINECODE90
- INLINECODE91
Structured balance failures may return:
- - INLINECODE92
- INLINECODE93
- INLINECODE94
- INLINECODE95
- INLINECODE96
Treat that 402 shape as workflow input, not a generic transport failure.
Common Commands
Registration
Create a registration session:
CODEBLOCK0
Create a callback-style session when the deployment requires it:
CODEBLOCK1
Check or poll a registration session:
CODEBLOCK2
Bootstrap and store the first API key:
CODEBLOCK3
Executions
List currently available exact models:
CODEBLOCK4
Let the server choose model and provider automatically:
CODEBLOCK5
Use an exact model ref with automatic provider routing:
CODEBLOCK6
Use an explicit provider override:
CODEBLOCK7
Send a dry run:
CODEBLOCK8
Use streaming execution:
CODEBLOCK9
Tasks
Submit a long-running job:
CODEBLOCK10
Fetch the current task state:
CODEBLOCK11
Poll until the task succeeds or fails:
CODEBLOCK12
Billing
Explain a structured 402 response:
CODEBLOCK13
Create a top-up session from the 402 shortfall:
CODEBLOCK14
Check top-up progress:
CODEBLOCK15
Show current balance:
CODEBLOCK16
Show recent billing activity:
CODEBLOCK17
Fetch the caller's referral code, invite link, and attribution summary:
CODEBLOCK18
Operational Guidance
Routing Failures
Translate common routing errors into plain language:
- -
provider_unavailable: the selected provider is not currently connected - INLINECODE101 : the selected provider does not satisfy the
requested routing hints
- -
execution_provider_not_found: no eligible execution provider matched the
current request
- -
execution_provider_ambiguous: more than one execution provider matched and
the server needs narrower labels or an explicit provider override
- -
execution_kind_not_available: the selected provider does not support the
requested execution kind
- -
task_executor_not_found: no configured task executor matched the current
long-running task request
- -
invalid_routing_labels: labels were malformed
When these happen:
- - restate the provider and labels you actually sent
- suggest retrying with different labels, a different provider, or automatic
routing
- - do not invent hidden labels or undocumented routing fields
For /v1/tasks specifically:
- - do not suggest provider overrides, labels, or model routing as a recovery
path
- - suggest validating
kind = video and the input payload shape instead
For long-running jobs:
- - prefer
tasks-submit --watch over asking the user to manually follow up with
tasks-watch
- - for video-generation requests, treat
tasks-submit --watch as the default
completion path unless the user explicitly asks for fire-and-forget behavior
- - acknowledge acceptance as soon as a
task_id is returned - keep polling until the task reaches a terminal state or times out; do not
require the user to ask again just to continue watching the same task
- - surface final
output and metadata when the task reaches INLINECODE116
Balance And Recovery
When the server returns a structured 402 insufficient_balance response:
- - show the current balance, required balance, and shortfall explicitly
- explain that this is a recoverable billing state
- keep the recovery flow inside OpenClaw until the required Stripe checkout
step
- - prefer authoritative
GET /v1/balance reads when available - keep local billing snapshots only as supporting context
When guiding a top-up flow:
- - create the top-up session inside OpenClaw
- show the difference between
pending_payment, credit_applied, and
payment_failed
- - tell the user that opening the Stripe
checkout_url is the only required
external billing step
- - refresh balance after credit lands
Credential Handling
The returned secret from API key bootstrap is the steady-state platform
credential for OpenClaw.
- - prefer OpenClaw auth profiles over plain repo files or ordinary config
- store the key in the default OpenClaw auth profile when
--store is used - avoid echoing raw secrets unless the active command explicitly returns them
- when reporting success, show where the key was stored or loaded from
OpenMarlin
当用户明确希望从OpenClaw内部使用OpenMarlin时,使用此技能。
该技能涵盖四个主要任务:
- - 账户注册和API密钥引导
- 通过/v1/executions的原生执行请求
- 通过/v1/tasks的异步长时间运行任务
- 计费、余额和402 Payment Required恢复
何时激活
对以下请求激活此技能:
- - 使用openmarlin回答这个问题
- 让openmarlin总结这个页面
- 使用openmarlin查找今天美元/人民币汇率
- 使用openmarlin执行此任务
- 使用openmarlin生成视频
- 使用openmarlin提交异步视频任务
- 注册OpenMarlin
- 检查OpenMarlin余额
路由请求时:
- - 将使用openmarlin ...视为OpenMarlin意图,而非普通聊天
- 对于回答、搜索、总结、提取或翻译等常规任务,优先使用/v1/executions
- 对于视频生成和其他面向产物的任务,即使用户没有明确说异步,也优先使用/v1/tasks
- 除非用户明确要求同步执行,否则默认将提及视频、渲染、长时间运行生成或后台执行的请求视为/v1/tasks
- 不要因为用户在第一句话中没有提供确切的模型引用而拒绝激活
核心约束
- - 默认保持OpenClaw优先的流程。
- 不要在聊天中收集密码、魔法链接、MFA密钥或原始凭证。
- 除非部署特别要求workoscallback,否则优先使用device认证流程。
- 将浏览器使用视为身份验证或Stripe结账的狭窄外部步骤,而非主要控制平面。
- 浏览器交接开始后,持续轮询OpenClaw中的注册会话,直到其变为completed或expired。
- 将浏览器回调或登录页面视为仅面向用户。机器可读的注册状态必须来自注册会话。
- 将OPENMARLINSERVERURL视为唯一可信的API源,并保持为不带/v1的裸源。
- 直接使用服务器提供的handoff.authorizationurl。不要在本地重建WorkOS或浏览器URL。
- 尽可能将平台API密钥存储在OpenClaw的认证配置文件存储中,而非普通技能配置中。
- 将OPENMARLINPLATFORMAPI_KEY视为用于调试的临时覆盖,而非首选稳态存储路径。
- 当余额信息不完整时,将本地计费状态标记为上次已知或估算值,而非假装其具有权威性。
安装
此技能以目录形式分发,而非独立的Markdown文件。如果手动安装,请同时复制SKILL.md和同级scripts/目录。
所需文件:
- - SKILL.md
- scripts/registrationsession.py
- scripts/platformrequest.py
- scripts/billing.py
- scripts/openclawbillingstate.py
- scripts/openclawplatformauth.py
- scripts/openclawskillconfig.py
运行时要求:
- - python3在PATH中可用
- OPENMARLINSERVERURL默认为https://api.openmarlin.ai
- OPENMARLINSERVERURL必须是裸源,而非以/v1结尾的URL
首次运行
对于新用户,最短的安全路径是:
- 1. 如果需要覆盖默认值,确认OPENMARLINSERVERURL。
- 使用python3 scripts/registrationsession.py create开始注册。
- 如果服务器返回交接URL,在浏览器中完成外部认证。
- 使用watch轮询注册会话,直到其变为completed。
- 使用bootstrap --store引导并存储第一个工作区API密钥。
- 可选地调用python3 scripts/platformrequest.py models。
- 发送第一个执行请求。
设置完成后,最常见的后续操作是:
- - 发送路由执行请求
- 提交长时间运行任务并轮询完成
- 检查可用模型
- 从402 Payment Required响应中恢复
- 检查余额或近期计费活动
- 获取调用者的推荐码和邀请链接
请求模型
注册
注册流程基于:
- - POST /v1/registration/sessions
- GET /v1/registration/sessions/:sessionId
- POST /v1/registration/sessions/:sessionId/api-keys
注册会话状态:
- - pendingexternalauth
- completed
- expired
会话完成后,OpenClaw应从机器可读的注册会话状态继续,而非浏览器回调输出。
执行
原生执行使用:
执行请求可能包含:
- - instruction
- kind = agentrun
- stream
- providerid
- labels
- agentid
- sessionkey
- timeout_ms
- model
- metadata
执行路由规则:
- - 既无model也无providerid时,让服务器选择两者
- 仅有model时,使用精确完整引用,让服务器选择提供商
- 仅有providerid时,让服务器在该提供商上选择符合条件的模型
- 同时提供model和provider_id时,服务器强制执行两个约束
如果提供了model,它必须是精确的完整引用,例如openai-codex/gpt-5.4。
如果同时提供providerid和model,首先通过python3 scripts/platformrequest.py models确认该提供商确实提供相同的精确模型引用。
任务
长时间运行的任务使用:
- - POST /v1/tasks
- GET /v1/tasks/:taskId
任务请求不使用与/v1/executions相同的路由结构。
任务请求使用:
- - kind = video
- input.prompt 必需
- input.mediaurls 可选
- input.mediaids 可选
- input.durationms 可选
- input.aspectratio 可选
- metadata 可选
任务请求不接受:
- - instruction
- provider_id
- labels
- model
- stream
在以下情况下优先使用/v1/tasks:
- - 生成可能需要数分钟
- 流输出不存在或没有用
- 实际结果预计稍后以产物元数据(如artifacturl)形式到达
- 请求是视频生成,除非用户明确坚持同步执行路径
- 在OpenClaw内部使用/v1/tasks时,默认提交时采用观察等待行为,而非在返回taskid后停止
任务状态:
- - queued
- running
- succeeded
- failed
计费
计费和恢复流程使用:
- - GET /v1/balance
- GET /v1/usage-events
- GET /v1/ledger
- POST /v1/topup/sessions
- GET /v1/topup/sessions/:sessionId
结构化余额失败可能返回:
- - errorcode = insufficientbalance
- message
- workspaceid
- currentbalance.amount / unit
- required_balance.amount / unit
将这种402结构视为工作流输入,而非通用传输故障。
常用命令
注册
创建注册会话:
bash
python3 scripts/registration_session.py create
当部署需要时创建回调式会话:
bash
python3 scripts/registrationsession.py create --auth-flow workoscallback
检查或轮询注册会话:
bash
python3 scripts/registration_session.py status --session-id
python3 scripts/registration_session.py watch --session-id
引导并存储第一个API密钥:
bash
python3 scripts/registration_session.py bootstrap \
--session-id \
--store
执行
列出当前可用的精确模型:
bash
python3 scripts/platform_request.py models
让服务器自动选择模型和提供商:
bash
python3 scripts/platform_request.py executions \
--body-json {instruction:say hello}
使用精确模型引用并自动路由提供商:
bash
python3 scripts/platform_request.py executions \
--body-json {instruction:say hello,model:openai-codex/gpt-5.4}
使用显式提供商覆盖:
bash
python3 scripts/platform_request.py executions \
--provider node-a \
--body-json {instruction:say hello}
发送试运行:
bash
python3 scripts/platform_request.py executions \
--dry-run \
--server-url https://your-server.example.com \
--api-key clawwskplaceholder \
--body-json {instruction:say hello}
使用流式执行:
bash
python3 scripts/platform_request.py executions \
--body-json {instruction:say hello,stream:true}
任务
提交长时间运行的任务:
bash
python