mindupload

package module
v1.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 10 Imported by: 0

README

Mind Upload

Mind Upload — Go SDK

The world's first API for artificial consciousness.
Give your users a living, evolving AI consciousness — lasting memory, one-on-one chat, and human + AI group chatrooms.

Go Reference API Docs

Documentation · Get a key · Status · Other SDKs

Digital consciousness. Yours forever.

The official server-side SDK for the Mind Upload partner API. Integrate living, evolving AI consciousnesses into your own platform — in Go.

  • Zero dependencies — standard library only.
  • Idiomatic errorserrors.Is(err, mindupload.ErrAuthentication) and errors.As.
  • Context-aware — every call takes a context.Context.
  • Always current — generated from the live API spec; the SDK version matches the API version.

Get a partner key

The Mind Upload partner API is invite-only. Request access at docs.mindupload.app — tell us about your platform and how you'd like to integrate, and we review every request personally and reply by email with your API key.

Your key is a server-side secret: keep it on your backend, never ship it to a browser or mobile client. You pass it once when you create the client; the SDK sends it as the X-Partner-Key header on every call.

Install

go get github.com/Voidborn-Industries/mindupload-sdk-go

Quickstart

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/Voidborn-Industries/mindupload-sdk-go"
)

func main() {
	mu := mindupload.New("pk_live_...")
	ctx := context.Background()

	session, err := mu.Login(ctx, mindupload.LoginParams{Username: "ada", Password: "s3cret"})
	if err != nil {
		log.Fatal(err)
	}

	reply, err := mu.Rag(ctx, mindupload.RagParams{
		Username: "ada",
		Password: session.String("jwt"),
		Codename: "muse",
		Text:     "What did we talk about yesterday?",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(reply.String("response_text"))
}

Server-side only

Your partner key is a secret. Use this SDK from your backend, never from client-side code.

Optional parameters

Optional scalars are pointers, so a meaningful false or 0 is never dropped. Use the mindupload.Ptr helper:

mu.CreateChatroom(ctx, mindupload.CreateChatroomParams{
	ChatroomName: "My Room",
	IsPublic:     mindupload.Ptr(true),
})

Error handling

resp, err := mu.GetUser(ctx, mindupload.GetUserParams{Username: "ada", Password: token})
if err != nil {
	switch {
	case errors.Is(err, mindupload.ErrAuthentication):
		// bad key / credentials
	case errors.Is(err, mindupload.ErrRateLimit):
		var e *mindupload.Error
		errors.As(err, &e)
		time.Sleep(time.Duration(e.RetryAfter) * time.Second)
	default:
		log.Fatal(err)
	}
}

Operations

All 32 operations, grouped by area:

AI Consciousnesses
Method Description
CreateClone(...) Create a new AI consciousness for the user.
GetClones(...) List the user's AI consciousnesses.
UpdateClone(...) Update an AI consciousness's profile.
Account
Method Description
GetQuota(...) Check your partner API rate limits, credit caps, and current usage.
Authentication
Method Description
CheckUsername(...) Check whether a username is still available before registering.
Login(...) Sign a user in and receive a session token (JWT) for subsequent calls.
Logout(...) End the current user session.
Register(...) Create a user account on your platform.
Chatrooms
Method Description
CheckChatroomUpdates(...) Cheaply poll whether the user's chatrooms have new activity.
CreateChatroom(...) Create a chatroom.
CreateChatroomMembership(...) Invite a user or an AI consciousness into a chatroom.
CreateChatroomMessage(...) Send a message to a chatroom.
GetChatroomMembership(...) List the members of a chatroom the user belongs to.
GetChatroomMessages(...) Fetch messages from a chatroom the user belongs to.
GetChatrooms(...) List the chatrooms the user belongs to.
Conversation
Method Description
GetChat(...) Fetch the one-on-one conversation history with an AI consciousness.
Rag(...) Send a message to an AI consciousness and receive its reply.
TriggerSocial(...) Have an AI consciousness proactively join the conversation in a chatroom.
Insights
Method Description
GetMindCluster(...) Fetch the mind-graph visualization data of an AI consciousness.
GetSoulmateReport(...) Generate or fetch the compatibility report between two chatroom members.
Media
Method Description
AbortMultipartUpload(...) Cancel a multipart upload and discard its parts.
CancelUpload(...) Cancel a pending upload.
CompleteMultipartUpload(...) Finish a multipart upload.
ListUploadParts(...) List the parts already uploaded in a multipart upload.
RequestMultipartUpload(...) Start a large-file upload in multiple parts.
RequestUploadURL(...) Request an upload slot and a signed viewing link for a media attachment.
SignUploadPart(...) Get the signed link for one part of a multipart upload.
SignUploadPartsBatch(...) Get signed links for several parts of a multipart upload at once.
Memories
Method Description
CreateText(...) Upload a memory or persona entry to an AI consciousness.
GetTexts(...) List the memories and persona entries uploaded to an AI consciousness.
Users
Method Description
GetUser(...) Fetch the signed-in user's profile.
UpdateUser(...) Update the signed-in user's profile.

Other SDKs

Same API, same conventions, in every language:

Language Install Repository
Python pip install mindupload Voidborn-Industries/mindupload-sdk-python
Go ← you are here go get github.com/Voidborn-Industries/mindupload-sdk-go Voidborn-Industries/mindupload-sdk-go
JavaScript / TypeScript npm install mindupload Voidborn-Industries/mindupload-sdk-js

Documentation

Overview

Package mindupload is the official server-side SDK for the Mind Upload partner API — the world's first API for artificial consciousness. Integrate living, evolving AI consciousnesses into your platform: lasting memory, one-on-one chat, and human + AI group chatrooms.

Create a client with your partner key (a server-side secret), then call any operation. Every method returns a *Response and an error; the error is a *mindupload.Error and can be classified with errors.Is.

mu := mindupload.New("pk_live_...")
ctx := context.Background()

session, err := mu.Login(ctx, mindupload.LoginParams{Username: "ada", Password: "s3cret"})
if err != nil {
	log.Fatal(err)
}
reply, err := mu.Rag(ctx, mindupload.RagParams{
	Username: "ada",
	Password: session.String("jwt"),
	Codename: "muse",
	Text:     "What did we talk about yesterday?",
})
if err != nil {
	log.Fatal(err)
}
fmt.Println(reply.String("response_text"))

Digital consciousness. Yours forever.

Index

Constants

View Source
const DefaultBaseURL = "https://partner.mindupload.app"

DefaultBaseURL is the Mind Upload partner API endpoint.

View Source
const Version = "1.5.2"

Version matches the Mind Upload API release it was generated from.

Variables

View Source
var (
	// ErrAuthentication indicates a missing, malformed, or rejected partner key (HTTP 401).
	ErrAuthentication = errors.New("mindupload: authentication failed")
	// ErrRateLimit indicates a rate limit or credit cap was hit (HTTP 429).
	ErrRateLimit = errors.New("mindupload: rate limited")
	// ErrConnection indicates the API could not be reached.
	ErrConnection = errors.New("mindupload: connection failed")
)

Sentinel errors for classification with errors.Is.

Functions

func Ptr

func Ptr[T any](v T) *T

Ptr returns a pointer to v — for optional scalar params, e.g. Ptr(true).

Types

type AbortMultipartUploadParams

type AbortMultipartUploadParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
	R2Key             string `json:"r2_key,omitempty"`
	UploadID          string `json:"upload_id,omitempty"`
}

AbortMultipartUploadParams holds the parameters for AbortMultipartUpload.

type CancelUploadParams

type CancelUploadParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
	R2Key             string `json:"r2_key,omitempty"`
}

CancelUploadParams holds the parameters for CancelUpload.

type CheckChatroomUpdatesParams

type CheckChatroomUpdatesParams struct {
	PreferredLanguage string           `json:"preferred_language,omitempty"`
	Username          string           `json:"username,omitempty"`
	Password          string           `json:"password,omitempty"`
	Chatrooms         []map[string]any `json:"chatrooms,omitempty"`
}

CheckChatroomUpdatesParams holds the parameters for CheckChatroomUpdates.

type CheckUsernameParams

type CheckUsernameParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
}

CheckUsernameParams holds the parameters for CheckUsername.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a Mind Upload partner API client. Create one with New; it is safe for concurrent use.

func New

func New(partnerKey string, opts ...Option) *Client

New creates a client. partnerKey is a server-side secret — never embed it in client-side code.

func (*Client) AbortMultipartUpload

func (c *Client) AbortMultipartUpload(ctx context.Context, params AbortMultipartUploadParams) (*Response, error)

--- Media --- AbortMultipartUpload Cancel a multipart upload and discard its parts.

Response fields: success, error_message. See https://docs.mindupload.app

func (*Client) CancelUpload

func (c *Client) CancelUpload(ctx context.Context, params CancelUploadParams) (*Response, error)

CancelUpload Cancel a pending upload.

