Sozdai LogoDocs
Docs/LLM

GLM 5.3 Flash

1.05M contextPrompt-cachingRedeneren
POSThttps://api.foxwire.ai/v1/chat/completions

#Pricing Summary

#Voorbeeldaanvraag

Execute completions using standard OpenAI SDK formats by pointing base endpoints here.

bash
curl https://api.foxwire.ai/v1/chat/completions \
  -H "Authorization: Bearer $CORRY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.3-flash",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

#Antwoordvoorbeeld

Een standaard OpenAI-compatibel chat completion-object. Het model-veld wordt genormaliseerd naar de naam die je hebt aangevraagd.

json
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "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": 12, "completion_tokens": 9, "total_tokens": 21, "cost": 0.000234, "currency": "USD" }
}

Cost field

usage.cost is the amount charged for this call (in USD); in streaming it arrives on the final chunk that carries usage. OpenAI SDKs ignore this extra field.

#Prompt-caching

Plaats bij cache-geschikte modellen de lange statieke inhoud (systeem, kennisbank) eerst en voeg een cache-breekpunt toe. Gecachte delen kunnen slechts 1/10 kosten. Cache-treffers worden weergegeven in het usage-veld van het antwoord.

json
{
  "model": "glm-5.3-flash",
  "messages": [
    {
      "role": "system",
      "content": [
        { "type": "text", "text": "( long static context ... )", "cache_control": { "type": "ephemeral" } }
      ]
    },
    { "role": "user", "content": "your question" }
  ]
}

Prompt Caching Tip

Prompt caching matches request prefixes exactly. Make sure long contexts (e.g. system instructions, developer tools) appear at the start of your message list.

#Redeneren

Voeg voor modellen die dit ondersteunen reasoning_effort toe (low / medium / high). Het redeneren wordt teruggegeven in het reasoning_content-veld van het antwoord; redeneertokens worden tegen het uitvoertarief gefactureerd.

json
{
  "model": "glm-5.3-flash",
  "max_tokens": 2048,
  "reasoning_effort": "high",
  "messages": [{ "role": "user", "content": "your question" }]
}