SSE Configuration Guide
This guide explains how to configure the SSE adapter and connect a custom client to Nekro Agent.
Scope of Use
This adapter is only suitable for users who already understand the related protocol details and are already familiar with Nekro Agent.
Before You Start
- You have already deployed Nekro Agent
- You have prepared a custom client or web frontend that will connect to it
- You know how to send requests to an HTTP endpoint and keep an SSE long-lived connection
Step 1: Enable SSE in Nekro Agent first
- Open
Adapter Configuration->SSE - Turn on
ENABLED - Fill in
ACCESS_KEYif needed - Turn on
ALLOW_FILE_TRANSFERif you need to send files - Save the settings and restart Nekro Agent
Step 2: Decide how the client should connect
The two most commonly used endpoints of the SSE adapter are:
- Establish the connection:
GET /api/adapters/sse/connect- Send commands:
POST /api/adapters/sse/connectIf you set ACCESS_KEY, the client must provide the same access key as well.
Step 3: Let the client establish the SSE connection
When the client establishes the connection, these parameters are commonly used:
client_nameplatformaccess_key
Example:
GET /api/adapters/sse/connect?client_name=my-web&platform=web&access_key=your_keyOnce the connection is established, Nekro Agent can push messages to this client.
Step 4: Include the required request headers when sending commands
When sending requests to the command endpoint, you will usually need:
X-Client-IDX-Access-Key
If you did not set ACCESS_KEY, X-Access-Key can be omitted.
Step 5: Confirm that the setup works
- Let the client establish the SSE long connection first
- Send a test message to this SSE chat from Nekro Agent
- If the client receives it, the setup is successful
The settings you need to understand most
Access Key: Whether to add an access checkAllow File Transfer: Whether to allow file and image transferMaximum File Size (Bytes): File size limitAllowed File Types: Which file types are allowedResponse Timeout (Seconds): How long to wait for a client acknowledgmentIgnore Client Response: Whether to ignore the client acknowledgment
What the chat key looks like after setup
The common internal chat key format for SSE is:
sse-{platform}-{channel_id}For example:
sse-web-private_user001Common Problems
The client cannot connect
Check these first:
- Whether the SSE adapter is enabled in Nekro Agent
- Whether the access address is correct
- Whether
access_keymatches the server side
The message was sent, but Nekro Agent says it failed
This usually means the client did not return an acknowledgment in time. You can:
- Fix the client acknowledgment logic first
- Or temporarily turn on
IGNORE_RESPONSE
However, the second option is only suitable for debugging, because it may mark an undelivered message as successful.
