The platform offers endpoints that follow the standard Chat Completions request and response shape, so an existing SDK or tool works by changing only the base address and the API key. Any client library that supports a custom base address will work — the SDK package names in the samples below are the ones you install, unchanged.
Point your HTTP client at this base address. If you are moving an existing integration, this is the only value that changes.
/v1Pass your platform API key in the Authorization header using the Bearer scheme, the same way you would with the upstream API.
Authorization: Bearer YOUR_API_KEYAPI keys can be created and rotated in Settings → API keys.
/v1/modelsLists every model available. Returns the model ids you can use in chat completions and embeddings requests.
Response
{
"object": "list",
"data": [
{
"id": "glm-5.3-flash",
"object": "model",
"created": 1700000000,
"owned_by": "organization"
}
]
}Examples
curl https://your-api-host.com/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"/v1/chat/completionsCreates a chat completion. The answer can stream, or arrive whole.
Request body
{
"model": "glm-5.3-flash",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Hello!" }
],
"stream": false,
"temperature": 0.7,
"max_tokens": 1024
}Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1700000000,
"model": "glm-5.3-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 10,
"total_tokens": 30
}
}Examples
curl https://your-api-host.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.3-flash",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'Set stream: true to receive Server-Sent Events. The streaming format is identical to the upstream API.
/v1/embeddingsCreate embeddings for the given input text. Returns vector representations that can be used for search.
Request body
{
"model": "intfloat/multilingual-e5-large-instruct",
"input": "The quick brown fox jumps over the lazy dog"
}Response
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0023, -0.0091, 0.0152, ...]
}
],
"model": "intfloat/multilingual-e5-large-instruct",
"usage": {
"prompt_tokens": 9,
"total_tokens": 9
}
}Examples
curl https://your-api-host.com/v1/embeddings \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "intfloat/multilingual-e5-large-instruct",
"input": "Hello world"
}'/v1/responsesCreate a response using the Responses API. This is an alternative to chat completions that supports richer output.
Request body
{
"model": "glm-5.3-flash",
"input": "Explain quantum computing in simple terms."
}Response
{
"id": "resp-abc123",
"object": "response",
"created_at": 1700000000,
"model": "glm-5.3-flash",
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Quantum computing uses..."
}
]
}
]
}Examples
curl https://your-api-host.com/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.3-flash",
"input": "Explain quantum computing."
}'The fastest way to get started is to install the SDK and point it at your platform base address.
pip install requests
import requests
r = requests.post(
"https://your-api-host.com/v1/chat/completions",
headers={"Authorization": "Bearer YOUR_API_KEY"}, # from Settings > API keys
json={
"model": "glm-5.3-flash",
"messages": [{"role": "user", "content": "Hello!"}],
},
)
print(r.json()["choices"][0]["message"]["content"])How this differs from the upstream API, and what it does not do.