Sogni AI icon

Sogni AI

Generate AI images, videos, and LLM responses using Sogni AI Supernet

Actions18

LLM → Estimate Cost

AI-generated

Summary

Calculate the estimated cost in tokens and associated pricing for sending a prompt to a selected Sogni LLM chat model.

Inputs

  • llmModelSearch — Optional string to filter available Sogni LLM chat models by their ID before selecting.
  • llmModelId (required) — The specific Sogni chat/LLM model to estimate the cost for.
  • llmPrompt (required) — The user input prompt text to be evaluated for cost estimation.
  • llmSystemPrompt — Optional system instruction to guide the style or behavior of the model.
  • llmAdditionalFields.maxTokens — Maximum number of completion tokens to request; defaults to 256.
  • llmAdditionalFields.messagesJson — Optional JSON array of full chat messages to override prompt and system prompt.
  • llmAdditionalFields.think — Boolean flag to enable reasoning mode if supported by the model.
  • llmAdditionalFields.useSogniHostedTools — Boolean flag to enable Sogni hosted creative tools for tool-augmented generation.
  • llmAdditionalFields.toolsJson — Optional JSON array defining custom tools for use by the model; merges with Sogni hosted tools when enabled.
  • llmAdditionalFields.toolChoiceJson — Optional JSON or keyword to specify tool usage preferences (auto, none, required, or a specific function selection).
  • tokenType — Choice of token type to use for token counting and cost estimation (Spark or SOGNI tokens).

Output shape

a JSON object containing estimated token usage and pricing information for the given prompt and model

Returns detailed token cost estimations without triggering an actual generation. Inputs include prompt or full messages JSON; the model must be specified. Optional fields influence token counting and tool usage assumptions.

Examples

Example 1: Estimate cost of a prompt using a specific Sogni LLM model

Set the Model Search to filter models, choose a Model from the dropdown, provide the Prompt and optionally a System Prompt; adjust Max Tokens and tokenType if desired; then run to retrieve the estimated token cost.

Links

Discussion