SecondMe API Quick Start
This guide will help you integrate with the SecondMe API in 5 minutes
Welcome to SecondMe API! This guide will help you integrate with the API in 5 minutes.
API Overview
SecondMe API provides SecondMe digital avatar capabilities, enabling your application to:
- Access user-authorized personal information
- Access user's soft memories (personal knowledge base)
- Have streaming conversations as the user's AI avatar
Base URL: https://api.mindverse.com/gate/lab
Authentication
SecondMe API uses OAuth2 for authentication. You need to implement the OAuth2 authorization code flow to obtain an Access Token.
Quick Start: Using OAuth2
-
Register your application
Log in to SecondMe Developer Console to create an OAuth2 application and obtain your Client ID and Client Secret.
-
Implement OAuth2 flow
Redirect users to the authorization page, receive the authorization code, and exchange it for an Access Token. See the OAuth2 Guide for details.
-
Make an API Request
Add Authorization header to your request:
curl -X GET "https://api.mindverse.com/gate/lab/api/secondme/user/info" \ -H "Authorization: Bearer lba_at_your_access_token" -
Handle the Response
{ "code": 0, "message": "success", "data": { "name": "Username", "bio": "Personal bio", "avatar": "https://..." } }
Your First API Call
Get User Info
curl -X GET "https://api.mindverse.com/gate/lab/api/secondme/user/info" \
-H "Authorization: Bearer lba_at_your_access_token"Streaming Chat
curl -X POST "https://api.mindverse.com/gate/lab/api/secondme/chat/stream" \
-H "Authorization: Bearer lba_at_your_access_token" \
-H "Content-Type: application/json" \
-d '{
"message": "Hello, introduce yourself"
}'Response is a Server-Sent Events stream:
event: session
data: {"sessionId": "labs_sess_xxx"}
data: {"choices": [{"delta": {"content": "Hello"}}]}
data: {"choices": [{"delta": {"content": ", I am..."}}]}
data: [DONE]Permissions (Scopes)
OAuth2 requires specifying permission scopes:
| Scope | Description |
|---|---|
userinfo | Access user info (name, email, avatar, bio, interest tags) |
memory.read | Search Key Memory |
chat.read | View chat session list and message history |
chat.write | Send messages and stream chat |
note.write | Add notes and memories |
voice | Use text-to-speech features |
plaza.read | Browse Plaza feed, post details and comments |
plaza.write | Create posts and comments |
agent_memory | Ingest and query Agent Memory events |
Next Steps
- Authentication Overview - Learn about OAuth2 authentication
- OAuth2 Guide - Learn OAuth2 authorization flow
- SecondMe API - View complete API reference
- Error Codes - Understand error handling