LLM

Proxy OpenAI-compatible chat completion

Credit-gated chat completion endpoint. The gateway estimates and reserves credits, routes the desktop model id to OpenAI or OpenRouter, forwards the request, streams or buffers the upstream response, then settles actual token usage.

post/v1/llm/chat/completions

Request

  • Base URL: / (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /v1/llm/chat/completions
  • Auth: HTTP bearer

Headers

Idempotency-Keystring required

Required stable key for metered POST retries. Reusing the same key for the same user, route, and method reuses the same credit reservation anchor.

x-solomon-use-casestring

Optional feature/use-case label recorded in LLMUsage for cost allocation.

x-solomon-sub-use-casestring

Optional sub-use-case label recorded in LLMUsage.

x-solomon-agent-namestring

Optional agent name recorded in LLMUsage.

Request body

max_tokensinteger

Maximum output tokens to reserve and request from the upstream.

modelstring required

Desktop-facing LLM model id.

response_formatobject

OpenAI-compatible response_format object forwarded untouched.

streamboolean

When true, rowboat-api streams server-sent events and asks the upstream to include usage.

temperaturenumber

Sampling temperature forwarded to the upstream.

tool_choicestring

OpenAI-compatible tool choice. String or object values are forwarded untouched.

toolsobject[]

OpenAI-compatible tool definitions forwarded untouched.

Example request

{
  "max_tokens": 1024,
  "messages": [
    {
      "name": "analyst",
      "role": "user"
    }
  ],
  "model": "openai/gpt-4.1-mini",
  "stream": true,
  "temperature": 0.2,
  "tool_choice": "auto"
}

Response

OpenAI-compatible JSON response, or text/event-stream when stream=true.

LLMGatewayResponse required

OpenAI-compatible upstream response. For streaming calls, the same endpoint returns text/event-stream chunks.

Changes

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