Mirascope Frog Logo
Mirascope
DocsBlogPricingCloud
⌘K
Type to search
⌘Kto search
Escto close
mirascope
v2.0.2
1.4k
Join our
WelcomeLearnGuidesAPI Referencev1 (Legacy)
DocsGuidesAPI
Overview
Core
CallCall ParamsCall ResponseCall Response ChunkDynamic ConfigStreamTool
Llm
CallCall ResponseCall Response ChunkContextOverrideStreamTool
Mcp
Client
Retries
FallbackTenacity
Tools
# mirascope.core.xai.stream The `XAIStream` class for convenience around streaming xAI LLM calls. <Info title="Usage"> [Streams](/docs/v1/learn/streams) </Info> ## <ApiType type="Class" path="core/xai/stream" symbolName="XAIStream" /> XAIStream A simple wrapper around `OpenAIStream`. Everything is the same except updates to the `construct_call_response` method and the `cost` property so that cost is properly calculated using xAI's cost calculation method. This ensures cost calculation works for non-OpenAI models. **Bases:** <TypeLink type={{"type_str": "OpenAIStream", "description": null, "kind": "simple", "doc_url": "/docs/v1/api/core/openai/stream#openaistream"}} /> <AttributesTable attributes={[ { "name": "cost", "type_info": { "type_str": "float | None", "description": null, "kind": "union", "base_type": { "type_str": "Union", "description": null, "kind": "simple", "doc_url": "https://docs.python.org/3/library/typing.html#typing.Union" }, "parameters": [ { "type_str": "float", "description": null, "kind": "simple", "doc_url": "https://docs.python.org/3/library/functions.html#float" }, { "type_str": "None", "description": null, "kind": "simple", "doc_url": "https://docs.python.org/3/library/constants.html#None" } ] }, "description": "Returns the cost of the call." } ]} /> ## <ApiType type="Function" path="core/xai/stream" symbolName="construct_call_response" /> construct_call_response <ParametersTable parameters={[ { "name": "self", "type_info": { "type_str": "Any", "description": null, "kind": "simple", "doc_identifier": null } } ]} /> <ReturnTable returnType={{ "type_info": { "type_str": "XAICallResponse", "description": null, "kind": "simple", "doc_url": "/docs/v1/api/core/xai/call_response#xaicallresponse" } }} />

Provider

On this page

Provider

On this page

© 2026 Mirascope. All rights reserved.

Mirascope® is a registered trademark of Mirascope, Inc. in the U.S.

Privacy PolicyTerms of Use