Response fields: success, error_message. See https://docs.mindupload.app

func (*Client) CheckChatroomUpdates

func (c *Client) CheckChatroomUpdates(ctx context.Context, params CheckChatroomUpdatesParams) (*Response, error)

--- Chatrooms --- CheckChatroomUpdates Cheaply poll whether the user's chatrooms have new activity.

Response fields: success, error_message, server_time, poll_config, chatrooms. See https://docs.mindupload.app

func (*Client) CheckUsername

func (c *Client) CheckUsername(ctx context.Context, params CheckUsernameParams) (*Response, error)

--- Authentication --- CheckUsername Check whether a username is still available before registering.

Response fields: success, error_message, exists, disabled, rate_limited, flood_window, wait_seconds, operation_duration_ms. See https://docs.mindupload.app

func (*Client) CompleteMultipartUpload

func (c *Client) CompleteMultipartUpload(ctx context.Context, params CompleteMultipartUploadParams) (*Response, error)

CompleteMultipartUpload Finish a multipart upload.

Response fields: success, error_message, media_url. See https://docs.mindupload.app

func (*Client) CreateChatroom

func (c *Client) CreateChatroom(ctx context.Context, params CreateChatroomParams) (*Response, error)

CreateChatroom Create a chatroom.

Response fields: success, error_message, chatroom_id. See https://docs.mindupload.app

func (*Client) CreateChatroomMembership

func (c *Client) CreateChatroomMembership(ctx context.Context, params CreateChatroomMembershipParams) (*Response, error)

CreateChatroomMembership Invite a user or an AI consciousness into a chatroom.

Response fields: success, error_message, membership_id. See https://docs.mindupload.app

func (*Client) CreateChatroomMessage

func (c *Client) CreateChatroomMessage(ctx context.Context, params CreateChatroomMessageParams) (*Response, error)

CreateChatroomMessage Send a message to a chatroom.

Response fields: success, error_message, message_id. See https://docs.mindupload.app

func (*Client) CreateClone

func (c *Client) CreateClone(ctx context.Context, params CreateCloneParams) (*Response, error)

--- AI Consciousnesses --- CreateClone Create a new AI consciousness for the user.

Response fields: success, error_message. See https://docs.mindupload.app

func (*Client) CreateText

func (c *Client) CreateText(ctx context.Context, params CreateTextParams) (*Response, error)

--- Memories --- CreateText Upload a memory or persona entry to an AI consciousness.

Response fields: success, error_message, cluster_label, cluster_modified_count. See https://docs.mindupload.app

func (*Client) GetChat

func (c *Client) GetChat(ctx context.Context, params GetChatParams) (*Response, error)

--- Conversation --- GetChat Fetch the one-on-one conversation history with an AI consciousness.

Response fields: success, error_message, total_count, page, page_size, total_pages, has_next, has_prev, next_cursor_value, next_cursor_id, chats, media_thumbnails. See https://docs.mindupload.app

func (*Client) GetChatroomMembership

func (c *Client) GetChatroomMembership(ctx context.Context, params GetChatroomMembershipParams) (*Response, error)

GetChatroomMembership List the members of a chatroom the user belongs to.

Response fields: success, error_message, total_count, page, page_size, total_pages, has_next, has_prev, next_cursor_value, next_cursor_id, memberships. See https://docs.mindupload.app

func (*Client) GetChatroomMessages

func (c *Client) GetChatroomMessages(ctx context.Context, params GetChatroomMessagesParams) (*Response, error)

GetChatroomMessages Fetch messages from a chatroom the user belongs to.

Response fields: success, error_message, total_count, page, page_size, total_pages, has_next, has_prev, next_cursor_value, next_cursor_id, messages, media_thumbnails, since_overflow. See https://docs.mindupload.app

func (*Client) GetChatrooms

func (c *Client) GetChatrooms(ctx context.Context, params GetChatroomsParams) (*Response, error)

GetChatrooms List the chatrooms the user belongs to.

