Appearance
SDK pricing URL and custom JSON
The elsai-arms SDK computes span cost at ingest when the model id is in a pricing table (pricing_json or ELSAI_ARMS_PRICING_JSON).
If you omit pricing_json, the SDK picks pricing automatically. To match prices configured in ARMS, pass the public export URL or a local custom file.
Public export URL
Each active database configuration exposes:
https://<arms-host>/api/pricing/export/<database-config-id>
Copy it from the bar on Manage Models. No API key is required. The response is cache-friendly (Cache-Control: public, max-age=300). Share it only with systems that should read your model prices.
Price edits in Manage Models apply to future SDK ingest. Historical spans need Auto Pricing or a manual recalculate.
python
import elsai_arms
elsai_arms.init(
otlp_endpoint="https://<arms-host>/api/ingest",
otlp_headers={"x-api-key": "<api-key>"},
pricing_json="https://<arms-host>/api/pricing/export/<database-config-id>",
)This SDK is Python only.
Local custom pricing.json
Pass a filesystem path (no URL scheme) to load a file:
python
elsai_arms.init(
otlp_endpoint="https://<arms-host>/api/ingest",
otlp_headers={"x-api-key": "<api-key>"},
pricing_json="/path/to/pricing.custom.json",
)Units are USD per 1,000 tokens. Manage Models stores per 1M tokens; the export endpoint divides by 1000 to match this schema. Keys must exactly match the model id on the span. If tokens are present but cost is $0, add that id.
Supported groups: chat, embeddings, audio, images.
json
{
"chat": {
"gpt-4o-mini": {
"promptPrice": 0.00015,
"completionPrice": 0.0006
},
"us.anthropic.claude-sonnet-4-5-20250929-v1:0": {
"promptPrice": 0.003,
"completionPrice": 0.015
}
},
"embeddings": {
"text-embedding-3-small": 0.00002
},
"audio": {
"whisper-1": 0.006
},
"images": {
"dall-e-3": {
"standard": {
"1024x1024": 0.04
}
}
}
}You can also host the same JSON at any https:// URL; the SDK GETs it on startup.