Skip to content

Your AI agent answers over the API.

Bring your agent into your own software: a business app, a mobile app, or a customer portal can talk to it. You design the interface.

14 days free to try your agent · API from the Business plan · Cancel anytime

API

A small API for talking to your agent

Send a message, get the reply, and read back the session history when you need it, all with the same API key.

  • POST /api/v1/chat

    Send a message and get the answer. With a session_id the conversation continues.

  • POST /api/v1/chat/stream

    Like /api/v1/chat, but the answer streams in (SSE), word by word.

  • GET /api/v1/chat/{session}/history

    The full history of a session: messages, timestamps, and token counts.

  • POST /api/v1/chat/session

    Opens a session and returns the session_id. Optional: a session is created automatically with the first message.

APIexample
// Send a message to your agent
curl -X POST https://anydialog.com/api/v1/chat \
-H "X-API-Key: cs_live_***" \
-d '{"message": "What is your refund policy?"}'
// Response
{ "response": "Refunds are accepted within 30 days...",
"tokens": { "tokens_total": 91 },
"session_id": "sess_8f3k2m9x" }

Try it now

See the answers your app would receive.

This is AnyDialog's AI assistant. Over the API, the answer reaches your software, which displays it however you like.

AnyDialog AI assistant
Live

How we handle the data of this conversation: Privacy policy.

What changes over the API

Over the API, the conversation happens in your software: you decide the interface, and the agent prepares the replies.

01

Key-based access

Each key has a prefix (cs_live_*); we store only a hash of it, not the key itself. Pass it in the X-API-Key header. You can have several keys per agent and rotate them without interrupting service.

02

Sessions

With a session_id, the conversation keeps its thread from one request to the next: the agent takes into account what has already been said.

03

Conversation history

GET /api/v1/chat/{session}/history returns every message in a session. Useful to show the chat in your own interface.

04

Request limits

Each key can make 60 requests per minute, on every plan. The X-RateLimit-Remaining header tells you how many you have left.

05

Key management

In the dashboard you see your keys and when each was last used. Revoke the one you no longer need, and it stops working right away.

06

Any language

It's a REST API that exchanges JSON. Call it from Python, Node.js, PHP, Ruby, Go, Swift, Kotlin, or any language that can make an HTTP request.

How to connect it

From the key to the first request

You need a published agent and the plan that includes the API. Then you generate a key and send your first request.

  1. 01

    Generate an API key 1 min

    In the dashboard, open your agent, go to Channels, open API, and click “Generate key.” Copy it when it appears: it is shown only once. Keep it safe.

  2. 02

    Send your first request 2 min

    Put the key in the X-API-Key header, or send it as a Bearer token. POST your message to /api/v1/chat and you get the agent's reply.

  3. 03

    Manage sessions 1 min

    Open a session with POST /api/v1/chat/session. Read the history back with GET /api/v1/chat/{session}/history. Each session keeps the thread of the conversation.

The channel doesn't change what your agent can do

Each agent uses the same information and the same actions on every channel you turn on for it. With API, what changes is how you connect it and how the conversation looks.

Good to know

What to know before you integrate the API: rate limits apply to each key separately, and sessions don't expire.

  • Limits apply per key

    Each key can make 60 requests per minute. Go over that and you get a 429. Keep an eye on X-RateLimit-Remaining in the response headers.

  • Sessions don't expire

    With the same session_id the conversation picks up its thread even days later. To start from scratch, open a new session.

  • The agent must be published

    An agent in draft doesn't respond to API requests. Publish it from the dashboard before your integration goes live.

Bring your AI agent into your own software.

On the plan that includes the API, you generate a key and send your first request, with no library to install.

What it costs Included from the Business plan (499,00 € a month). See all plans

14 days free to try your agent · API from the Business plan · Cancel anytime