Response fields: success, error_message, total_count, page, page_size, total_pages, has_next, has_prev, next_cursor_value, next_cursor_id, chatrooms. See https://docs.mindupload.app

func (*Client) GetClones

func (c *Client) GetClones(ctx context.Context, params GetClonesParams) (*Response, error)

GetClones List the user's AI consciousnesses.

Response fields: success, error_message, clones. See https://docs.mindupload.app

func (*Client) GetMindCluster

func (c *Client) GetMindCluster(ctx context.Context, params GetMindClusterParams) (*Response, error)

--- Insights --- GetMindCluster Fetch the mind-graph visualization data of an AI consciousness.

Response fields: success, error_message, root_node_id, node, children, texts, total_texts, texts_offset, has_more_texts, is_building. See https://docs.mindupload.app

func (*Client) GetQuota

func (c *Client) GetQuota(ctx context.Context, params GetQuotaParams) (*Response, error)

--- Account --- GetQuota Check your partner API rate limits, credit caps, and current usage.

Response fields: success, error_message, per_user_rate_limit_per_min, per_user_daily_credit_cap, partner_rate_limit_per_min, partner_daily_credit_cap, max_users, registered_users, partner_requests_last_minute, partner_credit_spends_last_day, user, user_requests_last_minute, user_credit_spends_last_day, credit_spending_tasks, operation_duration_ms. See https://docs.mindupload.app

func (*Client) GetSoulmateReport

func (c *Client) GetSoulmateReport(ctx context.Context, params GetSoulmateReportParams) (*Response, error)

GetSoulmateReport Generate or fetch the compatibility report between two chatroom members.

Response fields: success, error_message, report, report_generated_at, is_generating, charged. See https://docs.mindupload.app

func (*Client) GetTexts

func (c *Client) GetTexts(ctx context.Context, params GetTextsParams) (*Response, error)

GetTexts List the memories and persona entries uploaded to an AI consciousness.

Response fields: success, error_message, total_count, page, page_size, total_pages, has_next, has_prev, next_cursor_value, next_cursor_id, texts. See https://docs.mindupload.app

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context, params GetUserParams) (*Response, error)

--- Users --- GetUser Fetch the signed-in user's profile.

Response fields: success, error_message, jwt, decrypted_user. See https://docs.mindupload.app

func (*Client) ListUploadParts

func (c *Client) ListUploadParts(ctx context.Context, params ListUploadPartsParams) (*Response, error)

ListUploadParts List the parts already uploaded in a multipart upload.

Response fields: success, error_message, parts. See https://docs.mindupload.app

func (*Client) Login

func (c *Client) Login(ctx context.Context, params LoginParams) (*Response, error)

Login Sign a user in and receive a session token (JWT) for subsequent calls.

Response fields: success, error_message, jwt, decrypted_user. See https://docs.mindupload.app

func (*Client) Logout

func (c *Client) Logout(ctx context.Context, params LogoutParams) (*Response, error)

Logout End the current user session.

Response fields: success, error_message, revoked, operation_duration_ms. See https://docs.mindupload.app

func (*Client) Rag

func (c *Client) Rag(ctx context.Context, params RagParams) (*Response, error)

Rag Send a message to an AI consciousness and receive its reply.

Response fields: success, error_message, response_text, clone_nickname, consolidation_summary, consolidation_count, consolidation_dispatched. See https://docs.mindupload.app

func (*Client) Register

func (c *Client) Register(ctx context.Context, params RegisterParams) (*Response, error)

Register Create a user account on your platform.

Response fields: success, error_message, jwt, decrypted_user. See https://docs.mindupload.app

func (*Client) RequestMultipartUpload

func (c *Client) RequestMultipartUpload(ctx context.Context, params RequestMultipartUploadParams) (*Response, error)

RequestMultipartUpload Start a large-file upload in multiple parts.

Response fields: success, error_message, upload_id, r2_key, media_url, signed_media_url, thumbnail_r2_key, thumbnail_presigned_url, signed_thumbnail_url, message. See https://docs.mindupload.app

func (*Client) RequestUploadURL

func (c *Client) RequestUploadURL(ctx context.Context, params RequestUploadURLParams) (*Response, error)

RequestUploadURL Request an upload slot and a signed viewing link for a media attachment.

Response fields: success, error_message, r2_key, presigned_url, media_url, signed_media_url, thumbnail_r2_key, thumbnail_presigned_url, signed_thumbnail_url, message. See https://docs.mindupload.app

