All notable changes to Cost Katana Python SDK will be documented in this file.
CostKatanaClient.send_message:thinking,thinking_effort, andthinking_budget_tokens— enables Claude extended thinking on supported models; payload includesthinkingwithenabled, optionaleffort, and optionalbudgetTokens.ck.ai(): same options via**options;SimpleResponse.thinkingis set when the API returns reasoning content.
- AWS Bedrock: alias
llama-3.2-1b/aws_bedrock.llama_3_2_1b_instructnow maps tometa.llama4-scout-17b-instruct-v1:0(replaces retiredmeta.llama3-2-1b-instruct-v1:0).
- README and QUICKSTART: PyPI install name
cost-katana, table of contents, experimentation section, aligned examples.
cost_katana.gateway:gateway_request_headers()for opt-outCostKatana-LLM-Security-Enabled/CostKatana-Output-Moderation-Enabledon direct gateway HTTP calls;GATEWAY_API_PREFIX.CostKatanaClient.get_gateway_security_summary()—GET /api/gateway/security/summary(firewall + moderation aggregates).- README: gateway security defaults and security summary API.
- API paths: Confirmed the SDK uses
https://api.costkatana.comwith REST paths under/api/...(e.g. chat, templates) and OpenAI-compatible gateway calls under/api/gateway/v1/....
- README: AI Gateway (HTTP) section — OpenAI-compatible (
/v1/chat/completions) and Anthropic (/v1/messages) examples withhttpx, optionalCOSTKATANA_GATEWAY_URLandx-project-id, pluscurl; link tocostkatana-examples/2-gateway.
auto_configure()— lazy global client initialization fromCOST_KATANA_API_KEY(used beforeai(),chat(),track()).from_env()— returns aCostKatanaClientbuilt from environment (same two-variable contract asConfig.from_env()).track(entry)— manual cost logging without wiringAILogger; works with lazy env-based setup.groqmodel namespace andGroqprovider label inget_provider_from_model.project_idonConfigwith env fallbacks:PROJECT_ID,COST_KATANA_PROJECT,COSTKATANA_PROJECT_ID.
- Public env contract: only
COST_KATANA_API_KEY(required) andPROJECT_ID(optional). Removed readingAPI_KEY,COST_KATANA_BASE_URL,COST_KATANA_DEFAULT_MODEL, andCOST_KATANA_TIMEOUTfrom the environment — base URL (https://api.costkatana.com), default model, and timeouts are package constants. get_global_client()callsauto_configure()soai()/chat()work without an explicitconfigure()when the API key is in the environment.CostKatanaClientsends optionalx-project-idwhenproject_idis set; warns once whenPROJECT_IDis missing.ai_loggersingleton is lazy — initializes on first use withCOST_KATANA_API_KEY/PROJECT_IDfrom the environment.- Duplicate
mistralclass inmodels_constants.pymerged into a single definition.
- Clarified API Key Requirements: Updated documentation to clearly state that OpenAI and Gemini providers require user-provided API keys
- Added prominent warnings that Cost Katana does not provide OpenAI or Google API keys
- Updated environment variable documentation with detailed explanations for all providers
- Added clear consequences for missing API keys
- Improved consistency across all documentation files
- Enhanced environment variable documentation with user-provided key requirements:
OPENAI_API_KEY- Required for OpenAI models (GPT-4, GPT-3.5, etc.) - USER PROVIDEDGEMINI_API_KEY- Required for Google Gemini models (Gemini 2.5 Pro, Flash, etc.) - USER PROVIDEDAWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY- Required for AWS Bedrock models (Claude, Nova, etc.) - USER PROVIDEDANTHROPIC_API_KEY- Optional for direct Anthropic API access - USER PROVIDED
- Added specific notes about which providers require user API keys
- Updated README.md with comprehensive API key setup instructions
- All API keys must be provided by users - Cost Katana does not include any provider API keys
- Updated README with refined examples repository links
- Improved documentation clarity and structure
- Enhanced package metadata
- Updated package metadata and documentation
- Improved examples and usage guides
- Enhanced README with better examples repository links
- Added prominent "More Examples" section in README linking to complete examples repository
- Added direct links to costkatana-examples repository
- Highlighted 300+ production-ready code samples across HTTP, TypeScript, Python, and frameworks
- Special emphasis on Python SDK examples (Section 8) and FastAPI integration
- New Examples Repository: https://github.com/Hypothesize-Tech/costkatana-examples
- 44 feature sections with comprehensive examples
- Framework integrations: Express, Next.js, Fastify, NestJS, FastAPI
Complete redesign to make using AI in Python as simple as possible.
New ai() function - The easiest way to use AI:
import cost_katana as ck
response = ck.ai('gpt-4', 'Hello')
print(response.text)
print(f"Cost: ${response.cost}")New chat() function - Simple chat sessions:
import cost_katana as ck
session = ck.chat('gpt-4')
session.send('Hello')
session.send('How are you?')
print(f"Total: ${session.total_cost}")- Automatically detects API keys from environment
- Works with
COST_KATANA_API_KEYor provider keys directly - Zero setup if environment is configured
- Smart error messages with actionable steps
- Clean, simple response object
- Direct access to
text,cost,tokens - Bonus fields:
cached,optimized,provider
None! The traditional API (GenerativeModel) still works for backward compatibility.
You can still use:
model = ck.GenerativeModel('gpt-4')
response = model.generate_content('Hello')Or use the new simple API:
response = ck.ai('gpt-4', 'Hello')- Completely rewritten README: Focus on simplicity
- Updated QUICKSTART: 3-step process
- New examples: Real-world use cases with simple API
- Migration guides: From OpenAI, Anthropic, Google SDKs
import cost_katana as ck
ck.configure(api_key='dak_...')
model = ck.GenerativeModel('gpt-4')
response = model.generate_content('Hello')
print(response.text)import cost_katana as ck
response = ck.ai('gpt-4', 'Hello')
print(response.text)New streamlined examples:
simple_examples.py- All basic patternsbasic_usage.py- Getting started- Updated all existing examples to show both APIs
- Improved error messages
- Better environment variable detection
- More robust provider inference
- Multi-provider support
- Cost tracking
- Unified API
- Configuration management