Documentation Index
Fetch the complete documentation index at: https://docs.switchport.ai/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Python 3.8 or higher
- A Switchport account (sign up at switchport.ai)
- Your Switchport API key
Installation
Install the Switchport SDK using pip:Get Your API Key
Sign in to Switchport
Go to switchport.ai and log in to your account.
Set Your API Key
Set your API key as an environment variable:Create Your First Prompt
Before using the SDK, you need to create a prompt in the Switchport dashboard:Create a prompt config
- Go to Prompts → New Prompt Config
- Name: “Welcome Message”
- Key:
welcome-message - Click Create
Add a version
- Click Add Version
- Model: Select
gpt-5(or another model) - Prompt:
Write a friendly welcome message for {{name}}. - Click Save
Configure LLM API Keys
The SDK calls LLMs on your behalf, so you need to configure your LLM API keys:Add your LLM API keys
Add API keys for the LLM providers you want to use:
- OpenAI API key (for GPT models)
- Anthropic API key (for Claude models)
- Google API key (for Gemini models)
Execute Your First Prompt
Create a filetest_switchport.py:
Record Your First Metric
Now let’s track a metric. First, create a metric definition in the dashboard:
Then record a metric in your code:
Next Steps
A/B Testing
Learn how to run A/B tests with multiple prompt versions
API Reference
Explore the full API reference
Examples
See more code examples
Core Concepts
Understand key concepts