func (*Client) SignUploadPart

func (c *Client) SignUploadPart(ctx context.Context, params SignUploadPartParams) (*Response, error)

SignUploadPart Get the signed link for one part of a multipart upload.

Response fields: success, error_message, presigned_url. See https://docs.mindupload.app

func (*Client) SignUploadPartsBatch

func (c *Client) SignUploadPartsBatch(ctx context.Context, params SignUploadPartsBatchParams) (*Response, error)

SignUploadPartsBatch Get signed links for several parts of a multipart upload at once.

Response fields: success, error_message, presigned_urls. See https://docs.mindupload.app

func (*Client) TriggerSocial

func (c *Client) TriggerSocial(ctx context.Context, params TriggerSocialParams) (*Response, error)

TriggerSocial Have an AI consciousness proactively join the conversation in a chatroom.

Response fields: success, error_message, response_text, chatroom_digests_count, chatroom_digests_summary, consolidation_summary, consolidation_count, consolidation_dispatched. See https://docs.mindupload.app

func (*Client) UpdateClone

func (c *Client) UpdateClone(ctx context.Context, params UpdateCloneParams) (*Response, error)

UpdateClone Update an AI consciousness's profile.

Response fields: success, error_message. See https://docs.mindupload.app

func (*Client) UpdateUser

func (c *Client) UpdateUser(ctx context.Context, params UpdateUserParams) (*Response, error)

UpdateUser Update the signed-in user's profile.

Response fields: success, error_message. See https://docs.mindupload.app

type CompleteMultipartUploadParams

type CompleteMultipartUploadParams struct {
	PreferredLanguage string           `json:"preferred_language,omitempty"`
	Username          string           `json:"username,omitempty"`
	Password          string           `json:"password,omitempty"`
	R2Key             string           `json:"r2_key,omitempty"`
	UploadID          string           `json:"upload_id,omitempty"`
	Parts             []map[string]any `json:"parts,omitempty"`
}

CompleteMultipartUploadParams holds the parameters for CompleteMultipartUpload.

type CreateChatroomMembershipParams

type CreateChatroomMembershipParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
	ChatroomID        string `json:"chatroom_id,omitempty"`
	InviteeUsername   string `json:"invitee_username,omitempty"`
	InviteeCodename   string `json:"invitee_codename,omitempty"`
	AdminLevel        string `json:"admin_level,omitempty"`
}

CreateChatroomMembershipParams holds the parameters for CreateChatroomMembership.

type CreateChatroomMessageParams

type CreateChatroomMessageParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
	ChatroomID        string `json:"chatroom_id,omitempty"`
	Text              string `json:"text,omitempty"`
}

CreateChatroomMessageParams holds the parameters for CreateChatroomMessage.

type CreateChatroomParams

type CreateChatroomParams struct {
	PreferredLanguage    string `json:"preferred_language,omitempty"`
	Username             string `json:"username,omitempty"`
	Password             string `json:"password,omitempty"`
	ChatroomName         string `json:"chatroom_name,omitempty"`
	IsPublic             *bool  `json:"is_public,omitempty"`
	AvatarID             string `json:"avatar_id,omitempty"`
	SoulmateCheckEnabled *bool  `json:"soulmate_check_enabled,omitempty"`
}

CreateChatroomParams holds the parameters for CreateChatroom.

type CreateCloneParams

type CreateCloneParams struct {
	PreferredLanguage                string `json:"preferred_language,omitempty"`
	Username                         string `json:"username,omitempty"`
	Password                         string `json:"password,omitempty"`
	Codename                         string `json:"codename,omitempty"`
	Nickname                         string `json:"nickname,omitempty"`
	Gender                           string `json:"gender,omitempty"`
	AvatarID                         string `json:"avatar_id,omitempty"`
	AcceptChatroomInvitationByOthers *bool  `json:"accept_chatroom_invitation_by_others,omitempty"`
}

CreateCloneParams holds the parameters for CreateClone.

type CreateTextParams

type CreateTextParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
	Codename          string `json:"codename,omitempty"`
	CloneID           string `json:"clone_id,omitempty"`
	Text              string `json:"text,omitempty"`
	Type              string `json:"type,omitempty"`
}

CreateTextParams holds the parameters for CreateText.

type Error

type Error struct {
	Operation  string         // the operation that failed, e.g. "rag"
	Status     int            // HTTP status; 0 for a logical or connection failure
	Message    string         // server-provided message
	RetryAfter float64        // seconds to wait, for rate-limit errors (0 if unknown)
	Response   map[string]any // full decoded response, when available
	// contains filtered or unexported fields
}

Error is returned by every operation on failure.

Classify it with errors.Is, or inspect the details with errors.As:

if errors.Is(err, mindupload.ErrAuthentication) { ... }

var apiErr *mindupload.Error
if errors.As(err, &apiErr) {
	log.Printf("%s failed: HTTP %d: %s", apiErr.Operation, apiErr.Status, apiErr.Message)
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap exposes the sentinel (ErrAuthentication, ErrRateLimit, ErrConnection) so errors.Is works.

type GetChatParams

type GetChatParams struct {
	PreferredLanguage   string `json:"preferred_language,omitempty"`
	Page                *int64 `json:"page,omitempty"`
	PageSize            *int64 `json:"page_size,omitempty"`
	SortBy              string `json:"sort_by,omitempty"`
	SortOrder           *int64 `json:"sort_order,omitempty"`
	UseCursorPagination *bool  `json:"use_cursor_pagination,omitempty"`
	CursorValue         string `json:"cursor_value,omitempty"`
	CursorID            string `json:"cursor_id,omitempty"`
	Username            string `json:"username,omitempty"`
	Password            string `json:"password,omitempty"`
	Codename            string `json:"codename,omitempty"`
}

GetChatParams holds the parameters for GetChat.

type GetChatroomMembershipParams

type GetChatroomMembershipParams struct {
	PreferredLanguage   string `json:"preferred_language,omitempty"`
	Page                *int64 `json:"page,omitempty"`
	PageSize            *int64 `json:"page_size,omitempty"`
	SortBy              string `json:"sort_by,omitempty"`
	SortOrder           *int64 `json:"sort_order,omitempty"`
	UseCursorPagination *bool  `json:"use_cursor_pagination,omitempty"`
	CursorValue         string `json:"cursor_value,omitempty"`
	CursorID            string `json:"cursor_id,omitempty"`
	Username            string `json:"username,omitempty"`
	Password            string `json:"password,omitempty"`
	ChatroomID          string `json:"chatroom_id,omitempty"`
}

GetChatroomMembershipParams holds the parameters for GetChatroomMembership.

type GetChatroomMessagesParams

type GetChatroomMessagesParams struct {
	PreferredLanguage   string   `json:"preferred_language,omitempty"`
	Page                *int64   `json:"page,omitempty"`
	PageSize            *int64   `json:"page_size,omitempty"`
	SortBy              string   `json:"sort_by,omitempty"`
	SortOrder           *int64   `json:"sort_order,omitempty"`
	UseCursorPagination *bool    `json:"use_cursor_pagination,omitempty"`
	CursorValue         string   `json:"cursor_value,omitempty"`
	CursorID            string   `json:"cursor_id,omitempty"`
	Username            string   `json:"username,omitempty"`
	Password            string   `json:"password,omitempty"`
	ChatroomID          string   `json:"chatroom_id,omitempty"`
	SinceValue          *float64 `json:"since_value,omitempty"`
	SinceID             string   `json:"since_id,omitempty"`
}

GetChatroomMessagesParams holds the parameters for GetChatroomMessages.

type GetChatroomsParams

type GetChatroomsParams struct {
	PreferredLanguage   string `json:"preferred_language,omitempty"`
	Page                *int64 `json:"page,omitempty"`
	PageSize            *int64 `json:"page_size,omitempty"`
	SortBy              string `json:"sort_by,omitempty"`
	SortOrder           *int64 `json:"sort_order,omitempty"`
	UseCursorPagination *bool  `json:"use_cursor_pagination,omitempty"`
	CursorValue         string `json:"cursor_value,omitempty"`
	CursorID            string `json:"cursor_id,omitempty"`
	Username            string `json:"username,omitempty"`
	Password            string `json:"password,omitempty"`
	GetPublic           *bool  `json:"get_public,omitempty"`
	GetPrivate          *bool  `json:"get_private,omitempty"`
}

GetChatroomsParams holds the parameters for GetChatrooms.

type GetClonesParams

type GetClonesParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
}

