Skip to content
API referenceModel and API contract

Model and API contract

What Guard guarantees to clients without exposing internal routing.

Model protocol

Public guarantees

  • Claude Messages without a server prompt: preserves the native Anthropic Messages structures listed in these docs — thinking signatures, tool blocks, documents/citations, server-tool results, and usage.
  • server prompt: preserves the requested public model and provides the endpoint-aware compatibility described in the matrix; an unavailable capability returns an explicit error.
  • Fable 5 and 5.1: separate public models in Messages, Chat Completions, Responses and count_tokens. The existing Fable 5 ID does not switch to 5.1.
  • Opus 5.5: a separate public model in Messages, Chat Completions, Responses and count_tokens. A bare opus resolves to it.
  • Haiku 5.5: a separate public model in Messages, Chat Completions, Responses and count_tokens. A bare haiku resolves to it.
  • Service errors: temporary unavailability is returned as a neutral 503/504; retry with exponential backoff and respect Retry-After when present.
bash
curl -s https://api.guardrelay.ai/v1/messages \
  -H "x-api-key: $GUARD_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model":"claude-opus-5","max_tokens":16,"messages":[{"role":"user","content":"ping"}]}'

Kimi, Composer and Grok

For every family, the requested public model ID determines the model name in the reply and its base tariff. An unknown ID returns 404; use an exact catalog ID.

  • Kimi. Four exact ids, no free spellings. If a different model answered upstream, the request is not delivered, the reserve is returned in full and you pay nothing: you get 502 kimi_model_mismatch.
  • Composer and Grok. Ten exact ids. Effort level and Fast mode are part of the id, so picking a model picks the level and the tariff at once; there are no fields for them.
  • Client tools do work for them on all three surfaces: see Client tools.
  • Unsupported for Composer/Grok: MCP, documents, native citations, structured outputs and count_tokens. Sampling and block-level cache_control are accepted without effect; they do not control generation or caching.

You can check it yourself: the model field in the response repeats the id you sent.

bash
curl -s -X POST https://api.guardrelay.ai/v1/chat/completions \
  -H "Authorization: Bearer $GUARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"k3","max_tokens":16,"messages":[{"role":"user","content":"ping"}]}'

What Guard guarantees for Kimi

  • Model. The public id you send is the one that comes back and the one billing uses. Guard never lets a substitution through.
  • A different model. If another model answered upstream the request ends as 502 kimi_model_mismatch, the reserve is returned in full and no usage row is written. You pay nothing for that request.
  • Streaming. The model name is checked on the very first frame, before the answer reaches you.
  • Rate. Billing uses the full published rate of the model you asked for, accounting for cache reads.
  • Surfaces. Kimi is served on all three: plain POST /v1/chat/completions, the Anthropic Messages protocol and the Responses protocol. The model guarantee is the same on each of them.
bash
curl -s -X POST https://api.guardrelay.ai/v1/chat/completions \
  -H "Authorization: Bearer $GUARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"cursor-grok-4.6-medium","max_tokens":16,"messages":[{"role":"user","content":"ping"}]}'
bash
curl -s -X POST https://api.guardrelay.ai/v1/chat/completions \
  -H "Authorization: Bearer $GUARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"composer-2.5","max_tokens":16,"messages":[{"role":"user","content":"ping"}]}'

Requested and returned GLM model

The client selects only glm-5.3 or glm-5.3-flash. Guard creates no short aliases and does not rewrite the response model field: the Z.AI value is preserved.

FactRule
Requested modelControls access, media validation, and the client rate.
Returned modelPreserved from the native Z.AI response and may be more specific.
Usage rowRecorded under the exact public ID requested by the client.
bash
curl https://api.guardrelay.ai/glm/v1/models \
  -H "Authorization: Bearer $GUARD_API_KEY"

The catalog does not publish a fixed context window or maximum output. Do not hard-code such numbers by analogy with another provider.

Sections

On this page