Skip to content
هذه الصفحة غير متاحة بلغتك بعد، لذا تُعرض باللغة الإنجليزية.
Zhipu AI · GLM

glm-5 API

Use glm-5 on APISea for text generation and multi-turn chat with prompt-cache reads.

محادثةالمحادثة والنصمتزامنالتخزين المؤقت للمطالبات
معرّف النموذج
glm-5

تسعير API لنموذج glm-5

جميع الأسعار بالدولار الأمريكي (USD). مقارنة أسعار APISea بالسعر الرسمي المعلن للوحدة نفسها.

نوع الـ tokenAPISeaرسميوفّر
الإدخال لكل 1M رمز$0.88$1.00−12%
الإدخال المخزّن مؤقتًا لكل 1M رمز$0.176$0.20−12%
الإخراج لكل 1M رمز$2.82$3.20−12%

ما هو glm-5؟

glm-5 is a chat model from Zhipu AI’s GLM family, available through APISea for text generation and multi-turn conversations. Send text messages with user, assistant, and system roles to supply requests, conversation history, and behavioral instructions. The model supports up to 200,000 input tokens and up to 128,000 output tokens, making it an option for workflows that pass substantial text context or request lengthy responses. The chat interface offers temperature, top_p, stop sequences, and max_tokens controls, plus streaming or complete-response output.

Call glm-5 using APISea’s OpenAI-compatible base URL, https://api.apisea.ai/v1, and your API key. Billing is pay-as-you-go and applies only to successful requests: input costs $0.88 per 1M tokens, cached input costs $0.176 per 1M tokens, and output costs $2.82 per 1M tokens. The default configuration is about 12% below the provider list price.

أبرز مزايا glm-5

Large Input Allowance

Provide up to 200,000 input tokens for text-based requests and conversation context.

Extended Output Allowance

Generate up to 128,000 output tokens. Use max_tokens to set a smaller response budget for each request.

Prompt-Cache Reads

glm-5 supports prompt-cache reads, priced at $0.176 per 1M tokens on APISea.

Flexible Chat Controls

Adjust temperature, top_p, repetition penalties, and stop sequences through the chat interface. Choose streaming output or receive the complete response at once.

كيفية استدعاء API الخاص بـ glm-5 في 4 خطوات

  1. 01

    احصل على API key

    سجّل الدخول إلى APISea، واشحن رصيدك بدءًا من $50، وأنشئ مفتاح sk-sea من وحدة التحكم.

  2. 02

    اضبط عنوان URL الأساسي

    استخدم https://api.apisea.ai/v1 عنوانًا أساسيًا في SDK أو عميل HTTP.

  3. 03

    أرسل الطلب

    استدعِ POST /v1/chat/completions مع "model": "glm-5" والمعلمات أدناه.

  4. 04

    تعامل مع الاستجابة

    اقرأ الاستجابة (أو استقبل الـ tokens بالتدفق باستخدام stream: true). يظهر الاستخدام والتكلفة في وحدة التحكم.

curl https://api.apisea.ai/v1/chat/completions \
  -H "Authorization: Bearer $APISEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5",
    "messages": [
      {"role": "system", "content": "You are a concise assistant."},
      {"role": "user", "content": "Explain what an AI API gateway does in two sentences."}
    ],
    "stream": false
  }'

المعلمات

المعلمةالنوعمطلوبافتراضيالوصف
modelstringمطلوبgpt-5Model name
messagesarrayمطلوب—List of conversation messages
rolestringمطلوبuserRole type
contentstringمطلوب—Message content
temperaturenumberاختياري—Controls output randomness, range 0-2
max_tokensintegerاختياري—Maximum number of tokens to generate
streambooleanاختياري—Whether to use streaming output
top_pnumberاختياري—Nucleus sampling parameter, range 0-1
frequency_penaltynumberاختياري—Frequency penalty, range -2.0 to 2.0
presence_penaltynumberاختياري—Presence penalty, range -2.0 to 2.0
stopstring or arrayاختياري—Stop sequences
nintegerاختياري—Number of completions to generate

ما الذي يمكنك إنشاؤه باستخدام glm-5

Conversational Assistants

Build text-based assistants that receive user requests, retain supplied conversation history, and follow system-level instructions.

Document Summaries

Supply document text and request summaries or answers based on that material, keeping the full request within the input limit.

Long-Form Drafting

Request reports, outlines, or other extended text drafts, with max_tokens controlling the output budget.

Text Revision Workflows

Send existing copy alongside instructions to rewrite, shorten, or reorganize it for a specific audience.

نصائح للحصول على نتائج أفضل

  • 01

    Set an Output Budget

    Set max_tokens to the response length your application needs rather than always allowing the maximum. Output is priced at $2.82 per 1M tokens.

  • 02

    Choose One Sampling Control

    Start by adjusting either temperature or top_p, as recommended in the chat documentation. Lower temperature values make output more deterministic.

  • 03

    Check Cache Eligibility

    Prompt-cache reads cost $0.176 per 1M tokens versus $0.88 per 1M tokens for regular input. Check the documentation for cache behavior before assuming repeated input will qualify.

  • 04

    Specify Streaming Explicitly

    Set stream to true for SSE output or false for a complete response. Explicitly setting it avoids relying on endpoint-specific defaults.

القيود ومعلومات مهمة

  • Maximum input is 200,000 tokens per request.

  • Maximum output is 128,000 tokens; max_tokens can impose a lower limit.

  • The supplied model facts describe text chat, not image, video, or audio capabilities.

الأسئلة الشائعة حول API الخاص بـ glm-5

How much does glm-5 cost on APISea?

Input costs $0.88 per 1M tokens, cached input costs $0.176 per 1M tokens, and output costs $2.82 per 1M tokens. The default configuration is about 12% below the provider list price, with pay-as-you-go billing only for successful requests.

How do I call glm-5 through the API?

Use https://api.apisea.ai/v1 as your OpenAI-compatible base URL and send a POST request to /chat/completions. Authenticate with your API key as a Bearer token, set the model field to glm-5, and supply a messages array.

What are glm-5’s input and output limits?

The maximum input is 200,000 tokens, and the maximum output is 128,000 tokens. Set max_tokens to limit the generated response below that output ceiling.

Which generation parameters can I use?

The documented chat interface includes temperature, top_p, max_tokens, frequency_penalty, presence_penalty, stop, n, and stream. Messages use role and content fields, with user, assistant, and system roles.

Does glm-5 support streaming and prompt caching?

The chat interface supports streaming with stream set to true and complete responses with stream set to false. glm-5 supports prompt-cache reads; check the documentation for cache eligibility and behavior.

Can I use glm-5 commercially?

Commercial use is subject to the provider’s terms and applicable APISea terms. Review those terms for your intended application before deployment.

نماذج ذات صلة

العمق: أكثر من 250 نموذجًا · الحد الأدنى لشحن الرصيد $50

ابدأ التطوير باستخدام glm-5

مفتاح واحد، وادفع حسب الاستخدام بدءًا من $50؛ ولا تُحتسب الرسوم إلا على الطلبات الناجحة.