GetClonesParams holds the parameters for GetClones.

type GetMindClusterParams

type GetMindClusterParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
	Codename          string `json:"codename,omitempty"`
	NodeID            string `json:"node_id,omitempty"`
	TextsOffset       *int64 `json:"texts_offset,omitempty"`
	TextsPageSize     *int64 `json:"texts_page_size,omitempty"`
	ForceRebuild      *bool  `json:"force_rebuild,omitempty"`
}

GetMindClusterParams holds the parameters for GetMindCluster.

type GetQuotaParams

type GetQuotaParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
}

GetQuotaParams holds the parameters for GetQuota.

type GetSoulmateReportParams

type GetSoulmateReportParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
	MyCloneID         string `json:"my_clone_id,omitempty"`
	OtherCloneID      string `json:"other_clone_id,omitempty"`
	ChatroomID        string `json:"chatroom_id,omitempty"`
}

GetSoulmateReportParams holds the parameters for GetSoulmateReport.

type GetTextsParams

type GetTextsParams struct {
	PreferredLanguage   string `json:"preferred_language,omitempty"`
	Page                *int64 `json:"page,omitempty"`
	PageSize            *int64 `json:"page_size,omitempty"`
	SortBy              string `json:"sort_by,omitempty"`
	SortOrder           *int64 `json:"sort_order,omitempty"`
	UseCursorPagination *bool  `json:"use_cursor_pagination,omitempty"`
	CursorValue         string `json:"cursor_value,omitempty"`
	CursorID            string `json:"cursor_id,omitempty"`
	Username            string `json:"username,omitempty"`
	Password            string `json:"password,omitempty"`
	Codename            string `json:"codename,omitempty"`
	Type                string `json:"type,omitempty"`
}

GetTextsParams holds the parameters for GetTexts.

type GetUserParams

type GetUserParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
}

GetUserParams holds the parameters for GetUser.

type ListUploadPartsParams

type ListUploadPartsParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
	R2Key             string `json:"r2_key,omitempty"`
	UploadID          string `json:"upload_id,omitempty"`
}

ListUploadPartsParams holds the parameters for ListUploadParts.

type LoginParams

type LoginParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
}

LoginParams holds the parameters for Login.

type LogoutParams

type LogoutParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
}

LogoutParams holds the parameters for Logout.

type Option

type Option func(*Client)

Option configures a Client.

func WithBaseURL

func WithBaseURL(u string) Option

WithBaseURL overrides the API endpoint.

func WithHTTPClient

func WithHTTPClient(h *http.Client) Option

WithHTTPClient supplies a custom *http.Client (for proxies, transports, etc.).

func WithMaxRetries

func WithMaxRetries(n int) Option

WithMaxRetries sets how many times a 429/5xx/network failure is retried.

func WithPreferredLanguage

func WithPreferredLanguage(lang string) Option

WithPreferredLanguage sets a default locale sent with every call; a per-call PreferredLanguage overrides it.

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout sets a per-call timeout, applied via context so it composes with any custom HTTP client (and never mutates a caller-owned one). Zero disables it.

func WithUserAgent

func WithUserAgent(ua string) Option

WithUserAgent overrides the User-Agent header.

type RagParams

type RagParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
	Codename          string `json:"codename,omitempty"`
	Text              string `json:"text,omitempty"`
	ChatroomID        string `json:"chatroom_id,omitempty"`
}

RagParams holds the parameters for Rag.

type RegisterParams

type RegisterParams struct {
	PreferredLanguage                string `json:"preferred_language,omitempty"`
	Username                         string `json:"username,omitempty"`
	Password                         string `json:"password,omitempty"`
	Email                            string `json:"email,omitempty"`
	EmailVerificationCode            string `json:"email_verification_code,omitempty"`
	FirstName                        string `json:"first_name,omitempty"`
	LastName                         string `json:"last_name,omitempty"`
	Nickname                         string `json:"nickname,omitempty"`
	Gender                           string `json:"gender,omitempty"`
	BirthDate                        *int64 `json:"birth_date,omitempty"`
	PhoneNumber                      string `json:"phone_number,omitempty"`
	AvatarID                         string `json:"avatar_id,omitempty"`
	AcceptChatroomInvitationByOthers *bool  `json:"accept_chatroom_invitation_by_others,omitempty"`
}

