# Example usage in a CRON job
if __name__ == "__main__":
    update_span_costs("your-project-name")
```

This approach is particularly useful when:

* Using models or providers not yet supported by automatic cost tracking
* You have a custom pricing agreement with your provider
* You want to track additional costs beyond model usage
* You need to implement cost estimation as a background process
* Working with integrations where spans are automatically managed

<Tip>
  You can run the cost update function as a CRON job to automatically update costs for spans created without cost
  information. This is especially valuable in production environments where accurate cost data for all spans is
  essential.
</Tip>

## Supported Models, Providers, and Integrations

Opik currently calculates costs automatically for all LLM calls in the following Python SDK integrations:

* [Google ADK Integration](/integrations/adk)
* [AWS Bedrock Integration](/integrations/bedrock)
* [LangChain Integration](/integrations/langchain)
* [OpenAI Integration](/integrations/openai)
* [LiteLLM Integration](https://docs.litellm.ai/docs/observability/opik_integration)
* [Anthropic Integration](/integrations/anthropic)
* [CrewAI Integration](/integrations/crewai)
* [Google AI Integration](/integrations/gemini)
* [Haystack Integration](/integrations/haystack)
* [LlamaIndex Integration](/integrations/llama_index)

### Supported Providers

Cost tracking is supported for the following LLM providers (as defined in `opik.LLMProvider` enum):

* **OpenAI** (`openai`) - Models hosted by OpenAI ([https://platform.openai.com](https://platform.openai.com))
* **Anthropic** (`anthropic`) - Models hosted by Anthropic ([https://www.anthropic.com](https://www.anthropic.com))
* **Anthropic on Vertex AI** (`anthropic_vertexai`) - Anthropic models hosted by Google Vertex AI
* **Google AI** (`google_ai`) - Gemini models hosted in Google AI Studio ([https://ai.google.dev/aistudio](https://ai.google.dev/aistudio))
* **Google Vertex AI** (`google_vertexai`) - Gemini models hosted in Google Vertex AI ([https://cloud.google.com/vertex-ai](https://cloud.google.com/vertex-ai))
* **AWS Bedrock** (`bedrock`) - Models hosted by AWS Bedrock ([https://aws.amazon.com/bedrock](https://aws.amazon.com/bedrock))
* **Groq** (`groq`) - Models hosted by Groq ([https://groq.com](https://groq.com))

You can find a complete list of supported models for these providers in the
[model\_prices\_and\_context\_window.json file](https://github.com/comet-ml/opik/blob/main/apps/opik-backend/src/main/resources/model_prices_and_context_window.json).

<Tip>
  We are actively expanding our cost tracking support. Need support for additional models or providers? Please [open a
  feature request](https://github.com/comet-ml/opik/issues) to help us prioritize development.
</Tip>