Overview
TheChatResponse schema defines the structure of successful chat completion responses from the LLM Gateway. It includes the generated content, provider information, and token usage statistics.
Schema Definition
Unique identifier for the chat completion response.
The LLM provider that fulfilled the request (e.g.,
"gemini", "ollama").The generated completion text from the model.
Token usage statistics for the completion.
Example Response
Provider Examples
Theprovider field indicates which LLM backend processed your request:
Understanding Token Usage
Theusage object helps you track and optimize your API consumption:
- prompt_tokens: Represents the size of your input (messages sent)
- completion_tokens: Represents the size of the model’s response
- total_tokens: Combined count used for billing and rate limiting
Nested Schemas
Usage Schema
TheUsage object is a nested schema that provides detailed token consumption metrics:
Python
Related Schemas
- ChatRequest - Request schema for chat completions
- Errors - Error response formats