Skip to main content

Creating a Client

Create an Artanis client with your API key:
from artanis import Artanis

artanis = Artanis(api_key="sk_...")
Get your API key from the Artanis Dashboard.

Configuration Options

artanis = Artanis(
    api_key="sk_...",           # Required (or set ARTANIS_API_KEY)
    base_url="https://...",     # Optional: custom endpoint
    enabled=True,               # Set False to disable all tracing
    debug=False,                # Enable debug logging
    on_error=None,              # Callback for error handling
)

Parameters

api_key / apiKey
string
required
Your Artanis API key. Can also be set via ARTANIS_API_KEY environment variable.
base_url / baseUrl
string
Custom API endpoint. Default: https://api.artanis.dev
enabled
bool / boolean
Enable or disable all tracing. Default: true. Useful for testing.
debug
bool / boolean
Enable debug logging. Default: false
on_error / onError
callable / function
Callback function for error handling. Receives error as argument.
artanis = Artanis(
    api_key="sk_...",
    on_error=lambda e: logger.warning(f"Artanis error: {e}")
)

Next Steps