Setup Python SDK

How to setup the Python SDK

Install Konko AI's Python SDK

1. Enable a Python3.8+ environment

2. Install the SDK

pip install konko

3. Set API Keys

Option 1: Set Environment Variables

  1. You can set environment variables for
    1. KONKO_API_KEY (Required)
    2. OPENAI_API_KEY (Optional if you enable OpenAI for your account on the API Keys page ➡️)
  2. In your current shell session, use the export command:
export OPENAI_API_KEY=OPENAI_API_KEY # Optional if you enabled OpenAI on API Keys page

Option 2: Set API Keys Programmatically

konko.api_key = 'KONKO_API_KEY' 
konko.openai_api_key = 'OPENAI_API_KEY' # Optional if you enabled OpenAI on API Keys page

4. Verify Installation & Authentication

# Confirm konko has installed successfully
import konko
# Confirm you receive a valid response indicating Konko API key is successfully set

What’s Next