GLM-3-Turbo · Lightweight Text Conversation and Information Extraction
Suitable for processing short text. You can ask the model to classify support tickets, extract specified fields from a passage, or rewrite long sentences into concise replies.
Model and Input/Output
- Request Model
- glm-3-turbo
- Input
- Text messages
- Output
- Text
- Typical Tasks
- Question answering, classification, and extraction
How to Structure Input
Include the text to be classified, the allowed categories, and the output format in the same message. If the input is a conversation history, arrange the messages in chronological order.
Send a Request
Send model and messages to POST /glm/chat/completions. In non-streaming responses, the text is located in choices[0].message.content.
Read Responses Incrementally
After setting stream: true, concatenate choices[0].delta.content from SSE events in order, and save the complete response when the stream ends.
Usage and Pricing
Each million input tokens costs 2.453 Credits, and each million output tokens costs 0.788 Credits. Charges are calculated based on the public model specified in the request. When compatible routing is enabled, the platform can fulfill requests using compatible models in the same tier.
Frequently Asked Questions
What should I enter for model?
Enter glm-3-turbo.
How do I perform text classification?
List mutually exclusive candidate categories and specify what should be returned when none of the categories match.
How do I handle multi-turn conversations?
Add previous user messages, assistant replies, and the new question to the messages array in the next request.
How do I limit the response length?
You can use max_tokens to specify the output limit and describe the required format in your prompt.
How do I verify the usage of a request?
Read usage in the response and check the usage records for that request in the console.
