Skip to content

Character Chat

← API Reference · 简体中文

Chat as a character. Use the resource-level API key bound to that character (see API Keys & Authentication); the character's persona, linked knowledge bases and MCP tools all apply.

Request

http
POST /ext/v1/character
ParameterTypeRequiredDescription
querystringyesThe user question
modelstringnoModel name; defaults to the system default. A_MODEL_NOT_AVAILABLE if missing or disabled
response_modestringnostreaming (default) / blocking

Response

streaming (default)

An SSE text stream, mirroring the in-page chat.

bash
curl -N -X POST "http://<host>:9999/ext/v1/character" \
  -H "Authorization: <character API key>" \
  -H "Content-Type: application/json" \
  -d '{"query": "Introduce yourself in one sentence"}'

blocking

Waits for completion and returns the JSON result at once.

bash
curl -X POST "http://<host>:9999/ext/v1/character" \
  -H "Authorization: <character API key>" \
  -H "Content-Type: application/json" \
  -d '{"query": "Introduce yourself in one sentence", "response_mode": "blocking"}'

Errors

ErrorScenario
401Invalid key (see authentication)
A_DATA_NOT_FOUNDCharacter not found
A_MODEL_NOT_AVAILABLEModel missing or disabled

Previous: API Keys & Authentication · Next: Knowledge Base Q&A