---
title: "One order from a model for a Subs captain (the subs-captain use)"
method: POST
path: "/api/v2/account/ai/subs-captain"
tags: ["Account"]
---

# One order from a model for a Subs captain (the subs-captain use)

`POST /api/v2/account/ai/subs-captain`

## Request

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

Run the AI door's `subs-captain` 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
  - `wire` 'subs-order/2', required: The order wire the answer is in: only subs-order/2.
  - `view` string, required: The captain's view of the battle now, as the seat renders it, ending with the orders valid now.
  - `story` string: Optional: the night so far, with its own heading; sent before the situation.
  - `character` string: Optional: the captain's Character as text (the OnlyWorlds part of the captain); sent first, under CHARACTER.

## Response `200`

One order on the subs-order/2 wire (`order` and the same as one JSON `line`), `attempts`, `model`, `stop_reason` and `usage`, the meter whole, and `use_remaining` (null: no daily ceiling). The system prompt is the Subs seat's (its hash in the list).

- object
  - `order` object, required: The order, checked against subs-order/2 (order, and contact, pattern, depth, sector, why as it gives them); words come back in the wire's own spelling.
  - `line` string, required: The same order as one JSON line, for the seat's wire.
  - `wire` 'subs-order/2', required
  - `attempts` 1 | 2, required: 2 when the first answer was refused and asked again: both calls were counted.
  - `model` string, required
  - `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).
  - `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).
- `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`: wire is not subs-order/2, or view, story or character is malformed or over its cap; `param` names it. Or answer_not_parsed (param answer): the model's answer was not one subs-order/2 order, 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 an answer may take, and it has no own AI key saved. Retry-After says when the rating resets (midnight UTC). 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, or paused for the day (ask_unavailable; with param use, this use is switched off or has spent its own budget today), nothing counted; or every request slot stayed full (server_busy, with Retry-After).

## Changes

- **2026-11-28** `e45847b3f48f`: 7 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 `409` status
  - added the optional property `error/limit` to the response with the `422` status
  - …3 more
- **2026-11-26** `f921dd878e35`: 7 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 `409`
  - added the new `write_not_granted` enum value to the `error/code` response property for the response status `422`
  - …3 more
- **2026-11-26** `7ef7860703bb`: 7 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 `409`
  - added the new `narratives_only` enum value to the `error/code` response property for the response status `422`
  - …3 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/onlyworlds/apis/onlyworlds-api/changes/api/v2/account/ai/subs-captain/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)
