Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.atthene.com/llms.txt

Use this file to discover all available pages before exploring further.

Integration Overview

Once you’ve built and tested your agent in the Playground, you can integrate it into your applications using three methods:

REST API

Server-side integration with request/response pattern

WebSocket

Real-time streaming for interactive applications

Embedded Chatbot

Drop-in chat widget for websites

Before You Start

Get Your Credentials

1

Create an API Key

Navigate to Settings in the platform and generate an API key for authentication.
2

Get Your Agent Key

Find your agent’s unique identifier in Agent Overview or Agent Settings.
3

Enable Public Access (if needed)

For external integrations, enable public access and set an allowed origin URL in Agent Settings.

API Base URLs

  • REST API: https://api-be.atthene.com/api/v1/
  • WebSocket: wss://api-be.atthene.com/ws/amas

Authentication

All API requests require authentication using your API key:
x-api-key: YOUR_API_KEY_HERE
Please check out the API Introduction for full details on authentication and available endpoints.

Other headers

On POST requests, you can use Content-Type: application/json or application/yaml (see API Introduction for more details).

REST API Integration

Step 1: Create a Session

Before sending messages, create a session to establish context. An agent session represents a loaded configuration. Sessions can be created directly from a configuration or from an existing agent. (deployed version)
Use this method when connecting to a saved agent:
GET https://api-be.atthene.com/api/v1/sessions/from-agent/?agent_key={agent_key}
Headers:
x-api-key: YOUR_API_KEY
Response:
{
  "session_id": "sess_abc123xyz",
  "agent_key": "agent_456def",
  "created_at": "2025-10-06T10:30:00Z"
}

Step 2: Send Messages

Once you have a session ID, you can execute a user message on a session:
POST https://api-be.atthene.com/api/v1/runtime/{session_id}/execute
Headers:
x-api-key: YOUR_API_KEY
Content-Type: application/json
Body:
{
  "content": "What's the weather like today?",
  "correlation_id": "optional-tracking-id"
}
For simple text messages, use a string:
{
  "content": "What's the weather like today?"
}
Parameters:
  • content (required): User input - either a simple text string or an array of content blocks for multimodal messages
  • correlation_id (optional): Custom tracking ID for response identification.
Response:
{
  "type": "execution_result",
  "client_type": "backend",
  "session_id": "sess_abc123xyz",
  "status": "completed",
  "execution_time": 2.34,
  "messages": [
    {
      "type": "assistant_message",
      "role": "assistant",
      "content": "I'd be happy to help you check the weather...",
      "timestamp": "2025-10-06T10:31:00Z"
    }
  ],
  "error": null,
  "events": [],
  "timestamp": "2025-10-06T10:31:00Z",
  "correlation_id": "optional-tracking-id"
}
Response Fields:
  • type: Always “execution_result”
  • client_type: Always “backend”
  • session_id: The session ID used for execution
  • status: Execution status - “completed”, “error”, or “timeout”
  • execution_time: Time taken to execute in seconds
  • messages: Array of messages generated during execution (typically assistant responses)
  • error: Error message if status is “error”, otherwise null
  • events: Raw events collected during execution
  • timestamp: ISO timestamp when execution completed
  • correlation_id: The correlation ID from the original request (if provided)

Direct WebSocket Integration

Currently only supported with the embedded chatbot. Please let us know if you need this feature.

Embedded Chatbot

The easiest way to add your agent to a website is using the embedded chatbot widget.

Step 1: Configure Public Access

Before embedding, you must configure public access in Agent Settings.
  1. Go to Agent Overview and select your agent
  2. Open Agent Settings
  3. Enable Public Access
  4. Set Allowed Origin URL to your website domain
    • Example: https://your-website.com
    • This prevents unauthorized use of your agent
  5. Copy your Agent Key — you’ll need it in the next step

Step 2: Add the Widget

Add a container element and load the script:
<div id="atthene-chatbot-root"></div>
<script>
  document.addEventListener('DOMContentLoaded', function() {
    var script = document.createElement('script');
    script.src = 'https://static.arttacsolutions.com/js/atthene.js/latest/atthene.umd.js';
    script.async = true;
    script.onload = function() {
      setTimeout(function() {
        if (window.atthene && typeof window.atthene.initialize === 'function') {
          window.atthene.initialize({
            agentKey: 'YOUR_AGENT_KEY',
            elementId: 'atthene-chatbot-root',
            type: 'floatingButton',
            welcomeMessage: 'Hi! How can I help you?'
          });
        }
      }, 200);
    };
    document.head.appendChild(script);
  });
</script>
Replace YOUR_AGENT_KEY with the Agent Key from your agent settings.

Step 3: Customize the Widget

window.atthene.initialize({
  agentKey: 'YOUR_AGENT_KEY',
  elementId: 'atthene-chatbot-root',

  // Display mode: 'floatingButton' (default), 'inPlace', or 'modal'
  type: 'floatingButton',

  // Content
  welcomeMessage: 'Hi! How can I help you today?',
  placeholder: 'Type your message...',
  hintQuestions: [
    'What can you help me with?',
    'How do I get started?'
  ],

  // Appearance
  launcherRight: false,
  theme: {
    dark: false,
    accentColor: '#0066FF',
    launcher: {
      bg: '#0066FF',
      bgOpen: '#333333'
    }
  },

  // Branding
  images: {
    assistant: 'https://your-site.com/avatar.png',
    assistantNoBackground: true
  }
});

Widget API

Update the user token after initialization (e.g., after login):
// Update the user token for history persistence
window.atthene.updateUserToken('eyJhbGciOiJIUz...');
For the full configuration reference — including audio, voice settings, theming, and all available options — see the Embedding Chatbot guide.

Testing Your Integration

Test in Development

  1. Use Agent Preview First: Always test in the Playground before integrating
  2. Start with REST API: Simpler to debug than WebSocket
  3. Check Authentication: Verify your API key works with a simple GET request
  4. Monitor Tracing: Use the Tracing section to see what your agent receives

Common Integration Issues

Problem: Invalid or missing API keySolutions:
  • Verify API key is correct
  • Check header format: x-api-key: YOUR_KEY
  • Ensure key hasn’t been revoked
Problem: Origin URL not allowedSolutions:
  • Add your domain to Allowed Origin URL in Agent Settings
  • Include protocol: https://your-site.com not your-site.com
  • Check for typos in domain name
Problem: Can’t establish WebSocket connectionSolutions:
  • Ensure session was created via REST API first
  • Check that you’re using wss:// (secure WebSocket)
  • Verify firewall/proxy settings allow WebSocket
  • Check browser console for detailed errors
Problem: Messages sent but no responseSolutions:
  • Check agent status in Agent Overview
  • Verify session_id is correct
  • Look at Tracing logs for errors
  • Ensure agent configuration is valid

What’s Next?

Server-Sent Events (SSE) support is being considered for a future release. If SSE is important for your use case, please let us know via the feedback button!

Additional Resources

API Reference

Complete API documentation with all endpoints

YAML Configuration

Learn about complete agent configuration

Agent Capabilities

Explore tools, streaming, and other capabilities

Give Feedback

Request features or report integration issues