Threadwire by TriTech

← API reference

The AI agent

An instance can answer people who write to it by itself, with AI, from what you tell it about your business. It uses your own Anthropic or OpenAI API key: the AI's cost is on your account with them, and Threadwire adds nothing to it. Set a monthly spending limit with your provider.

Every answer is an ordinary reply from the instance, with the same protection as any message: "typing…" first, the reply's pace, and every limit. It never writes first to anyone.

What it answers, and when

  • A text someone just wrote to the instance, one to one. Never a group, a channel, a status, a file (even with a caption: the AI cannot see it), someone who wrote "STOP", the instance's own chat, another of your instances, or a message more than 15 minutes old.
  • Your keyword auto-replies answer first. When one answers a message, or the same keyword was answered moments ago, the AI says nothing: one answer per message. An away or welcome auto-reply that answers wins the same way.
  • With a menu of choices on, the menu is shown first and a choice is the menu's. The AI answers what is not a choice. After a choice hands the chat to your team, the AI stays quiet there until your team answers or marks it done, for 24 hours at most.
  • When: always, only outside_hours (your working_hours, in the instance's own time zone), or no_reply: only when nobody on your team answered within wait_minutes.
  • Your team takes over: once a teammate answers a chat (from the panel or the phone), the AI stays quiet there for 24 hours. Messages you send through the API do not hand over, since they are often order updates; to stop it in a chat, use the panel. In the panel, "Stop AI in this chat" stops it there for good, until "Let AI answer in this chat".
  • Limits: at most daily_limit AI replies a day on the instance (yours to set, up to 2,000), and at most 8 an hour and 30 a day to one person, so it never chats on and on with another bot.
  • A few messages sent in a row get one answer, about 10 seconds after the last.

What it knows

It answers only from your about text (up to 8,000 characters: what you sell and your prices, hours, address, delivery, returns, payment), your saved answers, the instance's keyword auto-replies, and the chat's last 10 messages. It is told never to invent prices, stock, times, discounts or promises: when the answer is not there, or for a complaint, a refund, a payment or a request for a person, it says a teammate will reply soon. It replies in the language they wrote in (auto), or always in Arabic or English (language), in a friendly or formal tone.

The chat stays under "Needs a reply" in your panel, so your team sees every question the AI answered. Its messages carry origin ai.

The API

GET /v1/instances/{id}/ai-agent
PATCH /v1/instances/{id}/ai-agent
{"enabled": true, "provider": "anthropic", "model": "claude-sonnet-5-5", "api_key": "sk-ant-…",
 "about": "We sell…", "tone": "friendly", "language": "auto", "answers": "outside_hours",
 "working_hours": {"days": [0, 1, 2, 3, 4], "from": "09:00", "to": "17:00"}, "daily_limit": 200}

Send only what changes. In working_hours, days are numbered from Sunday: 0 is Sunday, 6 is Saturday. api_key is write-only: answers show api_key_set and api_key_last4, never the key. models in the answer lists the models you may choose for each provider (anthropic, openai). Turning it on needs a key; changing provider needs that provider's key. PATCH needs a full-access key.

When it stops

If your provider refuses the key, your AI account has no credit, or the model is not open to your key, the agent pauses: it answers nobody, paused says why, the instance's page says "AI agent paused", and your admins get an email. Fix it, then save the settings again (PATCH with any field) or press "Test the key" in the panel. Any other failure (the provider slow or busy, or no answer it could send) skips that one message, notes it in last_error, and is never retried.

Your data

When the AI agent is on, the chat's recent messages and your business text go to the provider you chose, under your own account with them, to write each answer. We keep your key encrypted and your business text until you change them or remove the instance. See the Privacy Policy.