---
title: "Propose a lens from a sentence (the lens use)"
method: POST
path: "/api/v2/account/ai/lens"
tags: ["Account"]
---

# Propose a lens from a sentence (the lens use)

`POST /api/v2/account/ai/lens`

## Request

- Base URL: `https://www.onlyworlds.com`
- URL: `https://www.onlyworlds.com/api/v2/account/ai/lens`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Session-Token`
  - HTTP bearer

Run the AI door's `lens` use for the signed-in account: the body and the answer are the use's own, the meter is the account's daily token rating (then its own saved AI key, else 429 quota_exceeded), as every AI call's. An Idempotency-Key makes a retry safe: the same key and body answer the first answer again and bill nothing. An account credential (Bearer `ow_a_`, a signed-in session, or a phone's `X-Session-Token`), or an AI door token that names this use.

## Headers

- `Idempotency-Key` string
- `X-OW-Client` string

## Request body

- object
  - `world_id` string, uuid, required: A world this account owns or is a member of; it reads the world as its owner or as its own seat there.
  - `sentence` string, required: What the person wants to see, in plain words ("everything one step from the Admiral", "every character", "the events from year 230 to 252").

## Response `200`

The model's proposal (`model`) beside the one made with no model (`no_model`), the `candidates` it chose from, what the guardrails `dropped`, the `page` form, `attempts`, `model_id`, `stop_reason` and `usage`, the meter whole, `charged` (this call's spend recorded), and `use_remaining` (null: no daily ceiling). The model is handed the sentence, the world's Charter and Guide, its Domains with their hubs, its kinds with their counts, the no-model proposal and the name matches, all as this account reads the world; it never sees the whole world, and its starts can only be elements it was handed. Nothing is saved or written to the world. Granting `lens` to an AI door token lets its holder read the names and links of elements in this account's worlds through this use.

- object
  - `model` object, required: The model's proposal after the guardrails: starts only from `candidates`, kinds only the 22 kinds, the window whole numbers, `says` one line.
    - `form` 'walk' | 'pick' | 'list' | 'null', nullable, required: walk: the starts and one step out; pick: exactly the starts; list: every element of the kinds in the window; null: nothing to read.
    - `starts` string[], required: Element ids, each one of `candidates`.
    - `kinds` string[], required
    - `window` object, nullable, required: Years in the world's time unit, the end not included; null: no window.
      - `start` integer, nullable
      - `end` integer, nullable
    - `says` string, required: One line: what the lens shows.
  - `no_model` object, nullable, required: The proposal with no model for the same sentence (the Lenses page's own sentence box); null when the sentence names nothing in the world.
    - `form` 'walk' | 'pick' | 'list' | 'null', nullable, required: walk: the starts and one step out; pick: exactly the starts; list: every element of the kinds in the window; null: nothing to read.
    - `starts` string[], required: Element ids, each one of `candidates`.
    - `kinds` string[], required
    - `window` object, nullable, required: Years in the world's time unit, the end not included; null: no window.
      - `start` integer, nullable
      - `end` integer, nullable
  - `candidates` object[], required: The elements the model chose from, as this account sees them: the name matches and the Domains' hubs.
    - `id` string, required
    - `type` string, required
    - `name` string, required
    - `links` integer, required
  - `dropped` object, required: What the guardrails took out of the model's answer: starts it was not handed, kinds that are none of the 22, a window that is not whole numbers (1).
    - `starts` integer, required
    - `kinds` integer, required
    - `window` integer, required
  - `page` object, nullable, required: The model's proposal as the Lenses page fills its form (`form`, its plain `line`, `says`); null when there is nothing to read.
  - `attempts` 1 | 2, required: 2 when the first answer was refused and asked again.
  - `model_id` string, required: The model that answered.
  - `stop_reason` string, required
  - `usage` object, required
    - `input_tokens` integer, required
    - `output_tokens` integer, required
  - `remaining` integer, required: How many more calls of this one's size fit in what this account has left today.
  - `tokens_remaining` integer, required: The account's tokens left today after this call.
  - `token_rating` integer, required: The account's daily token rating.
  - `paid_by` 'rating' | 'own_key', required: Who paid for this call: `rating`, the account's daily token rating on the platform's key; `own_key`, the account's own AI key, once today's rating was spent (the rating's fields above are then as they were).
  - `charged` boolean, required: True when this call's spend was recorded (the token rating, or the own AI key that paid it): asked again under the same Idempotency-Key, it replays and bills nothing. A refusal this door writes carries `charged` in its error too; an answer the door never builds (a sign-in or CSRF refusal, a form body the sign-in's CSRF check cannot read, a rate limit, a fault answered by the server's own handler) carries none, and none reads as not charged.
  - `use_remaining` integer, nullable, required: Calls to this use this account has left today; null when the use has no daily ceiling (the token rating is then the only limit).

## Other responses

- `401`: Missing or invalid account credential (Bearer ow_a_ token or session, or an AI door token). Another `ow_a_` token kind, a hosted MCP client's, is 401 wrong_audience; an expired AI door token is 401 key_revoked.
- `403`: An AI door token that does not name this use (use_not_granted, param use): it opens only the uses it was minted for. Or a read-only account token: one from a read-only sign-in is refused on this route (permission_error).
- `404`: The world is not one this account owns or is a member of (not_found).
- `409`: An Idempotency-Key was reused with a different body (idempotency_error), or a request with this Idempotency-Key is still in flight (idempotency_in_flight; retry after Retry-After).
- `422`: world_id or sentence (1 to 300 characters) is missing or malformed; `param` names it. Or answer_not_parsed (param answer): the model's answer was not one lens proposal, asked again once; the answers count against this use's budget, not the token rating (or the account's own AI key paid them), and the text is not returned. The error's `refusals` lists each refused answer in order: `word` (why keel refused it), `stop_reason` (how the provider says the answer ended: max_tokens means it ran out of room) and `output_tokens`. Under an Idempotency-Key a retry replays this 422 and bills nothing. Or the Idempotency-Key is over its length cap (param Idempotency-Key). Or own_key_refused: today's rating is spent and the account's own AI key was refused by its provider; nothing was counted, nothing retried.
- `429`: This account has used today's token rating (quota_exceeded): fewer tokens are left than a proposal may take, and it has no own AI key saved; or a proposal for this account is already running (use_in_flight, param use, a short Retry-After). Retry-After says when. Or too many requests: over the request budget (code too_many_requests, type rate_limited): 300 requests a minute per key or account token, 60 a minute per address for a request with neither. Retry after the Retry-After header's seconds.
- `502`: The model gave no answer (ask_failed), nothing taken from the token rating; or keel's own check of an answer broke, and that billed answer counts against this use's budget, a retry under the same Idempotency-Key replaying this 502.
- `503`: Not switched on (this use ships off until the server switches it on), or paused for the day (ask_unavailable; with param use, this use's switch or budget), nothing counted; or every request slot stayed full (server_busy, with Retry-After).

## Changes

- **2026-11-28** `e45847b3f48f`: 8 info
  - added the optional property `error/limit` to the response with the `401` status
  - added the optional property `error/limit` to the response with the `403` status
  - added the optional property `error/limit` to the response with the `404` status
  - added the optional property `error/limit` to the response with the `409` status
  - …4 more
- **2026-11-26** `f921dd878e35`: 8 warning
  - added the new `write_not_granted` enum value to the `error/code` response property for the response status `401`
  - added the new `write_not_granted` enum value to the `error/code` response property for the response status `403`
  - added the new `write_not_granted` enum value to the `error/code` response property for the response status `404`
  - added the new `write_not_granted` enum value to the `error/code` response property for the response status `409`
  - …4 more
- **2026-11-26** `7ef7860703bb`: 8 warning
  - added the new `narratives_only` enum value to the `error/code` response property for the response status `401`
  - added the new `narratives_only` enum value to the `error/code` response property for the response status `403`
  - added the new `narratives_only` enum value to the `error/code` response property for the response status `404`
  - added the new `narratives_only` enum value to the `error/code` response property for the response status `409`
  - …4 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/onlyworlds/apis/onlyworlds-api/changes/api/v2/account/ai/lens/post.md)

---

[API](https://skmtc.dev/onlyworlds/apis/onlyworlds-api.md) - [All operations](https://skmtc.dev/onlyworlds/apis/onlyworlds-api/llms.txt) - [OpenAPI document](https://skmtc.dev/onlyworlds/apis/onlyworlds-api/revisions/6c819f2e4bbd?raw)
