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

# SDKs

> Official clients for Python, TypeScript, JavaScript, Go, and Rust.

Every SDK exposes the same resources with the same method names, adjusted to
the language's conventions. Pick one, install it, and follow the shared setup before running the resource
guide examples.

<CardGroup cols={2}>
  <Card title="Python" icon="python" href="/api-reference/languages/python">
    Sync and async clients. `pip install chronicle-sdk`
  </Card>

  <Card title="TypeScript" icon="code" href="/api-reference/languages/typescript">
    Fully typed. `npm install @chroniclelabs/sdk`
  </Card>

  <Card title="JavaScript" icon="js" href="/api-reference/languages/javascript">
    Same package, no types needed. `npm install @chroniclelabs/sdk`
  </Card>

  <Card title="Go" icon="golang" href="/api-reference/languages/go">
    Context-aware, typed params. `go get github.com/chronicle-labs/chronicle-go`
  </Card>

  <Card title="Rust" icon="rust" href="/api-reference/languages/rust">
    Async, typed, explicit errors. `cargo add chronicle-sdk`
  </Card>
</CardGroup>

## Create a client

Set `CHRONICLE_API_KEY` and `CHRONICLE_API_URL`, or pass them in.

<CodeGroup dropdown>
  ```python Python theme={null}
  from chronicle import Chronicle

  client = Chronicle()  # reads CHRONICLE_API_KEY and CHRONICLE_API_URL
  ```

  ```typescript TypeScript theme={null}
  import { Chronicle } from "@chroniclelabs/sdk";

  const client = new Chronicle(); // reads CHRONICLE_API_KEY and CHRONICLE_API_URL
  ```

  ```javascript JavaScript theme={null}
  import { Chronicle } from "@chroniclelabs/sdk";

  const client = new Chronicle(); // reads CHRONICLE_API_KEY and CHRONICLE_API_URL
  ```

  ```go Go theme={null}
  import chronicle "github.com/chronicle-labs/chronicle-go"

  client := chronicle.NewClient() // reads CHRONICLE_API_KEY and CHRONICLE_API_URL
  ```

  ```rust Rust theme={null}
  use chronicle_sdk::Chronicle;

  let client = Chronicle::from_env()?; // reads CHRONICLE_API_KEY and CHRONICLE_API_URL
  ```
</CodeGroup>

## Use the guide examples

Resource-guide snippets continue with the configured `client` above. Keep the
IDs returned by one step for the next. Follow a language's installation page
for a complete first-evaluation program.

* **Python:** run the snippets in one script or session. Import additional types from `chronicle.types` when needed.
* **TypeScript / JavaScript:** use ES modules and top-level `await`; paste sequential steps into one module.
* **Go:** put fragments inside a function returning `error`, with `ctx context.Context`. Import `chronicle`, plus standard packages used by that fragment (`context`, `fmt`, `time`, `errors`, `os`, or `encoding/json`). Pass a context with a deadline to wait methods.
* **Rust:** put fragments inside an async function returning `Result<(), Box<dyn std::error::Error>>`; import `chronicle_sdk::{Chronicle, types::*}` and `std::time::Duration`. File export also uses `serde_json`.

A wait returning successfully means the resource reached a final state;
check its status before using its results. The [reliability guide](/api-reference/reliability#success-isnt-always-done)
lists the checks for worlds, task setup, scorers, and evaluations.

## Resources

| Resource                          | Guide                                                                                   |
| --------------------------------- | --------------------------------------------------------------------------------------- |
| `worlds`                          | [Worlds](/api-reference/worldsmith)                                                     |
| `twins`                           | [Twins](/api-reference/twins)                                                           |
| `agents`                          | [Agents](/api-reference/agents)                                                         |
| `task_suites`, `tasks`, `scorers` | [Tasks and scorers](/api-reference/tasks)                                               |
| `evaluations`                     | [Evaluations](/api-reference/evaluations)                                               |
| `events`, `traces`, `signals`     | [Events](/api-reference/telemetry)                                                      |
| `environments`, `api_keys`        | [Environments](/platform/environments), [Authentication](/api-reference/authentication) |

## Naming

|          | Python               | TypeScript / JavaScript | Go                                      | Rust                              |
| -------- | -------------------- | ----------------------- | --------------------------------------- | --------------------------------- |
| Resource | `client.task_suites` | `client.taskSuites`     | `client.TaskSuites`                     | `client.task_suites()`            |
| Method   | `.create(name=...)`  | `.create({ name })`     | `.Create(ctx, Params{Name})`            | `.create(Params { name }).await?` |
| Field    | `world.launch_error` | `world.launchError`     | `world.LaunchError`                     | `world.launch_error`              |
| Errors   | raises `APIError`    | throws `APIError`       | returns `error` (`*chronicle.APIError`) | returns `Result<_, Error>`        |

## Shared behavior

* **Pages**: list methods return a page with `items`, `has_next_page()`, and `get_next_page()`. Python adds `auto_paging_iter()`; TypeScript pages are async iterables.
* **Waiting**: `worlds.wait`, `twins.wait`, and `evaluations.wait` poll until the resource reaches a final state.
* **Retries**: two automatic retries on transient failures, honoring `Retry-After`. See [Errors and retries](/api-reference/reliability).
* **Types**: request and response models are exported (`chronicle.types` in Python, top-level in TypeScript, the `chronicle` package in Go, `chronicle_sdk::types` in Rust).
