Overview
Text Generation (Chat Completions) is one of the core capabilities of LaoZhang API, supporting 200+ popular AI models for intelligent conversations and text generation. Through a unified OpenAI-compatible interface, you can easily implement:- Intelligent Conversations: Build chatbots and virtual assistants
- Content Creation: Article writing, creative generation, copywriting
- Code Assistance: Code generation, debugging, refactoring suggestions
- Knowledge Q&A: Answer questions, knowledge retrieval, information extraction
- Role Playing: Customized AI characters, scenario simulation
Quick Start
Basic Example
Multi-turn Conversation
Core Parameters
model (Required)
Specify the model name. See Model Info for details.messages (Required)
Array of conversation messages withrole and content fields:
system
System prompt defining AI behavior and roleuser
User message representing user inputassistant
Assistant message representing AI responsetemperature (Optional)
Controls output randomness, range0.0 ~ 2.0, default 1.0: