Skip to main content

Overview

LiteLLM provides comprehensive support for Anthropic’s Claude models, including advanced features like prompt caching, computer use, web search, and extended thinking.

Quick Start

1

Install LiteLLM

2

Set API Key

3

Make Your First Call

Supported Models

Latest generation with extended thinking and advanced reasoning.

Authentication

Extended Thinking (Reasoning)

Claude 4.6 supports extended thinking for complex reasoning tasks:

Prompt Caching

Save costs by caching frequently used context:

Computer Use

Claude can interact with computers through screenshots and commands:
Claude can search the web for current information:

Function Calling

Claude supports sophisticated tool use:

Vision (Multimodal)

Claude models support image analysis:

Streaming

Streaming with Thinking

JSON Mode

Batch Processing

Process requests asynchronously in batches:

Advanced Parameters

System Messages

Temperature and Top P

Stop Sequences

Max Tokens

Error Handling

Cost Tracking

Best Practices

Use Prompt Caching

Cache system prompts and long documents to reduce costs by up to 90%.

Set Max Tokens

Always set max_tokens - it’s required by Anthropic’s API.

Use Extended Thinking

Enable thinking for complex reasoning, math, and analysis tasks.

Try Haiku First

Use Claude 3.5 Haiku for simple tasks - it’s fast and cost-effective.

Function Calling

Deep dive into tool use with Claude

Vision

Working with images in Claude

Streaming

Stream responses in real-time

Batching

Process requests in batches