Expand description
API request/response models for DeepSeek and OpenAI-compatible endpoints.
Structs§
- Cache
Control - Cache control metadata for tool definitions and blocks.
- Container
Info - Container metadata for code-execution style server tools.
- Image
UrlContent - OpenAI-compatible image URL payload inside a multimodal message.
- Message
- A chat message with role and content blocks.
- Message
Delta - Delta payload for message-level updates.
- Message
Request - Request payload handed to the model-client preparation seam.
- Message
Response - Response payload for a message request.
- Opaque
Reasoning State - Provider-owned reasoning continuity that is safe to replay only on the
exact originating API and model. The encrypted payload is deliberately
separate from readable
ContentBlock::Thinkingtext. - Server
Tool Usage - Server-side tool usage counters.
- System
Block - A structured system prompt block.
- Tool
- Tool definition exposed to the model.
- Tool
Caller - Metadata describing who invoked a tool call.
- Usage
- Token usage metadata for a response.
Enums§
- Content
Block - A single content block inside a message.
- Content
Block Start - Content block types used in streaming starts.
- Delta
- Delta events emitted during streaming responses.
- Role
- Who authored a message in a transcript.
- Stream
Event - Streaming event types for SSE responses.
- System
Prompt - System prompt representation (plain text or structured blocks).
- Tool
Call Key - Identity for pairing host history without conflating a provider’s reused string with a local execution. Legacy identity cannot establish a grant.
Constants§
- DEEPSEEK_
V4_ CONTEXT_ WINDOW_ TOKENS - DEFAULT_
COMPACTION_ TOKEN_ THRESHOLD - Last-resort compaction trigger when
context_window_for_modelreturnsNone(an unrecognised model id). v0.8.11 raised this from50_000to102_400(80% ofLEGACY_DEEPSEEK_CONTEXT_WINDOW_TOKENS) so unknown models inherit the same late-trigger discipline as V4 instead of paying the prefix-cache hit at 5% of the V4 window. Known DeepSeek / Claude models resolve to their own scaled value viacompaction_threshold_for_model(#664). - DIRECT_
KIMI_ K3_ MAX_ OUTPUT_ TOKENS - Documented maximum output for the exact direct Kimi K3 API route.
- INTERRUPTED_
ASSISTANT_ CONTEXT_ PREFIX - Prefix attached to interrupted assistant output when it is replayed as context.
- INTERRUPTED_
ASSISTANT_ ROLE - Internal role used for assistant text that was visible before a turn was interrupted.
- KIMI_
CODE_ K3_ CONTEXT_ WINDOW_ TOKENS - Conservative Kimi Code K3 context baseline. The membership route’s real
context is plan-tier dependent (verified 2026-07-20 from
https://www.kimi.com/code/docs/en/kimi-code/models): Moderato gets 256K,
while Allegretto and above get up to 1M. Bare
k3therefore keeps this safe floor everywhere; higher plan entitlements must come from an explicit providercontext_windowconfiguration or fresh provider facts while preserving thek3wire id. - KIMI_
K3_ CONTEXT_ WINDOW_ TOKENS - Kimi K3 context window on the open platform (
kimi-k3pay-as-you-go). Verified 2026-07-20 from https://platform.kimi.ai/docs/guide/kimi-k3-quickstart (1,048,576 tokens). Max output is a separate fact below and must never be conflated with this window. - KIMI_
K3_ DEFAULT_ MAX_ COMPLETION_ TOKENS - Conservative K3 default generation ceiling. The direct Kimi API defaults
max_completion_tokensto 131,072, while its documented route maximum is a separate exact-route fact below. Membership and neighboring routes do not inherit that direct-platform maximum. - LEGACY_
DEEPSEEK_ CONTEXT_ WINDOW_ TOKENS - Context window used only for legacy DeepSeek model IDs that do not name a
newer V4 alias and do not carry an explicit
*ksuffix. - OUTPUT_
CEILING_ STOP_ REASON - Stop reason recorded for a response that reported
stopwhile its own usage shows it ran to the requested output ceiling (#6889). The Chat Completions spelling, so every existing output-limit path treats it as alengthstop.
Functions§
- canonical_
official_ deepseek_ model_ id - context_
window_ for_ model - Map known models to their approximate context window sizes.
- effective_
muse_ wire_ id - Contributor tier of Muse Spark 1.2 is a distinct selectable id with
its own wire model (
muse-spark-1.2-contributor) and cheaper billing in exchange for training-data opt-in. Do not collapse it to the standard tier. - has_
date_ snapshot_ suffix - is_
incomplete_ stop_ reason - True when the provider explicitly reported that it did not complete the
response. Responses API reasons carry an
incomplete:prefix so unknown future reasons cannot accidentally be accepted as a finished answer. - is_
openai_ gpt_ 56_ api_ model - is_
output_ limit_ stop_ reason - True when the provider ended generation because its output allowance was exhausted. Providers use several wire spellings for the same condition.
- max_
output_ tokens_ for_ model - model_
is_ openai_ reasoning_ family - model_
reasoning_ capability - Catalog-first reasoning capability.
Nonemeans no catalog row and no remaining cited fallback — unknown, not “not a reasoning model”. - model_
supports_ reasoning - name_
suffix_ context_ window_ hint - The context window a model name’s
_Nksuffix advertises, when the catalog does not already describe the model (#5441). - stop_
contradicts_ output_ ceiling - True when a Chat Completions
stopis contradicted by the provider’s own usage: the completion tokens it reported equal the output ceiling the request asked for (#6889). A finished answer leaves the allowance unfilled, so this response was cut at the ceiling, typically by reasoning that used the allowance before or during the answer. - stop_
reason_ detail