Skip to main content

Novita

Route your Novita API calls through AI SpendOps for automatic usage tracking and cost attribution.

Configuration

SettingValue
Route/v1/novita/*
Upstreamhttps://api.novita.ai/v3/openai
Auth headerAuthorization: Bearer ...
Streaming usageAuto-injected (stream_options.include_usage)

SDK base URL

https://proxy.aispendops.com/v1/novita/v1

The upstream already includes Novita's /v3/openai prefix, so your SDK base URL stops at /v1. Adding /v3/openai yourself will produce a doubled path and a 404 from Novita rather than an error from the proxy.

Example

curl https://proxy.aispendops.com/v1/novita/v1/chat/completions \
-H "Authorization: Bearer your-novita-key" \
-H "X-ASO-API-Key: aso_k_yourkey.secret" \
-H "Content-Type: application/json" \
-d '{"model":"meta-llama/llama-3.1-70b-instruct","messages":[{"role":"user","content":"Hello"}]}'

Usage fields

FieldDescription
prompt_tokensInput tokens
completion_tokensOutput tokens

Endpoints that have no tokens

Novita is a multi-modal platform, so a single account often mixes chat completions with image generation. Those are priced completely differently: chat is per token, image generation is per image and varies by size and quality.

Token counts are meaningless for an image request, so AI SpendOps records the attributes that actually drive the price instead. For calls to /images/* endpoints it captures:

FieldSource
image_countThe n parameter, defaulting to 1
image_sizeThe size parameter
image_qualityThe quality parameter
modelThe model parameter

That happens in the background after your response has been returned, so it adds nothing to request latency. It also means a mixed workload shows up correctly in reporting: image spend attributed per image, chat spend attributed per token, both under the same dimensions and the same ASO key.

What AI SpendOps records

FieldPopulated
cache_read_tokensNo
cache_write_tokensNo
reasoning_tokensOnly where the model returns completion_tokens_details
provider_costNo. Cost is calculated from the recorded usage and the current Novita rate card

Notes

  • The proxy injects stream_options: { include_usage: true } on streaming chat requests. See Streaming.
  • Model identifiers are Hugging Face style paths, and allow-list entries must use the full path.
  • Full field definitions are in the usage event field reference.