> For the complete documentation index, see [llms.txt](https://docs.layerlens.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.layerlens.ai/2.-get-started/first-eval-via-sdk.md).

# First evaluation via SDK

Run your first benchmark evaluation programmatically via the Stratix Python SDK.

Twenty lines of Python that run a real evaluation.

## Prerequisites

* [ ] [SDK installed](/2.-get-started/install.md)
* [ ] `LAYERLENS_STRATIX_API_KEY` exported
* [ ] A Stratix Premium account with starter ECU

## Sync version

```python
from layerlens import Stratix

client = Stratix()

# Pick a model and a benchmark from the public catalog
model = client.models.get_by_key("openai/gpt-4o")
benchmark = client.benchmarks.get_by_key("arc-agi-2")

# Create the evaluation
evaluation = client.evaluations.create(
 model=model,
 benchmark=benchmark,
)

# Wait for completion (polling)
result = client.evaluations.wait_for_completion(evaluation)
print(f"Accuracy: {result.accuracy}")
```

## Async version

Every method has an async counterpart on `AsyncStratix`:

```python
import asyncio
from layerlens import AsyncStratix

async def main():
 client = AsyncStratix()
 model = await client.models.get_by_key("openai/gpt-4o")
 benchmark = await client.benchmarks.get_by_key("arc-agi-2")
 evaluation = await client.evaluations.create(model=model, benchmark=benchmark)
 result = await client.evaluations.wait_for_completion(evaluation)
 print(f"Accuracy: {result.accuracy}")

asyncio.run(main())
```

## What just happened

1. The SDK authenticated with your API key.
2. It fetched the model and benchmark records from the public catalog.
3. It created an evaluation in your org.
4. The platform queued the work; the SDK polled for completion.
5. The result was returned; you got an accuracy score.

## Verify

The same evaluation should appear in **Premium → Evaluations**. Same record, same ID, same scores.

## Try variations

### Different model

```python
model = client.models.get_by_key("anthropic/claude-opus-4-7")
```

### Different benchmark

```python
benchmark = client.benchmarks.get_by_key("mmlu")
```

### Browse public results before running

```python
public_models = client.public.models.get()
for m in public_models.models[:5]:
 print(m.key, m.name)
```

## Error handling

```python
from layerlens import Stratix, NotFoundError, AuthenticationError, APIError

try:
 model = client.models.get_by_id("nonexistent-id")
except NotFoundError as e:
 print(f"Not found: {e.message}")
except AuthenticationError as e:
 print(f"Auth failed: {e.message}")
except APIError as e:
 print(f"API error ({e.status_code}): {e.message}")
```

## Where to next

* [Python SDK reference](/2.-get-started/sdk.md)
* [Tutorial: First evaluation in 10 minutes](/8.-evaluate-score-the-outputs/01-first-evaluation.md)
* [Cookbook recipes](/2.-get-started/all-cookbook-recipes.md)
