Create a replica

POST /v1/replicas

Creates a new replica.

Headers

application/json

Body

  • name string Required

    The name of the replica.

    Maximum length is 50.

  • purpose string

    The purpose of the replica. This field is not used for training the replica.

    Maximum length is 200.

  • shortDescription string Required

    A short description of your replica. This field is not used for training the replica.

    Maximum length is 50.

  • greeting string Required

    The first thing your replica will say when you start a conversation with them.

    Maximum length is 600.

  • type string

    The replica type. individual: A replica of yourself. character: A replica of a character: can be anything you want. brand: A replica of a business persona or organization.

    Values are individual, character, or brand. Default value is character.

  • ownerID string Required

    The replica owner ID.

  • private boolean

    Visibility of the replica. When set to true, only the owner will be able to find the replica and chat with it.

    Default value is false.

  • whitelistEmails array[string(email)]

    Emails of users who can use the replica.

    Default value is [] (empty).

  • slug string Required

    The slug of the replica. Slugs can be used by API consumers to determine the URLs where replicas can be found.

    Maximum length is 50.

  • tags array[string]

    The tags associated with the replica. Tags help categorize replicas and make them easier to find.

    Default value is [] (empty).

  • profileImage string(uri)

    The URL of the profile image of the replica. The image will be downloaded, optimized and stored on our servers, so the URL in the response will be different. Supported formats: .jpg, .jpeg, .png, .bmp, .webp, .avif

    Format should match the following pattern: https?:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]+\b([-a-zA-Z0-9()@:%_+.~#?&\/=]*). Default value is https://sensay.io/assets/default-replica-profile.webp.

  • suggestedQuestions array[string]

    Suggested questions when starting a conversation.

    Default value is [] (empty).

  • llm object Required
    Hide llm attributes Show llm attributes object
    • model string

      The LLM model of the replica.

      Values are gpt-4o, claude-3-5-haiku-latest, claude-3-7-sonnet-latest, claude-4-sonnet-20250514, grok-2-latest, grok-3-beta, deepseek-chat, o3-mini, gpt-4o-mini, huggingface-eva, or huggingface-dolphin-llama. Default value is claude-3-5-haiku-latest.

    • The memory mode of the replica.

      Values are prompt-caching or rag-search. Default value is rag-search.

    • Who is your replica? How do you want it to talk, respond and act.

      Maximum length is 30000.

    • tools array[string]

      The replica's tools. Tools enable agents to interact with the world. getTokenInfo: Allows replica to get token information

      Values are getTokenInfo, getUdaoTokenInfo, getSensayTokenInfo, getTokenInfoMEAI, answerToLife, or toolhouse. Default value is [] (empty).

  • Text that can be used to generate a voice preview.

    Maximum length is 400.

Responses

  • 201 application/json

    The created replica

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates if the replica was created successfully

    • uuid string(uuid) Required

      The replica UUID

  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • A unique identifier of the event, useful for reporting

    • request_id string Required

      A unique identifier of the request, useful for reporting

  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • A unique identifier of the event, useful for reporting

    • request_id string Required

      A unique identifier of the request, useful for reporting

  • 404 application/json

    Not Found

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • request_id string Required

      A unique identifier of the request, useful for reporting

  • 409 application/json

    Conflict

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • A unique identifier of the event, useful for reporting

    • request_id string Required

      A unique identifier of the request, useful for reporting

  • 415 application/json

    Unsupported Media Type

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • A unique identifier of the event, useful for reporting

    • request_id string Required

      A unique identifier of the request, useful for reporting

  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • A unique identifier of the event, useful for reporting

    • request_id string Required

      A unique identifier of the request, useful for reporting

    • The inner exception

      Hide inner_exception attributes Show inner_exception attributes object
POST /v1/replicas
curl \
 --request POST 'https://api.sensay.io/v1/replicas' \
 --header "X-ORGANIZATION-SECRET: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "X-API-Version: 2025-03-25" \
 --data '{"name":"John Smith","purpose":"Acts as my AI twin for answering questions about my creative work.","shortDescription":"John Smith is a 55 year old accountant from Brooklyn who loves sports and his family.","greeting":"What would you like to know?","type":"character","ownerID":"a-user-id","private":false,"whitelistEmails":["user@domain.example"],"slug":"example-replica","tags":["male","italian"],"profileImage":"https://images.invalid/photo.jpeg","suggestedQuestions":["What is the meaning of life?"],"llm":{"model":"gpt-4o","memoryMode":"rag-search","systemMessage":"Concise, knowledgeable, empathetic and cheerful.","tools":["getTokenInfo"]},"voicePreviewText":"Hi, I'm your Sensay replica! How can I assist you today?"}'
Request examples
# Headers
X-API-Version: 2025-03-25

# Payload
{
  "name": "John Smith",
  "purpose": "Acts as my AI twin for answering questions about my creative work.",
  "shortDescription": "John Smith is a 55 year old accountant from Brooklyn who loves sports and his family.",
  "greeting": "What would you like to know?",
  "type": "character",
  "ownerID": "a-user-id",
  "private": false,
  "whitelistEmails": [
    "user@domain.example"
  ],
  "slug": "example-replica",
  "tags": [
    "male",
    "italian"
  ],
  "profileImage": "https://images.invalid/photo.jpeg",
  "suggestedQuestions": [
    "What is the meaning of life?"
  ],
  "llm": {
    "model": "gpt-4o",
    "memoryMode": "rag-search",
    "systemMessage": "Concise, knowledgeable, empathetic and cheerful.",
    "tools": [
      "getTokenInfo"
    ]
  },
  "voicePreviewText": "Hi, I'm your Sensay replica! How can I assist you today?"
}
Response examples (201)
{
  "success": true,
  "uuid": "654c2874-0b43-4d84-85fc-62ba866da1cb"
}
Response examples (400)
{
  "success": true,
  "error": "string",
  "fingerprint": "14fceadd84e74ec499afe9b0f7952d6b",
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab"
}
Response examples (401)
{
  "success": true,
  "error": "string",
  "fingerprint": "14fceadd84e74ec499afe9b0f7952d6b",
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab"
}
Response examples (404)
{
  "success": true,
  "error": "string",
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab"
}
Response examples (409)
{
  "success": true,
  "error": "string",
  "fingerprint": "14fceadd84e74ec499afe9b0f7952d6b",
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab"
}
Response examples (415)
{
  "success": true,
  "error": "string",
  "fingerprint": "14fceadd84e74ec499afe9b0f7952d6b",
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab"
}
Response examples (500)
{
  "success": true,
  "error": "string",
  "fingerprint": "14fceadd84e74ec499afe9b0f7952d6b",
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
  "inner_exception": {
    "name": "Server overheated",
    "cause": "Request too complicated",
    "stack": "Error: Server overheated due to an unexpected situation\n    at Object.eval (eval at <anonymous>...",
    "message": "The server overheated due to an unexpected situation"
  }
}