Skip to main content
Get your first prompt from Claro in just a few steps. This guide will have you making API calls in less than 5 minutes.

Prerequisites

Before you begin, you’ll need:
  • A Claro account - Sign up here
  • Python 3.8 or higher installed
  • At least one prompt created in your Claro workspace

Step 1: Get Your API Key

1

Navigate to API Keys

Log into Claro and click API Keys from the sidebar
2

Create API Key

Click Create API Key, give it a name (e.g., “Development”), and copy the key
Save your API key immediately - you won’t be able to see it again after closing the dialog.
3

Set Environment Variable

Add your API key to your environment:
export BAYT_API_KEY="your_api_key_here"
Add this to your ~/.bashrc, ~/.zshrc, or .env file to persist across sessions

Step 2: Install the SDK

Install the Claro Python SDK using pip:
pip install baytos-claro
python -c "import baytos.claro; print(claro.__version__)"

Step 3: Make Your First API Call

Create a new Python file called test_claro.py:
import os
from baytos.claro import BaytClient

# Initialize the client
client = BaytClient(api_key=os.getenv("BAYT_API_KEY"))

# Get a prompt (replace with your prompt's package name)
prompt = client.get_prompt("@workspace/my-prompt:v1")

# Use the prompt
print(f"Title: {prompt.title}")
print(f"\nPrompt content:\n{prompt.generator}")
Run it:
python test_claro.py
Replace @workspace/my-prompt:v1 with the package name of a prompt from your Claro workspace.Find your prompt’s package name in the Claro dashboard under the prompt’s settings.

Step 4: Use With an LLM

Now let’s use the prompt with an actual LLM. Here’s an example with OpenAI:
import os
from baytos.claro import BaytClient
from openai import OpenAI

# Initialize clients
claro_client = BaytClient(api_key=os.getenv("BAYT_API_KEY"))
openai_client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))

# Get your prompt from Claro
prompt = claro_client.get_prompt("@workspace/customer-support:v1")

# Use it with OpenAI
response = openai_client.chat.completions.create(
    model="gpt-4",
    messages=[
        {"role": "system", "content": prompt.generator},
        {"role": "user", "content": "How do I reset my password?"}
    ]
)

print(response.choices[0].message.content)
When your team updates the prompt in Claro, your next API call automatically gets the new version. No code changes needed.

Next Steps

Now that you’re up and running, explore more features:

Common Issues

Make sure you’ve installed the SDK:
pip install baytos-claro
If you’re using a virtual environment, ensure it’s activated.
Double-check that:
  1. Your API key is set correctly in the environment variable
  2. You haven’t accidentally included extra spaces or quotes
  3. The API key hasn’t been deleted from your Claro account
Verify that:
  1. The package name is correct (including @workspace/ prefix)
  2. The version exists (e.g., :v1, :v2)
  3. You have access to the workspace containing the prompt

Need Help?