OpenAI-Compatible API

samreshuuu exposes a drop-in chat/completions endpoint. If you already use the OpenAI SDK, change the base URL and the API key — nothing else.

  • Base URL: https://api.samreshuuu.com/v1
  • Auth: an API key with the chat scope (see Authentication)

Drop-In Example

from openai import OpenAI client = OpenAI( api_key="sk-org-your_api_key", base_url="https://api.samreshuuu.com/v1", ) resp = client.chat.completions.create( model="samreshuuu", messages=[{"role": "user", "content": "Summarize this contract"}], ) print(resp.choices[0].message.content)

About the model field

The model parameter is required by the OpenAI SDK but ignored by the server — the platform selects the model. Pass any placeholder string. Sampling parameters such as temperature and max_tokens are accepted for compatibility but not honored on this endpoint.

Request Fields

FieldTypeDescription
messagesrequiredarrayChat messages. The last user message drives the turn; earlier messages are treated as history.
streambooleanWhen true, stream OpenAI chat.completion.chunk frames. Default false.
session_idstringReuse a session_id to continue a prior conversation. Omit to start fresh.
max_iterationsintegerAgent loop cap, 1–50. Default 25.
stream_optionsobjectStreaming extras. Set { "include_tool_progress": true } to also receive named tool.progress SSE events. Off by default.

This key acts on the full seller account

A chat API key drives the same agent as the workspace — the model can reach the entire tool registry, including connectors to the seller's cabinet and the terminal tool. Treat the key like account credentials: scope it per integration, store it server-side only, and rotate it if exposed. There is no read-only mode on this endpoint.

Streaming

Set stream: true to receive Server-Sent Events in OpenAI's chunk format, terminated by a final data: [DONE] frame.

data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Here"},"finish_reason":null}]} data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]} data: [DONE]

Tool progress (opt-in)

Pass stream_options: { "include_tool_progress": true } (or the header X-Hermes-Tool-Progress: 1) to receive named tool.progress SSE events interleaved with the standard chunks. They live on a separate event channel, so strict OpenAI clients that only read chat.completion.chunk ignore them — and never persist them into history. When the option is off the byte stream is identical to a vanilla OpenAI response.

event: tool.progress data: {"type":"tool.started","tool_name":"connector","label":"MoySklad","iteration":1} event: tool.progress data: {"type":"tool.completed","tool_name":"connector","label":"MoySklad","success":true,"duration_ms":842}

Multi-turn

Pass the same session_id across requests to keep context. The first response creates the session; reuse its id on the next call.

Was this page helpful?