> 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/more-in-this-section-9/public-client.md).

# Public client

PublicClient — read-only access to public catalog (models, benchmarks, evaluations, comparisons).

`PublicClient` (sync) and `AsyncPublicClient` (async) cover read-only public endpoints. Access either via `client.public.*` on an authenticated `Stratix` or by instantiating directly. **Public access still requires an API key** — Stratix uses the key for rate-limit identification.

## Two ways to use

```python
# Via authenticated Stratix client
from layerlens import Stratix
client = Stratix()
public_models = client.public.models.get(query="claude")

# Standalone PublicClient
from layerlens import PublicClient
public = PublicClient()
models = public.models.get(companies=["OpenAI"])
```

## Models

```python
response = client.public.models.get(
 query="gpt", # text query
 name="gpt-4o", # exact name
 key="openai/gpt-4o", # exact key
 ids=["..."], # list of IDs
 categories=["transformer", "moe", "open-source", "closed-source", "usa", "china", "size-sm"],
 companies=["OpenAI", "Anthropic"],
 regions=["usa", "china"],
 licenses=["mit", "apache-2.0"],
 sizes=["size-sm", "size-md", "size-lg", "size-xl"],
 sort_by="releasedAt", # name, createdAt, releasedAt, architectureType, contextLength, license, region
 order="desc", # asc/desc
 page=1,
 page_size=50,
 include_deprecated=False,
)
# response.models,.categories,.companies,.regions,.licenses,.sizes,.count,.total_count
```

## Benchmarks

```python
benchmarks = client.public.benchmarks.get(...)
# benchmarks.datasets,.categories,.count,.total_count

# Get prompts for a benchmark (paginated)
prompts = client.public.benchmarks.get_prompts(
 benchmark_id="...",
 page=1, page_size=50,
 search_field="input", # id, input, truth
 search_value="reasoning",
 sort_by="createdAt",
 sort_order="asc",
)
# prompts.prompts,.count

# Auto-paginate
all_prompts = client.public.benchmarks.get_all_prompts(benchmark_id="...")
```

## Evaluations

```python
evaluation = client.public.evaluations.get_by_id("eval_abc")
# evaluation.summary.analysis_summary.key_takeaways

evaluations = client.public.evaluations.get_many(
 page=1, page_size=20,
 sort_by="submitted_at", order="desc",
 model_ids=["..."], benchmark_ids=["..."],
 status="success",
 unique=True,
)
```

## Comparisons

```python
# Compare two evaluations directly
comparison = client.public.comparisons.compare(
 evaluation_id_1="...",
 evaluation_id_2="...",
 page=1, page_size=20,
 outcome_filter="all", # "all", "both_succeed", "both_fail", "reference_fails", "comparison_fails"
 search="...",
)

# Or compare by models — auto-finds latest evaluations
comparison = client.public.comparisons.compare_models(
 benchmark_id="...",
 model_id_1="...",
 model_id_2="...",
)
```

## Discovery

The list responses expose available filter values:

```python
response = client.public.models.get()
print(response.categories) # available categories to filter by
print(response.companies) # available companies
print(response.regions)
```

## See also

* [Models and benchmarks](/more-in-this-section-9/models-benchmarks.md) — authenticated access for catalog management
* [Stratix Public](/6.-build-wire-your-code/sdk-python.md) — the dashboard surface
