chat

Chat Completions

Handle chat completion requests.

Supports both authenticated and public (unauthenticated) requests. Guest users are limited to the playground UI path at $0.50/day per IP and browser fingerprint. Authenticated free users are not subject to a daily chat cap after they sign in.

post/v1/openai/chat/completions

Request

  • Base URL: https://api.vlm.run (the document declares no server; this is the origin it was published from)
  • URL: https://api.vlm.run/v1/openai/chat/completions
  • Auth: HTTP bearer

Headers

user-agentstring nullable

Request body

idstring

ID of the completion

max_tokensinteger

Maximum number of tokens to generate

ninteger nullable

Number of completions to generate

temperaturenumber

Temperature of the sampling distribution

top_pnumber

Cumulative probability of parameter highest probability vocabulary tokens to keep for nucleus sampling

top_kinteger nullable

Number of highest probability vocabulary tokens to keep for top-k-filtering

logprobsinteger nullable

Include the log probabilities on the logprobs most likely tokens, as well the chosen tokens

streamboolean

Whether to stream the response or not

toolsobject[] nullable

OpenAI-compatible client tool definitions. By default (tool_execution=client) the endpoint returns model tool_calls for the client to execute (OpenRouter / OpenAI / pydantic-ai protocol). Set tool_execution=hybrid to also enable server-side tools such as execute_code.

tool_execution'client' | 'hybrid' nullable

How tools are executed when tools is set. client (default): passthrough — all tool_calls returned to the caller. hybrid: server tools (see server_tools) run in-process; only client tool_calls are returned with finish_reason=tool_calls.

server_toolsstring[] nullable

Server-owned tool names to inject and execute when tool_execution=hybrid. Defaults to ["execute_code"]. Unknown names are rejected.

expose_server_tool_callsboolean

When True on the native (no client tools) path, stream OpenAI-compatible delta.tool_calls for server-side tool invocations. Default False keeps the opaque server harness loop (text / preview / think markers only). External agent harnesses that need visible tool_calls should prefer tool_execution=hybrid instead.

service_tier'auto' | 'default' | 'standard' | 'flex' | 'priority' nullable

Delivery tier for the request. 'standard'/'default' uses baseline rates, 'flex' applies a 50% discount with higher latency, and 'priority' applies a 1.8x premium for highest reliability. When omitted (or 'auto'), the server default ('standard') applies — opt into 'flex'/'priority' explicitly.

session_idstring

Session UUID for persisting the chat history

session_tokenstring nullable

Client-minted session token for IDOR protection (base64url, >=256-bit)

metadataobject nullable

Additional metadata for the request (e.g., dataset_name, experiment_id, etc.)

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 2 revisions of this API.