Account

Propose a lens from a sentence (the lens use)

Changed on

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.

post/api/v2/account/ai/lens

Request

  • Base URL
    https://www.onlyworlds.com
  • Auth
    • HTTP bearer
    • or API key in header X-Session-Token
    • or HTTP bearer

Headers

Idempotency-Key, string

Replays of the same key with the same body return the first successful response (with Idempotent-Replay: true) for 24h; the same key with a different body is a 409 idempotency_error. While the first request with a key is still running, the same key is a 409 idempotency_in_flight: retry after Retry-After.

X-OW-Client, string

The client's own name for itself (atlas, lantern, sdk): lower case letters, digits and hyphens, 1 to 32 characters, after a trim. It is stored on the element as changed_client (a delete's tombstone as deleted_client), beside the door; it changes no door and no permission. A value outside the rule is ignored (stored as null), never refused.

Request body

object required
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

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 required
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.

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.

candidates, object[] required

The elements the model chose from, as this account sees them: the name matches and the Domains' hubs.

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).

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
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).

Changes

    • info

      added the optional property error/limit to the response with the status

    • info

      added the optional property error/limit to the response with the status

    • info

      added the optional property error/limit to the response with the status

    5 more changes in this revision