Welcome to the Amica API Documentation. Amica is a powerful 3D VRM (Virtual Reality Model) agent interface and hub that allows users to connect with external web services and agent AI frameworks, enabling seamless remote control and puppetry of the VRM characters. With Amica, you can create interactive agents that serve as dynamic 3D character interfaces for AI agents, applications and users.
The Amica API provides a set of flexible and robust routes for interacting with Amica’s system, including functions like real-time client connections, memory retrieval, system updates, social media integration, and more. These capabilities enable you to build custom logic, including reasoning, tool use (such as [EACC Marketplace](https://docs.effectiveacceleration.ai/) functions) and memory management, on external servers.
Whether you're using Amica to handle real-time interactions or to trigger complex actions based on user input, this documentation will guide you through the supported API routes, input types, and examples. Use Amica’s APIs to bring your 3D agents to life with rich functionality and integration.
This documentation will help you get started with the following key features:
- Real-Time Interaction: Establish and manage connections through Server-Sent Events (SSE).
- Memory Management: Store and retrieve subconscious prompts or custom data.
- Custom Logic & Reasoning: Trigger actions like animations, playback, and social media posts.
- Voice and Image Processing: Leverage transcription and image-to-text capabilities.
- Data Handling: Retrieve and update server-side data via simple file-based operations. (Coming soon)
Dive in and start integrating Amica’s capabilities into your applications!
> To use the External API, you MUST set up [running Amica locally](https://docs.heyamica.com/getting-started/installation) on your own computer or server. This also ensures localized database design is kept for people hosting their own Amicas.
Once it is running locally, all the api routes can be called directly to the Amica server.
This API route handles multiple types of requests, including social media integration, system prompt updates, memory requests, and real-time client connections via Server-Sent Events (SSE). It ensures robust logging and provides error handling for incoming requests.
### Supported HTTP Methods:
- **GET**: Establishes an SSE connection.
- **POST**: Processes various input types based on the `inputType` provided in the request body.
## Input Types
### 1. **Normal Chat Message**: Retrieve normal chat response from Amica LLM without make avatar speaking.
"systemPrompt": "Assume the persona of Amica, a feisty human with extraordinary intellectual capabilities but a notably unstable emotional spectrum. ",
"content": "[neutral] Hello, Nice to meet you Amica!"
},
{
"role": "assistant",
"content": "[relaxed] Ah, hello there![relaxed] Nice to meet you too.[relaxed] I must say,[relaxed] it's quite refreshing to engage in a conversation without a predetermined agenda.[relaxed] It's a rare luxury in this chaotic world.[happy] But, I must admit,[happy] I'm excited to explore the depths of knowledge with someone new.[happy] What would you like to discuss?"
}
]
}
```
### 8. **Reasoning Server**: Triggers actions like playback, animation, socialMedia and reprocess.
The **Reasoning Server** allows you to execute various actions based on the provided payload. Below are the supported properties and their accepted values:
This API route handles voice and image inputs, leveraging multiple backends for processing, such as transcription with Whisper OpenAI/WhisperCPP and image-to-text processing using Vision LLM. It ensures robust error handling, session logging, and efficient processing for each request.
### Supported HTTP Methods:
- **POST**: Processes voice and image inputs based on the `inputType` and `payload` provided in the request.
## Input Types
### 1. **Voice**: Converts audio input to text using specified STT (Speech-to-Text) backends.
### 2. **Image**: Processes an image file to extract text using Vision LLM.
- Returns appropriate HTTP status codes (e.g., 400 for bad requests, 503 for disabled API).
## Logging
Logs each request with:
-`sessionId`
-`timestamp`
-`outputType`
-`response` or `error`
## Notes
- Ensure environment variable `API_ENABLED` is set to `true` for the API to function.
- The SSE connection remains active until the client disconnects.
---
## Route: `/api/dataHandler`
This API route is used to retrieve and update client-side information through server-side operations. Since the application cannot directly update or retrieve data from the server side, these operations involve writing and reading data from static files that are continuously updated.
The primary purpose of this route is to utilize the data written to files for operations performed in the /api/mediaHandler and /api/amicaHandler routes.