Requirements
Ensure you have the following prerequisites:- Python 3.10 or higher
- pip (Python package installer)
Setting Up Your Environment
- Create a Virtual Environment (optional but recommended):
- Install the SDK:
- Verify Installation — initialize the client to confirm the SDK is working:
Custom API URL and headers
By default, the SDK callshttps://api.galtea.ai. When your network reaches Galtea through an API gateway, set
the gateway URL and the extra headers the gateway needs. The SDK sends those headers on every request to the Galtea
API, including the span exports. File uploads and downloads do not carry them yet.
Pass them to the Galtea constructor:
base_url: the API URL to call.headers: a dictionary of header names to string values.
GALTEA_API_URL: the API URL to call.GALTEA_EXTRA_HEADERS: a JSON object of header names to string values. Every value must be a string.
headers, the SDK ignores
GALTEA_EXTRA_HEADERS completely and does not merge the two.
The SDK always sets
Authorization (your API key, as Bearer gsk_...), User-Agent, Content-Type,
Content-Length and Host itself. A configured header with one of these names, in any letter case, is ignored
with a warning that names the header. If GALTEA_EXTRA_HEADERS is not a JSON object of
strings, a header name is not a valid HTTP name (for example it has a space), two names differ only in letter
case, or a header value has a line break, leading whitespace or a non-Latin-1 character, Galtea() raises a
ValueError that does not show the value. A GALTEA_EXTRA_HEADERS that holds only spaces counts as unset. A redirect that changes the host, the scheme or the
port drops the extra headers. A subdomain is another host. A redirect from http to https on the default ports keeps them.