Credentials. The Ark API key grants paid provider access, so store it in an environment variable and never commit it to the config file.
Who it is forA content developer who wants an agent to produce images or short videos as part of a workflow.
The problemAdding media generation to an agent means integrating provider APIs, handling failures, and tracking output files.
The outcomeAn agent that calls generate_image or generate_video and saves files under generated/images/ or generated/videos/ in its workspace.
What you need first
- Python 3.12 or newer
- An API key for at least one model provider (OpenAI, Anthropic, AWS Bedrock, or an OpenAI-compatible endpoint)
Steps
- Install Octop Harness and obtain a Volcengine Ark API key.
- Export the key as ARK_API_KEY in your shell environment.
- Add MediaGenerationConfig(api_key_env="ARK_API_KEY") to your HarnessAgentConfig.
- Start the agent and ask it to create an image or video through the generation tools.
- Check the generated/images/ or generated/videos/ folder in the workspace for the output file.
Prompt for your agent
In the TencentCloud/octop-harness repo, configure HarnessAgentConfig with MediaGenerationConfig using api_key_env="ARK_API_KEY". Ask the agent to generate an image of <subject>. Verify a new file appears under generated/images/ in the workspace.
Caveat. The README says the media tools are deferred and only appear through the configured tool-search strategy when needed, so the agent may need a prompt that triggers them.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for TencentCloud/octop-harness and "Add image and video generation to an agent with Volcengine Ark"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer