Перейти к содержимому
Обзор

API aichat.md

Подключите ИИ-агентов aichat.md к вашей CRM, Zapier, Make или n8n: лиды, диалоги, сообщения и вебхуки в реальном времени по одному API-ключу.

Для вашего ИИ-помощника по коду

Скопируйте текст и передайте его своему ИИ-помощнику по коду (Claude Code, Cursor, ChatGPT, Copilot). Он сам прочитает полную документацию и пошагово сделает интеграцию, не раскрывая ваш ключ.

You are integrating my system with the aichat.md public API (AI agents on Facebook, Instagram, WhatsApp, Telegram, 999.md and websites).

Before writing any code, read the complete documentation for agents: https://aichat.md/llms-api-full.txt
(index: https://aichat.md/llms-api.txt, interactive reference: https://aichat.md/en/docs/api/reference).

Facts:
- Base URL: https://aichat.md/api/public/v1
- Auth: header "Authorization: Bearer <key>". The key (aik_live_…) is created in aichat.md → Settings → Developers and is shown once.
- Read the key ONLY from the environment variable AICHAT_API_KEY. Never print it, log it, commit it or put it in browser/mobile code.
- Start with GET /me to check the key and its scopes. Ask for the smallest scopes the integration needs.
- Lists: cursor pagination (limit ≤ 100, next_cursor). Send an Idempotency-Key header on every POST.
- Respect 429 Retry-After and the RateLimit-* headers. Errors have the shape { error: { type, code, message, param, request_id } }.
- Prefer webhooks (lead.created, conversation.handoff_requested, message.received, credit.low) over polling.
- Every webhook request must be verified: HMAC-SHA256 of `${t}.${raw body}` with the whsec_ secret (env AICHAT_WEBHOOK_SECRET), header Aichat-Signature, 5-minute tolerance, constant-time compare. Answer 2xx within 10 s, process asynchronously, dedupe on the event id.
- Ignore response fields you do not know (the API adds fields without notice).

Your job:
1. Ask me what I want to automate (for example: new leads into my CRM, status back from the CRM, operator alerts) and which stack I use, if it is not clear from the project.
2. Propose a short plan: endpoints, webhook events, scopes, where the code runs.
3. Implement it with tests (mock the API in tests; never call it with a real key in CI), plus a README with the environment variables.
4. Show me how to test it end to end with "Send test" in Settings → Developers → Webhooks.

Reply to me in Russian.

Что можно сделать

  • Лиды и контакты — получайте лиды, которые собирают агенты (имя, телефон, email, резюме), и возвращайте статус из CRM.
  • Диалоги и сообщения — диалоги из Facebook, Instagram, WhatsApp, Telegram, 999.md и сайта; отвечайте как оператор, перехватывайте диалог или возвращайте агенту.
  • Агенты и каналы — список агентов, пауза и запуск, состояние каждого канала.
  • Знания — добавляйте веб-страницу или текст в знания агента.
  • Вебхуки — подписанные события в момент, когда они происходят.
  • ИИ-агенты (MCP) — подключите аккаунт к Claude, ChatGPT или Cursor и управляйте им обычными словами. См. MCP.

Основное

Базовый URLhttps://aichat.md/api/public/v1
АутентификацияAuthorization: Bearer aik_live_… — ключ из Настройки → Разработчикам
ФорматJSON, даты ISO 8601 UTC, ID с префиксом (lead_…, conv_…)
Лимиты120 запросов/мин на ключ, 600/мин на workspace
Версияv1 в URL; несовместимые изменения — только в v2

Ключ видит только данные workspace, который его создал. Объект другого аккаунта всегда отвечает 404, как будто его нет.

ДалееСтарт за 5 минут