$messages Chat messages array. * @param string $model Model identifier (e.g., 'anthropic/claude-sonnet-4'). * @param array{ * temperature?: float, * max_tokens?: int, * response_format?: array{type: string}, * } $options Optional parameters for the API call. * * @return array{ * content: string, * model: string, * prompt_tokens: int, * completion_tokens: int, * total_tokens: int, * finish_reason: string, * } Normalized response. * * @throws \RuntimeException On API error after retries exhausted. */ public function send_chat_completion( array $messages, string $model, array $options = array() ): array; /** * Get the list of available models from the provider. * * @return array Available models. */ public function get_available_models(): array; /** * Estimate the cost of an API call based on token counts. * * @param string $model Model identifier. * @param int $prompt_tokens Number of input tokens. * @param int $completion_tokens Number of output tokens. * * @return float Estimated cost in USD. */ public function estimate_cost( string $model, int $prompt_tokens, int $completion_tokens ): float; /** * Get the human-readable name of this provider. * * @return string Provider name (e.g., 'OpenRouter'). */ public function get_provider_name(): string; /** * Validate that the provider's credentials are configured and working. * * @return bool True if credentials are valid. */ public function validate_credentials(): bool; }