Skip to main content
POST
/
api
/
models
/
pricing
/
calculate
Calculate cost for a model call
curl --request POST \
  --url https://www.narev.ai/api/models/pricing/calculate \
  --header 'Content-Type: application/json' \
  --data '
{
  "modelId": "gpt-4o",
  "provider": "openai",
  "usage": {
    "promptTokens": 1000,
    "completionTokens": 500,
    "cacheReadTokens": 0,
    "cacheWriteTokens": 0,
    "reasoningTokens": 0,
    "webSearchCount": 0
  },
  "subprovider": "OpenAI",
  "isByok": false
}
'
{
  "modelId": "<string>",
  "provider": "anthropic",
  "subprovider": "AI21",
  "usage": {
    "promptTokens": 1000,
    "completionTokens": 500,
    "cacheReadTokens": 0,
    "cacheWriteTokens": 0,
    "reasoningTokens": 0,
    "webSearchCount": 0
  },
  "pricing": {
    "input": 123,
    "output": 123,
    "request": 123,
    "inputCacheRead": 123,
    "inputCacheWrite": 123,
    "internalReasoning": 123,
    "webSearch": 123
  },
  "costBreakdown": {
    "total": 123
  }
}

Documentation Index

Fetch the complete documentation index at: https://narev.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Body

application/json
modelId
string
required
Example:

"gpt-4o"

provider
enum<string>
required
Available options:
anthropic,
bedrock,
cerebras,
chutes,
cohere,
deepinfra,
deepseek,
fireworks,
github-models,
google_ai_studio,
groq,
minimax,
mistral,
moonshot,
nebius,
novita,
nvidia,
openai,
sambanova,
siliconflow,
stepfun,
together,
xai,
zai
Example:

"openai"

usage
object
required
subprovider
enum<string> | null
Available options:
AI21,
AionLabs,
Akash,
AkashML,
Alibaba,
Amazon Bedrock,
Ambient,
Anthropic,
Arcee AI,
AtlasCloud,
Azure,
BaseTen,
Cerebras,
Chutes,
Cirrascale,
Clarifai,
Cloudflare,
Cohere,
Crusoe,
DeepInfra,
DeepSeek,
Featherless,
Fireworks,
Friendli,
GMICloud,
Google,
Google AI Studio,
Groq,
Hyperbolic,
Inception,
Inceptron,
Infermatic,
Inflection,
Io Net,
Ionstream,
Liquid,
Mancer 2,
Mara,
Minimax,
Mistral,
ModelRun,
Moonshot AI,
Morph,
Nebius,
NextBit,
Novita,
Nvidia,
OpenAI,
OpenInference,
Parasail,
Perplexity,
Phala,
Reka,
Relace,
SambaNova,
Seed,
SiliconFlow,
StepFun,
StreamLake,
Switchpoint,
Together,
Upstage,
Venice,
WandB,
Xiaomi,
Z.AI,
github-models,
xAI
Example:

"OpenAI"

isByok
boolean
Example:

false

Response

Cost breakdown when pricing was found.

modelId
string
required
provider
enum<string>
required
Available options:
anthropic,
bedrock,
cerebras,
chutes,
cohere,
deepinfra,
deepseek,
fireworks,
github-models,
google_ai_studio,
groq,
minimax,
mistral,
moonshot,
nebius,
novita,
nvidia,
openai,
sambanova,
siliconflow,
stepfun,
together,
xai,
zai
subprovider
enum<string> | null
required
Available options:
AI21,
AionLabs,
Akash,
AkashML,
Alibaba,
Amazon Bedrock,
Ambient,
Anthropic,
Arcee AI,
AtlasCloud,
Azure,
BaseTen,
Cerebras,
Chutes,
Cirrascale,
Clarifai,
Cloudflare,
Cohere,
Crusoe,
DeepInfra,
DeepSeek,
Featherless,
Fireworks,
Friendli,
GMICloud,
Google,
Google AI Studio,
Groq,
Hyperbolic,
Inception,
Inceptron,
Infermatic,
Inflection,
Io Net,
Ionstream,
Liquid,
Mancer 2,
Mara,
Minimax,
Mistral,
ModelRun,
Moonshot AI,
Morph,
Nebius,
NextBit,
Novita,
Nvidia,
OpenAI,
OpenInference,
Parasail,
Perplexity,
Phala,
Reka,
Relace,
SambaNova,
Seed,
SiliconFlow,
StepFun,
StreamLake,
Switchpoint,
Together,
Upstage,
Venice,
WandB,
Xiaomi,
Z.AI,
github-models,
xAI
usage
object
required
pricing
object
required
costBreakdown
object
required