Skip to content

gatana-ai/gatana-python

Gatana Logo

Gatana Python

🚀 Python SDK & LangChain Sandbox Backend


Homepage  •  Documentation  •  Discord  •  JavaScript SDK & CLI tools

Packages

This is a monorepo containing multiple PyPI packages:

Package Description PyPI
gatana-langchain LangChain Sandbox integration toolkit PyPI
gatana-client SDK client for Gatana PyPI

Installation

pip install gatana-langchain
# or, if you only want the SDK:
pip install gatana-client

Or with uv:

uv add gatana-langchain
# or, if you only want the SDK:
uv add gatana-client

Quick Start

from gatana_client import GatanaClient
from gatana_langchain import GatanaSandbox

# Env variables: GATANA_API_KEY and GATANA_ORG_ID
# Or, ~/.gatana.config

client = GatanaClient()

For configuration, you can prepare a file at ~/.gatana.config, see Config File for details. You can override configuration using environment variables or by passing options directly in the SDK.

Configuration

gatana-client resolves authentication in the following order:

  1. Passed optionstoken + (org_id or base_url)
  2. Environment variablesGATANA_API_KEY + (GATANA_ORG_ID or GATANA_BASE_URL)
  3. Config file ~/.gatana.config — API key or access token per organization

Environment Variables

Variable Description
GATANA_API_KEY API key for authentication
GATANA_ORG_ID Organization ID (derives https://<org-id>.gatana.ai/api/v1)
GATANA_BASE_URL Override the base URL directly

Config File

The config file at ~/.gatana.config supports multiple organizations:

{
  "orgs": {
    "my-org": {
      "baseUrl": "https://my-org.gatana.ai",
      "apiKey": "sk-...",
      "tokens": {
        "access_token": "...",
        "refresh_token": "...",
        "expires_at": 1234567890
      }
    }
  },
  "defaultOrgId": "my-org"
}

Authentication methods per organization:

  • API key — set directly in the config file or via the Gatana CLI (gatana config set-api-key)
  • OIDC tokens — set via the Gatana CLI (gatana config login), tokens are read as-is

Note: The config file format is shared with the Gatana CLI tools. You can use the CLI to manage your ~/.gatana.config and the Python SDK will pick it up automatically.

SDK

Custom Authentication

Provide a ConfigLoader or explicit options:

from gatana_client import GatanaClient, ConfigLoader, OptionsConfigStrategy

# Using explicit options
client = GatanaClient(token="sk-...", org_id="my-org")

# Using a custom config loader
client = GatanaClient(
    config_loader=ConfigLoader([
        OptionsConfigStrategy(api_key="sk-...", org_id="my-org")
    ])
)

Development

See CONTRIBUTING.md for how to set up the development environment, run tests, and submit changes.

License

MIT — Copyright (c) 2026 Gatana

About

Langchain Deep Agent Sandbox implementation for Gatana, and general Gatana Python SDK

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors