Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pip install "lenz-io[cli]" # or into your current environment
```

```bash
lenz login # paste an API key (free — get one at lenz.io/api-integration)
lenz login # paste an API key (free — get one at lenz.io/api-credentials)
lenz extract "Einstein won the 1921 Nobel for relativity" # free, 1000/day
lenz assess "The Great Wall is visible from space" # fast verdict
lenz verify "Water boils at 90C at sea level" # full pipeline (~90s)
Expand Down Expand Up @@ -122,7 +122,7 @@ for source in v.sources[:3]:
The demo claim is pre-cached so this returns in ~1.5s. Your own claims
hit the full pipeline (~60-90s) — use webhooks for production async flows.

> **Get your webhook secret here →** [lenz.io/api-integration](https://lenz.io/api-integration)
> **Get your webhook secret here →** [lenz.io/api-credentials](https://lenz.io/api-credentials)

## What you get on the client

Expand Down Expand Up @@ -237,7 +237,7 @@ except LenzAuthError as exc:
print(exc)
# Unauthorized
# Cause: Invalid api key
# Fix: Generate a new key at https://lenz.io/api-integration.
# Fix: Generate a new key at https://lenz.io/api-credentials.
# Docs: https://lenz.io/docs/auth
# Request ID: req_abc123
except LenzRateLimitError as exc:
Expand Down
2 changes: 1 addition & 1 deletion examples/core/fastapi_webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
uvicorn examples.core.fastapi_webhook:app --host 0.0.0.0 --port 8000

Then point your Lenz API key's webhook URL at https://<your-host>/lenz-webhook
on the /api-integration page, or pass `webhook_url=...` on individual
on the /api-credentials page, or pass `webhook_url=...` on individual
verify() calls.
"""

Expand Down
2 changes: 1 addition & 1 deletion src/lenz_io/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def work(client: Lenz) -> None:

def _dashboard_url(base_url: str) -> str:
parts = urlsplit(base_url)
return urlunsplit((parts.scheme, parts.netloc, "/api-integration", "", ""))
return urlunsplit((parts.scheme, parts.netloc, "/api-credentials", "", ""))


def login(ctx: typer.Context) -> None:
Expand Down
4 changes: 2 additions & 2 deletions src/lenz_io/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class Lenz:
The constructor accepts ``api_key=None`` so library endpoints work
without authentication (sandbox path for developers exploring before
sign-up). Auth-required methods on an un-keyed client raise
``LenzAuthError`` with a link to ``/api-integration``.
``LenzAuthError`` with a link to ``/api-credentials``.

Reads ``LENZ_API_KEY`` from the environment if no key is passed.
"""
Expand Down Expand Up @@ -763,7 +763,7 @@ def _request(
cause="This method requires authentication; no API key was provided.",
fix=(
"Pass api_key= to Lenz(), set LENZ_API_KEY env var, or get one at "
"https://lenz.io/api-integration. Library endpoints work without a key."
"https://lenz.io/api-credentials. Library endpoints work without a key."
),
doc_url="https://lenz.io/docs/auth",
)
Expand Down
2 changes: 1 addition & 1 deletion src/lenz_io/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def _opt_int(value: Any) -> int | None:

def _fix_hint_for(status_code: int) -> str:
return {
401: "Generate a new key at https://lenz.io/api-integration.",
401: "Generate a new key at https://lenz.io/api-credentials.",
403: "This key doesn't have access to that resource.",
402: "Top up or upgrade at https://lenz.io/plans, or wait for the period reset.",
422: "Check the request body against the OpenAPI spec.",
Expand Down
8 changes: 4 additions & 4 deletions src/lenz_io/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
``replay_window_seconds`` (default 300s / 5 minutes).

Customers MUST register the same secret with us via the
``/api-integration`` page. Rotating the secret on Lenz's side invalidates
``/api-credentials`` page. Rotating the secret on Lenz's side invalidates
old deliveries.
"""

Expand Down Expand Up @@ -63,7 +63,7 @@ def verify_signature(raw_body: bytes, signature: str, secret: str) -> bool:
raise LenzWebhookSignatureError(
message="Missing webhook signature",
cause=f"No {SIGNATURE_HEADER} header on the request.",
fix="Inspect the webhook delivery in /api-integration to confirm the secret is set.",
fix="Inspect the webhook delivery in /api-credentials to confirm the secret is set.",
doc_url="https://lenz.io/docs/webhooks",
)
if not isinstance(raw_body, (bytes, bytearray)):
Expand All @@ -79,7 +79,7 @@ def verify_signature(raw_body: bytes, signature: str, secret: str) -> bool:
raise LenzWebhookSignatureError(
message="Webhook signature mismatch",
cause="HMAC of the raw body using your secret does not match X-Lenz-Signature.",
fix="Verify the secret in /api-integration matches the one you configured here.",
fix="Verify the secret in /api-credentials matches the one you configured here.",
doc_url="https://lenz.io/docs/webhooks",
)
return True
Expand Down Expand Up @@ -214,7 +214,7 @@ def __init__(
replay_window_seconds: int = DEFAULT_REPLAY_WINDOW_SECONDS,
) -> None:
if not secret:
raise ValueError("LenzWebhooks requires a non-empty secret. Get it from /api-integration.")
raise ValueError("LenzWebhooks requires a non-empty secret. Get it from /api-credentials.")
self._secret = secret
self._replay_window = replay_window_seconds

Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ def test_login_json_no_key_points_to_dashboard():
assert result.exit_code == 0
payload = json.loads(result.stdout)
assert payload["status"] == "no_key"
assert "api-integration" in payload["dashboard"]
assert "api-credentials" in payload["dashboard"]


def test_login_write_failure_is_friendly(monkeypatch):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_library_list_omits_curated_and_verdict_when_default(self, unauth_client
def test_auth_required_method_without_key_raises_with_clear_message(self, unauth_client):
with pytest.raises(LenzAuthError) as ei:
unauth_client.verifications.list()
assert "/api-integration" in str(ei.value)
assert "/api-credentials" in str(ei.value)

def test_api_key_armed_methods(self, client):
with respx.mock(base_url=DEFAULT_BASE) as r:
Expand Down
Loading