Sends a chat completion request
Chat parameters
The chat completion response
Streams a chat completion response
Chat parameters
Async iterable of chat chunks
Generates embeddings for the given input
Embedding parameters
The embedding vectors
Calculates the cost of a chat completion based on token usage. Returns 0 if no pricing information is available for the model.
The model used
Token usage information
Cost in USD, or 0 if pricing not configured
OpenAI provider implementation for Stratix AI Agents.
Requires explicit model configuration - no defaults provided. Supports GPT-4, GPT-3.5, and embeddings models with function calling and streaming.
Example: Using predefined model constants
Example: Custom models with updated pricing
Example: Without pricing (calculateCost returns 0)
Example: Streaming