tbuy

glm-5.1 API pricing & access

glm-5.1 API pricing: $0.845 per 1M tokens. glm-5.1. Supports text input and text output. Listed specifications follow public vendor d…

glm-5.1 API access

glm-5.1. Supports text input and text output. Listed specifications follow public vendor documentation. Available features and limits depend on the selected serving channel.

Compare supported API endpoints and capabilities, then access glm-5.1 through the unified API gateway.

Category
text
Context length
200000 tokens
Maximum output
128000 tokens
Supported APIs
OpenAI Chat Completions API, Anthropic Messages API
API endpoints
POST /v1/chat/completions, POST /v1/messages
Input modalities
text
Output modalities
text
Capabilities
reasoning, streaming, function calling, caching, structured output

glm-5.1 API pricing

Base input price
$0.845 per 1M tokens
Base output price
$3.38 per 1M tokens

Base prices are shown in USD before group-specific adjustments. Open the live pricing page for current access-group prices.

About glm-5.1

GLM-5.1 is Z.ai’s text generation model, with its model card emphasizing repository generation, terminal work and sustained engineering iteration. Existing repositories and executable acceptance cases can evaluate planning, edits and diagnosis.

Applications must execute tool actions and return results. Check the route’s thinking, tool and context parameters; model-card benchmarks do not guarantee project outcomes. Official reference, checked 2026-10-14.

Use cases and prompting

  1. Provide requirements, relevant source and constraints; request a scoped change and acceptance checklist.
  2. Keep terminal errors and environment versions; distinguish verified facts from commands still to run.
  3. Run existing checks at each stage and return actual results before advancing.
  4. Compare identical cases with glm-5.3; record complete outputs, failures and actual usage. See the API documentation for integration.

How to call glm-5.1

glm-5.1 is served through tbuy's unified gateway. Existing OpenAI or Anthropic SDK code keeps working: point base_url at https://modelsok.com and use your tbuy API key.

curl (OpenAI-compatible)

curl https://modelsok.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "glm-5.1", "messages": [{"role": "user", "content": "Hello"}]}'

Python (openai SDK)

from openai import OpenAI

client = OpenAI(base_url="https://modelsok.com/v1", api_key="YOUR_API_KEY")
response = client.chat.completions.create(
    model="glm-5.1",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

Python (anthropic SDK)

from anthropic import Anthropic

client = Anthropic(base_url="https://modelsok.com", api_key="YOUR_API_KEY")
message = client.messages.create(
    model="glm-5.1",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
print(message.content[0].text)

Frequently asked questions about glm-5.1

What is glm-5.1?

glm-5.1. Supports text input and text output. Listed specifications follow public vendor documentation. Available features and limits depend on the selected serving channel.

How do I call glm-5.1?

Create an API key with access to glm-5.1, then use the exact model ID and a supported endpoint from the API access section. Request fields depend on the selected endpoint.

How is glm-5.1 priced?

Pricing depends on the selected provider group and the model billing unit. Refer to the current input, output, request, or media prices in the pricing section.

What is the context window of glm-5.1?

The model catalog lists a context window of 200000 tokens. Check the selected endpoint for request limits.

What is the maximum output of glm-5.1?

The model catalog lists a maximum output of 128000 tokens. Your request settings may set a lower limit.

How should I evaluate glm-5.1 for my project?

Start with the use cases and prompting guidance on this page, then evaluate the model with representative inputs from your project.

Back to AI model API pricing