Novita
Route your Novita API calls through AI SpendOps for automatic usage tracking and cost attribution.
Configuration
| Setting | Value |
|---|---|
| Route | /v1/novita/* |
| Upstream | https://api.novita.ai/v3/openai |
| Auth header | Authorization: Bearer ... |
| Streaming usage | Auto-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
| Field | Description |
|---|---|
prompt_tokens | Input tokens |
completion_tokens | Output 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:
| Field | Source |
|---|---|
image_count | The n parameter, defaulting to 1 |
image_size | The size parameter |
image_quality | The quality parameter |
model | The 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
| Field | Populated |
|---|---|
cache_read_tokens | No |
cache_write_tokens | No |
reasoning_tokens | Only where the model returns completion_tokens_details |
provider_cost | No. 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.