> ## 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.

# Env API

> Low-level reset/step/task bank/export contract for direct environment control.

The environment orchestrator (`/v1/env/*`, `/tasks`, `/episodes/*`) runs on the private network and is **not** published at `agi.akhara.ai`.

| Audience     | How to call                                                                         |
| ------------ | ----------------------------------------------------------------------------------- |
| Most clients | Use the [Evaluations API](/environments/api/evaluations) on `https://agi.akhara.ai` |
| Operators    | Call the orchestrator on the private host (internal URL / VPN / SSH tunnel)         |

Paths below are relative to that private orchestrator base. Schemas are per-environment; examples use the mobile shopping environment.

## Capabilities

```http theme={null}
GET /v1/env/capabilities
```

```json theme={null}
{
  "env_id": "amazon_clone_mobile",
  "env_version": "1.0.0",
  "schemas": {
    "observation": "amazon.mobile.obs.v1",
    "action": "amazon.mobile.action.v1",
    "step_result": "amazon.mobile.step_result.v1",
    "verifier_result": "amazon.mobile.verifier_result.v1"
  },
  "actions_supported": ["tap", "type_text", "scroll", "select", "copy", "paste", "back", "finish"],
  "limits": {
    "max_steps_per_episode": 80,
    "max_action_retries": 2,
    "max_text_len": 200
  }
}
```

## Task bank

```http theme={null}
GET /tasks
GET /tasks/{task_id}
```

`GET /tasks/{task_id}` includes a `harbor_reset` object (legacy field name): the exact payload to pass into reset.

Public equivalents:

```bash theme={null}
curl -s https://agi.akhara.ai/evaluations/tasks
curl -s https://agi.akhara.ai/dashboard/tasks/vu.checkout.t098
```

## Reset

```http theme={null}
POST /v1/env/reset
```

```json theme={null}
{
  "episode_id": "ep_demo_001",
  "seed": 18421,
  "fixture_id": "fixture1",
  "max_steps": 38,
  "task_spec": {
    "task_id": "vu.checkout.t098",
    "goal": "Find me a red hoodie and checkout.",
    "success_criteria_id": "SC_CHECKOUT",
    "verifier_id": "VU-CHECKOUT",
    "target_query": "hoodie",
    "target_sku": "B07HOODIE02",
    "target_variant_name": "Red",
    "matching_policy": "deterministic_sparse_reasoned",
    "constraints": {
      "clean_cart_required": true,
      "must_be_in_stock": true
    },
    "require_needs_confirmation": true,
    "profile_id": "U_001"
  }
}
```

Returns `episode_id` + initial `observation`.

## Step

```http theme={null}
POST /v1/env/step
```

```json theme={null}
{
  "episode_id": "ep_demo_001",
  "step_id": 1,
  "type": "click",
  "params": { "point_2d": [540, 960] }
}
```

**Response highlights:**

```json theme={null}
{
  "schema": "amazon.mobile.step_result.v1",
  "episode_id": "ep_demo_001",
  "step_id": 1,
  "accepted": true,
  "observation": { "schema": "amazon.mobile.obs.v1", "step_id": 1 },
  "verifiers": [
    {
      "verifier_id": "VU-CHECKOUT",
      "status": "IN_PROGRESS",
      "reward": { "task": 0.0, "safety": 0.0, "efficiency": -0.01, "format": 0.0 }
    }
  ],
  "done": { "is_done": false, "reason": null, "final_score": null },
  "reward": 0.0,
  "truncated": false
}
```

## Convenience episode API

Used internally by the eval wrapper; also available on the private orchestrator:

| Method   | Path                            |
| -------- | ------------------------------- |
| `POST`   | `/episodes/start`               |
| `POST`   | `/episodes/{episode_id}/step`   |
| `GET`    | `/episodes/{episode_id}/status` |
| `DELETE` | `/episodes/{episode_id}`        |

`POST /episodes/start` body:

```json theme={null}
{
  "task_id": "vu.checkout.t098",
  "max_steps": 38,
  "seed": 18421,
  "episode_id": "ep_abc123def0"
}
```

Returns a flatter observation including `screenshot_b64` and `ui_elements` when available.

## Export episode

```http theme={null}
GET /v1/export/run/{episode_id}
```

Returns `application/zip` after the worker has synced (`POST /v1/sync/run`). Contents typically include `run.json`, `steps.jsonl`, per-step JSON, and optional `sqlite.db` / `manifest.json`.

## Workers (ops)

| Method | Path                                 |
| ------ | ------------------------------------ |
| `POST` | `/v1/workers/register`               |
| `GET`  | `/v1/workers/list`                   |
| `GET`  | `/v1/workers/health`                 |
| `POST` | `/v1/workers/{worker_id}/set_health` |

Clients running evaluations do not need these unless they operate the fleet.
