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://samreshuuu.ru/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://samreshuuu.ru/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.

FAQ

What do I change to use the OpenAI SDK with samreshuuu?

Only the base URL (https://samreshuuu.ru/v1) and the API key. Existing chat.completions code works unchanged, and the key needs the chat scope.

Is the model parameter honored?

No. The OpenAI SDK requires it, but the server ignores it and selects the model itself — pass any placeholder string. Sampling parameters such as temperature and max_tokens are accepted for compatibility but not honored on this endpoint.

How do I keep context across requests?

Pass the same session_id on each call. The first response creates the session; reuse its id to continue the conversation.

What can a chat API key do?

It drives the same agent as the workspace, with access to the full tool registry including the seller's connectors and the terminal tool. There is no read-only mode — treat the key like account credentials, keep it server-side, and rotate it if exposed.

Frequently asked questions

What do I change to use the OpenAI SDK with samreshuuu?

Only the base URL (https://samreshuuu.ru/v1) and the API key. Existing chat.completions code works unchanged, and the key needs the chat scope.

Is the model parameter honored?

No. The OpenAI SDK requires it, but the server ignores it and selects the model itself — pass any placeholder string. Sampling parameters such as temperature and max_tokens are accepted for compatibility but not honored on this endpoint.

How do I keep context across requests?

Pass the same session_id on each call. The first response creates the session; reuse its id to continue the conversation.

What can a chat API key do?

It drives the same agent as the workspace, with access to the full tool registry including the seller's connectors and the terminal tool. There is no read-only mode — treat the key like account credentials, keep it server-side, and rotate it if exposed.

Was this page helpful?