Skip to main content
The Claro REST API provides programmatic access to your prompts, enabling you to integrate Claro into your applications, workflows, and automation tools.

Base URL

All API requests should be made to:
https://api.baytos.ai
All endpoints are versioned and prefixed with /v1:
https://api.baytos.ai/v1/prompts

API Versioning

The API uses URL-based versioning. The current version is v1. When we make breaking changes, we’ll release a new version (e.g., v2) while maintaining support for previous versions.
We maintain backward compatibility for at least 12 months after releasing a new API version.

Available Endpoints

The Claro API provides the following core functionality:

Get Prompt

Retrieve a specific prompt by package name

List Prompts

Browse and paginate through your workspace prompts

Download Files

Access context files attached to prompts

Health Check

Verify API availability and status

Request Format

All API requests should:
  • Use HTTPS
  • Include proper authentication headers
  • Send JSON payloads for POST requests with Content-Type: application/json
Example request:
curl https://api.baytos.ai/v1/prompts/get \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "package_name": "@workspace/my-prompt:v1"
  }'

Response Format

All API responses are returned as JSON with consistent structure:

Success Response

{
  "data": {
    // Response payload
  }
}

Error Response

{
  "error": {
    "code": "error_code",
    "message": "Human-readable error message",
    "details": {}  // Optional additional context
  }
}

Common Concepts

Package Names

Prompts are identified by package names in the format:
@namespace/prompt-name:version
Examples:
  • @workspace/customer-support:v1 - Published version 1
  • @alice/code-reviewer:v2 - User alice’s prompt version 2
  • @team/analytics:latest - Latest published version

Pagination

List endpoints use cursor-based pagination:
{
  "data": {
    "prompts": [...],
    "cursor": "next_page_token",
    "hasMore": true
  }
}
Always check the hasMore field to determine if additional pages exist.

SDK vs REST API

While you can call the REST API directly, we recommend using our official SDKs for a better developer experience:

Python SDK

Type-safe Python client with automatic retries and pagination

TypeScript SDK

Coming soon
The SDKs handle:
  • Authentication
  • Rate limiting and retries
  • Error handling
  • Type safety
  • Response parsing

Next Steps

Authentication

Learn how to authenticate API requests

Rate Limits

Understand rate limiting and best practices

Error Handling

Handle errors gracefully in your application

API Endpoints

Browse the complete API reference

Need Help?