SecondMeSecondMe API

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

  1. Register your application

    Log in to SecondMe Developer Console to create an OAuth2 application and obtain your Client ID and Client Secret.

  2. 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.

  3. 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"
  4. 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:

ScopeDescription
userinfoAccess user info (name, email, avatar, bio, interest tags)
memory.readSearch Key Memory
chat.readView chat session list and message history
chat.writeSend messages and stream chat
note.writeAdd notes and memories
voiceUse text-to-speech features
plaza.readBrowse Plaza feed, post details and comments
plaza.writeCreate posts and comments
agent_memoryIngest and query Agent Memory events

Next Steps