全球首个 智能体运行框架的统一接口开源4.6k由 UHP 提供支持

三种入门方式

快速入门

只需一个 API 密钥,即可为你的应用接入完整的智能体后端,无需自行开发运行框架。

在 HarnessRouter 中开始 描述它应完成的工作,并在 HarnessRouter 中配置其智能体运行框架。然后,你的编程智能体会构建你的应用,并通过 API 密钥将其连接到 HarnessRouter。
从你的代码库开始
  1. 01

    复制提示词并发送

    Build an agent-powered feature with HarnessRouter as its agent backend.
    Start by asking me: What do you want to ship to your users? Ask me if anything else is unclear.
    
    1. Read the setup guide first: https://harnessrouter.ai/agents.md (if you cannot open links, ask me to paste it).
    2. Open a secure secret prompt and ask me for my HarnessRouter API key. Store it as HR_API_KEY in my backend environment, replacing the existing value if there is one (any key of this workspace works for every setup in it). Never ask me to paste it into this chat. Never print, log or commit it, and never send it to the browser.
    3. Build the feature in my app. If this folder already has an app, add the feature there and keep its design and architecture. If it is empty, create a small web app for it first, and ask me which stack if it is unclear. Then add the HarnessRouter integration.
    4. Create one `harness` resource through the HarnessRouter API. Set its `base` to the selected agent harness, then configure its model and instructions. Agent harness: the one the guide recommends for this job. Model: the one the guide recommends. Give it a clear name and the feature’s standing instructions. If one with that name already exists in my workspace, reuse it.
    5. Call it from my backend as How it connects says below.
    6. Verify: send one real request through my app’s own code path and confirm a result comes back.
    7. Tell me its Harness ID.
    
    How it connects:
    My frontend talks only to my backend. It never calls HarnessRouter and never sees the key.
    My backend calls POST https://api.harnessrouter.ai/v1/responses, sending HR_API_KEY from its own environment as Authorization: Bearer <key>.
    One user request is one task: input is what my user typed, and metadata.harness_id is the Harness ID of the feature’s own setup on every request the feature sends, never another setup’s. My backend sets the Harness ID; never take it from the browser.
    Send previous_response_id, the id of the response it continues, only when my user follows up on the same result. Otherwise start a new task: a follow-up carries the earlier context and costs more.
    A task can take minutes. Send stream: true and pass its events to my frontend as progress, or send background: true and poll GET /v1/responses/{id} until its status is completed, failed, incomplete or cancelled.
    The finished response’s output holds the answer text, with each file the agent made as an annotation carrying its filename and download_url. GET /v1/sessions/{session_id}/files lists all of the task’s files (session_id is in the response’s metadata). My backend downloads them with the key and serves them to my frontend.
    Save each task’s response id and session_id with my user’s own record, so my app can show their tasks and continue them.
    
    Instructions are stored in the HarnessRouter setup, not in my app’s code or sent with every task. Keep a copy of the setup in my repo as harnessrouter.json (harness_id, name, base, model, instructions). To change it later, fetch the live setup first (it may have been edited in HarnessRouter), update harnessrouter.json, then apply it with the HarnessRouter API.
    在终端或桌面应用中,将提示词粘贴到 Claude Code 或 Codex 中。

    粘贴到你的编程智能体中

    在终端或桌面应用中,将提示词粘贴到 Claude Code 或 Codex 中。

  2. 02

    当它询问时,告诉它要构建什么

    记账智能体01 / 03

    构建带有面向用户界面的记账智能体。读取发票,提取供应商、总金额和税额,然后起草会计分录。不提供税务或法律建议。

    请先复制提示词以解锁

  3. 03

    创建 API 密钥

    当编程智能体提示时,将密钥粘贴到其安全密钥输入框中。它会将密钥以 HR_API_KEY 的形式存储在你应用的服务器上。

    请妥善保密。 请仅将密钥粘贴到由你的编程智能体打开的安全弹窗中。切勿将其粘贴到普通聊天、源文件、AGENTS.md、浏览器端代码、日志或截图中。

  4. 04

    它构建你的应用

    它会在你的应用中构建该功能,并保持原有设计。如果是空文件夹,它会先创建一个小型 Web 应用。

  5. 05

    它会连接到 HarnessRouter

    • 保存配置
    • 用真实任务进行验证