운영
Connect OpenClaw to API Stock
Configure a model provider, check your connection and add image, video and music tools to an OpenClaw agent.
Use API Stock for the model that runs your OpenClaw agent, for media tools, or for both. Chat requests and media generations use your prepaid balance. Start by checking your API key and choosing a model, then give the agent one small task with a spending limit you approve.
Download the OpenClaw bundle or create an API key.
What can you build?
| Task | Connection | Result |
|---|---|---|
| Write or edit local files with an agent | Chat model provider | OpenClaw uses a selected model for its reasoning and tool calls. |
| Build a product page with an illustration | Media skill | The agent waits for the image and uses it in a local page. |
| Prepare a content kit | Media skill | Local draft copy, a cover and an optional video. |
The bundle includes runnable task briefs for the last two examples. They are recipes, not customer case studies or pre-generated model results.
Check your account and model
The same files are public at
[github.com/API Stock/api-stock-openclaw](https://github.com/API Stock/api-stock-openclaw):
review them there or git clone the repository instead of downloading.
Extract the bundle and open its directory. The helper requires Python 3.10+
and its standard library. Provide API_STOCK_KEY through your runtime's
environment or secret configuration. Keep the key out of prompts and files.
Use the account and key belonging to this storefront.
unzip api-stock-openclaw.zipcd api-stock-openclawpython3 skills/api-stock-media/scripts/api_stock.py doctor
doctor reads the model list and current token prices. It does not generate
text or media, so this check creates no paid request. Discovery alone does
not establish tool-calling compatibility with every model.
For an API Hubs account, add --site apihubs before the helper command:
python3 skills/api-stock-media/scripts/api_stock.py --site apihubs doctor
Add a chat provider
Choose an exact model id returned by doctor. This example produces a config
fragment; it does not overwrite your OpenClaw configuration:
python3 skills/api-stock-media/scripts/api_stock.py config \--model gpt-6-luna > api-stock-provider.json
For API Hubs, use --site apihubs before config too. Merge the fragment
into OpenClaw's config while preserving your existing providers, tools and
channels. It sets a default model; retain your current default if you only
want another selectable model. The fragment references ${API_STOCK_KEY}
instead of embedding a credential.
The connection uses https://api.api-stock.com/api/v1 with the
openai-completions adapter. Select Chat Completions: the Responses API is
not exposed by this integration. API Hubs uses its own API origin.
openclaw config validateopenclaw models list
The generated context and output values are conservative client budgets, not the model's maximum capabilities. The fragment does not populate token prices in OpenClaw; check the current API Stock prices and dashboard billing instead of treating a missing local cost estimate as free usage.
Give your agent media tools
Install the reviewed skill in OpenClaw's managed skills directory, preserving any customized copy you already have:
mkdir -p ~/.openclaw/skillsif mkdir ~/.openclaw/skills/api-stock-media; thencp -R skills/api-stock-media/. ~/.openclaw/skills/api-stock-media/elseecho "Skill already exists or cannot be created. Preserve it and compare before installing." >&2fiopenclaw skills check
Start a new session after installing the skill. The Gateway process needs the key in its own environment. For a sandboxed agent, make Python, the skill and the credential available inside the sandbox; host environment injection does not automatically reach containers.
Try the included examples/product-page/TASK.md: it asks the agent to quote
an illustration, wait for its finished task and build a local HTML page.
Read the media walkthrough for spending controls
and recovery after an interrupted request.
Check a complete agent task
Before choosing a default model, run a task that actually needs a tool and verify that the agent uses its result. A successful text response is only the first part of this check. Record the exact model, task outcome, number of attempts and observed charge. Compare models on the same task using the selection checklist.
The bundle's compatibility check uses OpenClaw 2026.10.9 and a deterministic local API fixture. It exercises configuration, streaming, a tool call and media-task completion without paying for a generation. It does not establish production quality, latency or compatibility for every upstream model. A separate live media check records the selected models, two agent attempts and the finished image.
Troubleshooting
| Symptom | Next step |
|---|---|
| HTTP 401 | Check the API key and storefront. |
| Model not found | Run doctor and use an exact id from the response. |
Agent requests /responses | Select openai-completions and the /api/v1 base URL. |
| Media skill is missing | Run openclaw skills check; check Python and the agent runtime's key. |
| No usable tool result | Test the exact model with a tool turn; check its supported request fields. |
| Insufficient balance | Check the quote and actual payment methods before topping up. |
For clients supporting remote MCP with OAuth, the existing MCP server is another media-tool connection. It is separate from the model provider. For current usage rates, open pricing.
Configuration references: OpenClaw providers and OpenClaw skills.
