putty
API ReferenceInference

List the supported models (OpenAI-compatible)

Returns the model ids the Inference module exposes, in the OpenAI `/v1/models` shape. Ids are provider-prefixed (`newapi/...`); the prefix is what routes a chat completion. Public so a CLI or scripted integration can discover the supported set without reading the source.

GET
/v1/models

Returns the model ids the Inference module exposes, in the OpenAI /v1/models shape. Ids are provider-prefixed (newapi/...); the prefix is what routes a chat completion. Public so a CLI or scripted integration can discover the supported set without reading the source.

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/models"
{  "object": "list",  "data": [    {      "id": "string",      "object": "model",      "created": 0,      "owned_by": "string",      "display_name": "string",      "description": "string",      "context_length": 0,      "input_modalities": [        "text"      ],      "output_modalities": [        "text"      ],      "tool_call": true,      "reasoning": true,      "logo_path": "string"    }  ]}

Preview a project with a candidate brand kit POST

Renders the project with a candidate brand kit and returns a computed-style preview: the `--brand-*` tokens the kit's seam would declare, plus the kit's name, voice, and WCAG contrast report. The kit is applied to a COPY of the project and nothing is written to the project itself, so previewing a kit never counts as applying it and never breaks the brand-seam gate (zero diff outside `src/brand/` and `public/brand/`). No sandbox is started and no model is called. The kit must be owned by the caller; a foreign kit is not found.

Create a chat completion (OpenAI-compatible) POST

OpenAI-compatible chat completion endpoint. Accepts the same body shape as OpenAI's `POST /v1/chat/completions` and returns the same response shape, either a JSON `ChatCompletion` (when `stream: false`, the default) or a `text/event-stream` of `ChatCompletionChunk` objects (when `stream: true`). The bearer token is either a Privy access token (the dashboard) or an `sk-` API key (services). Threads are persisted via a custom header — see the Inference module docs for the full list of non-OpenAI headers. When the upstream provider fails, a `stream: false` call returns 502 with the provider's message, and a streamed call ends with a chunk that carries an `error` object (`{ message }`) before `data: [DONE]`. A streamed call never ends without either a `finish_reason` or that error chunk. For a client-side tool loop, send every earlier `tool_calls` entry together with its `role: "tool"` result: an unmatched tool call is a request the upstream cannot serve.