Skip to main content

Python SDK Quickstart

Get started with the Claro Python SDK in just a few lines of code.

Prerequisites

  • Python 3.8 or higher
  • Claro SDK installed (pip install baytos-claro)
  • API key from Claro settings

Installation

Install the SDK using pip:

Basic Usage

Understanding Package Names

Claro uses semantic versioning for prompts:
  • @workspace - Your workspace identifier
  • prompt-name - The prompt’s name (lowercase, hyphenated)
  • version - The version (e.g., v1, v2, latest)
Find a prompt’s package name in the Claro dashboard under the prompt’s settings.

Working with Prompt Versions

Using Prompts with LLMs

OpenAI Example

Anthropic Example

Listing Prompts

Error Handling

Complete Example

Here’s a complete working example:

Environment Variables

Create a .env file for local development:
.env
Load it with python-dotenv:
Always add .env to your .gitignore to avoid committing secrets

Next Steps

Client Configuration

Configure timeouts, retries, and connection pooling

Working with Prompts

Learn about prompt metadata and versioning

Context Files

Handle file attachments and URLs

Error Handling

Robust error handling patterns