> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getbasalt.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Overview of the Basalt API

# Basalt API Reference

Welcome to the Basalt API reference documentation. This section provides detailed information about the Basalt API endpoints, request formats, and response structures to help you integrate Basalt's capabilities directly into your applications.

## API Structure

The Basalt API is organized into several functional areas:

<CardGroup cols={3}>
  <Card title="Prompts" icon="file-lines" href="/api-reference/prompts/get">
    Endpoints for managing and retrieving prompts, versions, and tags
  </Card>

  <Card title="Monitor" icon="chart-line" href="/api-reference/monitor/log">
    Endpoints for logging, tracing, and monitoring AI interactions
  </Card>

  <Card title="Experiments" icon="flask" href="/api-reference/experiments/create">
    Endpoints for creating and managing experiments
  </Card>

  <Card title="Datasets" icon="database" href="/api-reference/datasets/get">
    Endpoints to interact with datasets
  </Card>
</CardGroup>

## Getting Started

Before using the API, you'll need to:

1. **Obtain an API Key**: All API requests require authentication using your API key
2. **Understand Base URL**: All API requests are made to `https://api.getbasalt.ai`
3. **Review Authentication**: See our [Authentication guide](/api-reference/authentication) for details on how to use your API key

## Using the API

The Basalt API follows RESTful principles with these standard conventions:

* All requests and responses use JSON format
* HTTP status codes indicate success or failure of requests
* Error responses include a consistent structure with error details
* Rate limits apply to protect the stability of the service

### Example Request

```bash theme={null}
curl https://api.getbasalt.ai/prompts \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "welcome-message",
    "tag": "production"
  }'
```

## API vs SDK

While the API gives you direct access to Basalt's capabilities, we also offer SDKs for TypeScript/JavaScript and Python that provide a more convenient, language-specific interface.

<CardGroup cols={2}>
  <Card title="API Benefits" icon="terminal">
    * Direct access to all Basalt features
    * Language-agnostic integration
    * Fine-grained control over requests and responses
    * Useful for custom integrations and platforms
  </Card>

  <Card title="SDK Benefits" icon="code">
    * Higher-level abstractions
    * Type safety and autocomplete
    * Built-in error handling
    * Automatic retries and caching
    * Simplified authentication
  </Card>
</CardGroup>

For most use cases, we recommend using our [SDKs](/sdk-overview), but the API is available for scenarios where direct access is preferred.

## Error Handling

The API uses standard HTTP status codes to indicate the success or failure of requests:

* `2xx` codes indicate success
* `4xx` codes indicate client errors (invalid requests)
* `5xx` codes indicate server errors

## Next Steps

Explore the API reference documentation for each endpoint:

* [Authentication](/api-reference/authentication) - How to authenticate your requests
* [Prompts](/api-reference/prompts/get) - Manage and retrieve prompts
* [Monitor](/api-reference/monitor/log) - Log and trace AI interactions
* [Experiments](/api-reference/experiments/create) - Create and manage experiments
* [Datasets](/api-reference/datasets/get) - Interact with datasets