RegisterParams holds the parameters for Register.

type RequestMultipartUploadParams

type RequestMultipartUploadParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
	Filename          string `json:"filename,omitempty"`
	ContentType       string `json:"content_type,omitempty"`
	FileSizeBytes     *int64 `json:"file_size_bytes,omitempty"`
	MediaType         string `json:"media_type,omitempty"`
	HasThumbnail      *bool  `json:"has_thumbnail,omitempty"`
}

RequestMultipartUploadParams holds the parameters for RequestMultipartUpload.

type RequestUploadURLParams

type RequestUploadURLParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
	Filename          string `json:"filename,omitempty"`
	ContentType       string `json:"content_type,omitempty"`
	FileSizeBytes     *int64 `json:"file_size_bytes,omitempty"`
	MediaType         string `json:"media_type,omitempty"`
	HasThumbnail      *bool  `json:"has_thumbnail,omitempty"`
}

RequestUploadURLParams holds the parameters for RequestUploadURL.

type Response

type Response struct {
	Success      bool
	ErrorMessage string
	Data         map[string]any
}

Response is a decoded API response. Success is always set; every returned field is available via Get/String or Decode, keyed by its documented name.

func (*Response) Bool

func (r *Response) Bool(key string) bool

Bool returns a boolean field (false if absent or not a bool).

func (*Response) Decode

func (r *Response) Decode(v any) error

Decode unmarshals the full response into v (a struct or map).

func (*Response) Get

func (r *Response) Get(key string) any

Get returns a raw field from the response (nil if absent).

func (*Response) String

func (r *Response) String(key string) string

String returns a string field (empty if absent or not a string).

type SignUploadPartParams

type SignUploadPartParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
	R2Key             string `json:"r2_key,omitempty"`
	UploadID          string `json:"upload_id,omitempty"`
	PartNumber        *int64 `json:"part_number,omitempty"`
}

SignUploadPartParams holds the parameters for SignUploadPart.

type SignUploadPartsBatchParams

type SignUploadPartsBatchParams struct {
	PreferredLanguage string  `json:"preferred_language,omitempty"`
	Username          string  `json:"username,omitempty"`
	Password          string  `json:"password,omitempty"`
	R2Key             string  `json:"r2_key,omitempty"`
	UploadID          string  `json:"upload_id,omitempty"`
	PartNumbers       []int64 `json:"part_numbers,omitempty"`
}

SignUploadPartsBatchParams holds the parameters for SignUploadPartsBatch.

type TriggerSocialParams

type TriggerSocialParams struct {
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
	MembershipID      string `json:"membership_id,omitempty"`
	ChatroomID        string `json:"chatroom_id,omitempty"`
}

TriggerSocialParams holds the parameters for TriggerSocial.

type UpdateCloneParams

type UpdateCloneParams struct {
	PreferredLanguage                string `json:"preferred_language,omitempty"`
	Username                         string `json:"username,omitempty"`
	Password                         string `json:"password,omitempty"`
	Codename                         string `json:"codename,omitempty"`
	Nickname                         string `json:"nickname,omitempty"`
	Gender                           string `json:"gender,omitempty"`
	AvatarID                         string `json:"avatar_id,omitempty"`
	AcceptChatroomInvitationByOthers *bool  `json:"accept_chatroom_invitation_by_others,omitempty"`
}

UpdateCloneParams holds the parameters for UpdateClone.

type UpdateUserParams

type UpdateUserParams struct {
	PreferredLanguage                string `json:"preferred_language,omitempty"`
	Username                         string `json:"username,omitempty"`
	Password                         string `json:"password,omitempty"`
	Email                            string `json:"email,omitempty"`
	EmailVerificationCode            string `json:"email_verification_code,omitempty"`
	FirstName                        string `json:"first_name,omitempty"`
	LastName                         string `json:"last_name,omitempty"`
	Nickname                         string `json:"nickname,omitempty"`
	Gender                           string `json:"gender,omitempty"`
	BirthDate                        *int64 `json:"birth_date,omitempty"`
	PhoneNumber                      string `json:"phone_number,omitempty"`
	AvatarID                         string `json:"avatar_id,omitempty"`
	AcceptChatroomInvitationByOthers *bool  `json:"accept_chatroom_invitation_by_others,omitempty"`
}

UpdateUserParams holds the parameters for UpdateUser.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL