Skip to main content
DeepSeek Harness is a local coding agent that can inspect a workspace, invoke tools, and run commands while using an OpenAI-compatible Chat Completions endpoint for model requests.
This guide applies to deepseek-harness-sdk==0.1.0rc6 and deepseek-harness-runtime-bin==0.1.0rc6. Repeat the read-only fixture test below after upgrading the client.

Configuration

The model catalog changes over time. Query it with your dedicated Coding Plan key before setup:
Confirm that deepseek-v4-pro is present. Do not substitute deepseek-v4-flash for the tool-mode example: its multi-turn reasoning history and tool replay did not pass this pinned-version verification.

1. Get a dedicated Coding key

Open your Coding Plan application, then create or copy the API key attached to that Coding Application. Coding Plan does not consume the general balance, so a key from another application does not prove plan access. Export the key only in the current shell:
Never commit the key or include it in scripts, screenshots, or session artifacts.

2. Create a disposable workspace

The bundled Harness runtime includes a local Bash tool. Do not point the first test at a real repository or your home directory. Create a disposable directory with no secrets:
If your network uses a private PyPI mirror, make sure the same deepseek-harness-runtime-bin version is available. Do not broaden filesystem access with danger-full-access; this example passes only the disposable directory as cwd.

3. Run the official Python SDK

Save this as /tmp/deepseek-harness-demo/run.py:
Run it:
Expected output:
This verifies Bearer authentication, /v1/chat/completions, SSE, reasoning, tool calls, and tool-result replay. Delete /tmp/deepseek-harness-demo when finished. Treat retained session files as sensitively as source code because they may contain workspace context.

Troubleshooting

  • 401: export ACEDATACLOUD_API_KEY in the same shell that launches Python.
  • 403 or quota error: confirm that the key belongs to the active Coding Application and that Credits remain.
  • Model not listed: query /v1/models again instead of relying on an old screenshot.
  • reasoning_content or tool replay error: use the pinned SDK/runtime versions and deepseek-v4-pro.
  • Unexpected repeated tools: stop tasks with side effects and rerun this read-only fixture first.
  • Installation error: confirm Python 3.10+, supported OS/architecture, and matching SDK/runtime versions.

Scope

This guide verifies the local Python SDK with text and tool loops over Chat Completions. Images, Files API, /v1/responses, /v1/messages, remote workspaces, and a hosted sandbox are outside this guide. Workspace permissions and local command risks remain the responsibility of the machine running Harness.

Official references

Return to the Coding Plan Setup Center.