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

> ## Agent Instructions
> Company name is Akhara AI (never Rubric AI). Keep lowercase rubric/rubrics only when meaning grading criteria.
> Expert Review (docs path talent/) is enterprise BYO experts for audit and review: invite customer specialists; do not pitch Akhara recruiting or a public expert career portal. RLHF and domain writing are secondary work types.
> Prefer concrete API examples against public hosts: Environments eval API https://agi.akhara.ai, Control plane PDP https://api.akhara.dev, Evaluation https://app.akhara.ai / https://api.akhara.ai, Expert Review portal https://talent.akhara.ai.
> Do not invent a public hostname for private orchestrators or env API internals.
> Do not confuse control-plane latches with Environments confirmation latches.
> Environments SDK/API examples: curl against https://agi.akhara.ai. Evaluation SDK: from akhara import Akhara and AKHARA_API_KEY.
> Start with /llms.txt for the docs index and OpenAPI links; fetch individual pages as .md exports.

# API Reference

> The Akhara API is organized around REST. Our API accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes.

## Base URL

All API requests should be made to:

```
https://api.akhara.ai/v1
```

## Authentication

The Akhara API uses API keys to authenticate requests. You can view and manage your API keys in the [Akhara Dashboard](https://app.akhara.ai/settings/api-keys).

Authentication is performed via the `Authorization` header using Bearer token format:

```bash theme={null}
curl https://api.akhara.ai/v1/datasets \
  -H "Authorization: Bearer gr_live_xxxxxxxxxxxxxxxx"
```

<Warning>
  **Keep your API keys secure**

  Your API keys carry many privileges. Do not share them in publicly accessible areas such as GitHub, client-side code, or browser storage.
</Warning>

## Request Format

For POST, PUT, and PATCH requests, encode parameters as JSON in the request body with `Content-Type: application/json`.

```python example_request.py theme={null}
import requests

response = requests.post(
    "https://api.akhara.ai/v1/datasets",
    headers={
        "Authorization": "Bearer gr_live_xxxxxxxx",
        "Content-Type": "application/json"
    },
    json={
        "name": "patient-triage-v2",
        "description": "Production triage calls Q1 2024"
    }
)
```

## Response Format

All responses are returned as JSON. Successful responses include the requested resource(s), while error responses include an error object with details.

<Tabs>
  <Tab title="Success Response">
    ```json theme={null}
    {
      "id": "ds_abc123",
      "object": "dataset",
      "name": "patient-triage-v2",
      "description": "Production triage calls Q1 2024",
      "created_at": "2024-01-15T09:30:00Z",
      "sample_count": 0
    }
    ```
  </Tab>

  <Tab title="Error Response">
    ```json theme={null}
    {
      "error": {
        "type": "invalid_request_error",
        "code": "missing_required_field",
        "message": "The 'name' field is required",
        "param": "name"
      }
    }
    ```
  </Tab>
</Tabs>

## HTTP Status Codes

| Code  | Description                                   |
| ----- | --------------------------------------------- |
| `200` | OK: Request succeeded                         |
| `201` | Created: Resource created successfully        |
| `400` | Bad Request: Invalid parameters               |
| `401` | Unauthorized: Invalid or missing API key      |
| `403` | Forbidden: Insufficient permissions           |
| `404` | Not Found: Resource does not exist            |
| `429` | Too Many Requests: Rate limit exceeded        |
| `500` | Server Error: Something went wrong on our end |

## Pagination

List endpoints support cursor-based pagination using `limit` and `after` parameters.

```python theme={null}
# First page
response = client.datasets.list(limit=20)

# Next page using cursor
if response.has_more:
    next_page = client.datasets.list(
        limit=20,
        after=response.data[-1].id
    )
```

| Parameter | Type    | Description                                               |
| --------- | ------- | --------------------------------------------------------- |
| `limit`   | integer | Number of results to return (1-100, default 20)           |
| `after`   | string  | Cursor for pagination: ID of last item from previous page |
| `before`  | string  | Return results before this ID                             |

## Rate Limits

The API enforces rate limits to ensure fair usage. Rate limit information is included in response headers:

| Header                  | Description                          |
| ----------------------- | ------------------------------------ |
| `X-RateLimit-Limit`     | Maximum requests per minute          |
| `X-RateLimit-Remaining` | Requests remaining in current window |
| `X-RateLimit-Reset`     | Unix timestamp when limit resets     |

<Info>
  **Enterprise Limits**

  Enterprise plans include higher rate limits. [Contact us](mailto:sales@akhara.ai) for details.
</Info>
