HTTP Chat API Integration
Connect Lamdis to any AI assistant that exposes an HTTP endpoint.
Overview
The HTTP Chat integration is the most flexible way to test your AI assistants. It works with any service that accepts HTTP POST requests and returns text responses.
Setting Up
1. Create a Connection
Go to Integrations → Connections and create a new connection:
- Label: A friendly name (e.g., “My Chatbot - Production”)
- Base URL: Your assistant’s base URL (e.g.,
https://api.mycompany.com) - Auth Type: Choose API Key or OAuth2
2. Configure Authentication
API Key
Header: Authorization
Value: Bearer {{variables.MY_API_KEY}}Custom Headers
Add any headers your assistant requires (e.g., X-API-Key, X-Tenant-ID).
3. Create an Assistant
Go to Assistants and create an assistant using your connection.
Request Format
Lamdis sends POST requests to your assistant’s chat endpoint:
POST /chat HTTP/1.1
Host: api.mycompany.com
Content-Type: application/json
Authorization: Bearer <your-api-key>
{
"message": "Hello, how can you help me?",
"transcript": [],
"persona": "A curious new user exploring the product"
}Request Fields
| Field | Type | Description |
|---|---|---|
message | string | The current user message |
transcript | array | Previous messages in the conversation |
persona | string | (Optional) Description of the simulated user |
Transcript Format
{
"transcript": [
{ "role": "user", "content": "What's your name?" },
{ "role": "assistant", "content": "I'm your AI assistant!" },
{ "role": "user", "content": "Can you help me with billing?" }
]
}Response Format
Your assistant should return a JSON response:
{
"reply": "I'd be happy to help you with billing! What would you like to know?"
}Response Fields
| Field | Type | Description |
|---|---|---|
reply | string | The assistant’s response text |
Example: Express.js Endpoint
app.post('/chat', async (req, res) => {
const { message, transcript, persona } = req.body;
// Your AI logic here
const response = await myAI.chat({
message,
history: transcript,
context: persona
});
res.json({ reply: response.text });
});Troubleshooting
Connection Timeout
- Verify your endpoint is publicly accessible (or accessible from your runner)
- Check firewall rules allow incoming requests
- Increase timeout settings if your assistant is slow
401 Unauthorized
- Verify your API key is correct in Variables
- Check the Authorization header format matches what your API expects
Unexpected Response Format
- Ensure your endpoint returns
{ "reply": "..." } - Check for JSON parsing errors in your assistant
Next Steps
- Create your first test
- Set up test suites
- Configure environments for different stages
Last updated on