Skip to content

Chat and Voice ​

The chat interface is a synchronous interface and does not enter the task list. Points will be deducted immediately according to the background price if the chat is successful, and refunds will be automatically made if the upstream fails.

Send message ​

bash
curl -X POST https://api.girllab.io/v1/chat/messages \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "message":"Hello",
    "persona":"You are a concise travel assistant.",
    "temperature":0.8,
    "top_p":0.8,
    "max_tokens":2048
  }'

If conversation_id is not passed for the first time, the new session ID will be given in the return value. The context is maintained by passing this ID back on subsequent sends. The personas and parameters passed in for the first time will be saved to the session.

Session Management ​

OperationsRequests
Session ListGET /v1/chat/conversations
Message HistoryGET /v1/chat/conversations/{id}/messages
Save settingsPATCH /v1/chat/conversations/{id}/config
Delete sessionDELETE /v1/chat/conversations/{id}

The return structure of message history is:

json
{
  "data": {
    "config": {"persona":"...","temperature":0.8,"top_p":0.8,"max_tokens":2048},
    "messages": [{"id":1,"role":"user","content":"Hello","created_at":"..."}]
  }
}

Speech to text ​

POST /v1/chat/transcribe, incoming { "audio": "data:audio/webm;base64,..." }. Pure base64 is also supported, with a maximum decoded size of 10MB; text and language are returned synchronously.

Text to Speech ​

POST /v1/chat/speech, incoming { "text": "Hello", "voice": "Cherry" }. Synchronously return MP3 data URI: { "audio": "data:audio/mpeg;base64,..." }, which can be directly assigned to src of web page <audio>.

© 2026 GirlLab. All rights reserved.