---
title: "Forward one completion to the model provider under the server-held key"
method: POST
path: "/v1/llm/completions"
tags: ["llm"]
---

# Forward one completion to the model provider under the server-held key

`POST /v1/llm/completions`

## Request

- Base URL: `https://api.sixminute.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.sixminute.ai/v1/llm/completions`
- Auth: HTTP bearer

Carries the device header. The answer is priced and the call's counts are added to the member's meter for the UTC day; over the daily cap the answer is 429 with `Retry-After` in seconds until midnight UTC. Nothing of the call is kept but its counts. With `upstream: jev` the call goes to Jev: a request over Jev's context limit is a 400 of type `urn:six-minute:problem:jev-capacity`, and a Jev failure a 502 of type `urn:six-minute:problem:provider`. With `upstream: decisions` the call is one closed question to OpenAI's Decisions API: the request carries `decision` (the property the answer fills and the choices, each with its description) and names its `model`, and a request without either is a 400. The answer is `{ [property]: choice }` under `output`, with the probabilities and the confidence under `decision`. A request the Decisions API refuses for what it holds, and an answer outside the choices, is a 502 of type `urn:six-minute:problem:provider-answer`, which the caller answers by asking the same question on the `openai` upstream; with the upstream switched off by the operator the answer is the 503 of type `urn:six-minute:problem:provider-unconfigured`. `sampling: pinned` on an `openai` call asks for the least sampling randomness the model serves (reasoning effort `none` and temperature 0 on the fixed-temperature models). A provider that fails is a 502 of type `urn:six-minute:problem:provider`; one that answers with nothing the request can use (a refusal, an answer cut at the output cap, no content, not JSON) is a 502 of type `urn:six-minute:problem:provider-answer`, which asking again will not change. A purpose only the cloud pipeline asks under (the calendar's: `judge_calendar_event`, `judge_calendar_matter`, `judge_calendar_attendance`; matter learning's: `learn_terms`) is a 422 and meters nothing.

## Request body

- object
  - `purpose` 'judge_label' | 'judge_activity' | 'judge_attribute' | 'judge_narrative' | 'judge_write' | 'judge_window' | 'segment' | 'merge' | 'merge_prose' | 'assign' | 'judge' | 'judge_shortlist' | 'judge_calendar_event' | 'judge_calendar_matter' | 'judge_calendar_attendance' | 'learn_terms', required
  - `upstream` 'openai' | 'jev' | 'decisions'
  - `messages` object[], required
    - `role` 'system' | 'user', required
    - `content` string, required
  - `schema` object, required
    - `name` string, required
    - `schema` object, required
  - `model` string
  - `max_output_tokens` integer
  - `decision` object
    - `property` string, required
    - `choices` object[], required
      - `value` string, required
      - `description` string, required
  - `sampling` 'pinned'

## Response `200`

The model's answer, parsed, with the usage the meter recorded.

- object
  - `output` unknown
  - `text` string, required
  - `model` string, required
  - `jev` object
    - `model` string, required
    - `answers` object, required
    - `usage` object, required
      - `input_tokens` integer, required
      - `output_tokens` integer, required
  - `decision` object
    - `probabilities` object[], required
      - `value` string, required
      - `probability` number, required
    - `confidence` number, nullable, required
  - `usage` object, required
    - `prompt_tokens` integer, required
    - `completion_tokens` integer, required
    - `cached_prompt_tokens` integer, required
    - `total_tokens` integer, required
    - `cost_usd` number, required
    - `priced` boolean, required

## Other responses

- `400`: The body, query or path did not validate; `errors` lists the fields.
- `401`: No bearer token, or one that does not verify or has expired.
- `403`: The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.
- `422`: The request is well-formed but cannot be carried out as it stands.
- `429`: Too many requests; `Retry-After` says how long to wait.
- `502`: An upstream this service depends on failed or answered nonsense.
- `503`: A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.

---

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