Skip to content

Developer docs

Haven developer docs

Everything you need to talk to your Haven agents from your own software: send a customer message, get the agent's answer, and read back what happened.

What you can do

  • Send a message to an agent and get its reply, as one JSON response or as a live stream.
  • Continue a conversation, list past conversations and read full transcripts with the tool-call record.
  • Check how many messages you have used and how many are left.
  • Retry safely: the same request sent twice is answered once and charged once.
  • Put a chat on your website with one line of HTML, with no key in the browser.

Quickstart

Four steps, about ten minutes.

  1. Subscribe to an agent from the pricing page and finish its setup in the dashboard. An agent that is not subscribed or not set up answers with an error instead of a reply.
  2. Create an API key in the dashboard under API keys. The full key (it starts with hk_) is shown once. Copy it into an environment variable on your server.
  3. Find the agent’s id: support_agent, sales_lead_agent or operations_agent.
  4. Send a message.
Send your first message (curl)curl https://api.safecoin.online/v1/agents/support_agent/messages \
  -H "Authorization: Bearer $HAVEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message": "Where is my order?"}'

The answer looks like this (see Talking to an agent for every field):

JSON
Example response (JSON){
  "conversationId": "7d0f6c1e-5b0a-4a7e-8f55-0c3a6a0b9d11",
  "reply": "I can check that for you. What is your order number?",
  "pendingApprovals": [],
  "toolCalls": [],
  "stopReason": "end_turn",
  "iterations": 1,
  "usage": { "used": 1, "cap": 1000, "remaining": 999, "periodEnd": "2026-11-19T00:00:00.000Z", "warning": null }
}

Base address and format

API basics
ItemValue
Base addresshttps://api.safecoin.online
FormatJSON in and out (Content-Type: application/json). The live chat route streams text/event-stream.
AuthenticationA bearer API key, see Authentication.
ErrorsAlways { "error": "code", "message": "…" }, see Errors.