Developers
OpenAI-Compatible API
Chat completions with native tool calling and streaming. Point any OpenAI SDK at ROK and it just works — you just need an API key, which any signed-in user can create instantly.
Get an API keyBase URL
https://rokremasteredapi.rokteam.org/v1Auth
Authorization: Bearer <key> or X-ROK-API-Key. Create your free key — sign in, and it is generated instantly.Limits
Models
rok-hermes (default), -spicy (adult), -vision (images).Quickstart
curl https://rokremasteredapi.rokteam.org/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ROK_API_KEY" \
-d '{
"model": "rok-hermes",
"messages": [{"role": "user", "content": "Write a haiku about the ocean."}]
}'Python
from openai import OpenAI
client = OpenAI(
base_url="https://rokremasteredapi.rokteam.org/v1",
api_key="<your ROK API key>", # create one at https://rok.rokteam.org/developers
)
completion = client.chat.completions.create(
model="rok-hermes",
messages=[{"role": "user", "content": "Write a haiku about the ocean."}],
)
print(completion.choices[0].message.content)JavaScript / TypeScript
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://rokremasteredapi.rokteam.org/v1",
apiKey: "<your ROK API key>",
});
const completion = await client.chat.completions.create({
model: "rok-hermes",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(completion.choices[0].message.content);Add stream: true for token-by-token streaming (see Streaming).
Models
GET https://rokremasteredapi.rokteam.org/v1/models lists them in the standard OpenAI shape. An unknown name returns 400 model_not_found.
| Parameter | Type | Description |
|---|---|---|
rok-hermes | default | ROK's standard model. Used when model is omitted. |
rok-hermes-spicy | adult-content | Adult-content variant with a fixed server-side personality prompt. Explicit creative content is allowed; real-world harm is still refused. |
rok-hermes-vision | vision | Image understanding. Send image_url parts with data: URLs alongside text. |
Request parameters
POST https://rokremasteredapi.rokteam.org/v1/chat/completions — everything except messages is optional.
| Parameter | Type | Description |
|---|---|---|
messages | array (required) | Chat messages as [{role, content}]. Roles: system, user, assistant, tool. Tool results use {role: "tool", tool_call_id, content}. |
model | string | Optional — defaults to "rok-hermes". See Models. |
stream | boolean | When true, return an SSE stream instead of a single JSON body. |
tools | array | Function definitions forwarded to the engine. Returned tool_calls describe CLIENT-side tools — the server never executes them. |
tool_choice | string | object | "auto" (default), "none", or {"type": "function", "function": {"name": "..."}} to force a tool. |
temperature | number | Sampling temperature. Defaults to 0.7. |
top_p | number | Nucleus sampling probability mass. |
max_tokens | integer | Maximum tokens to generate. Clamped to 4,096 — requesting more never errors. |
frequency_penalty | number | Penalizes tokens based on how often they appear so far. |
presence_penalty | number | Penalizes tokens that have already appeared. |
stop | string | string[] | Up to a few strings where generation should stop. |
seed | integer | Reproducibility hint for the sampler. |
stream_options | object | Set {"include_usage": true} to append a final usage chunk. |
role: "tool" message with the matching tool_call_id.Streaming
With stream: true you get an SSE stream of chat.completion.chunk objects, terminated by data: [DONE].
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":" world"},"finish_reason":null}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: [DONE]Add stream_options: {"include_usage": true} for a final chunk with a usage field.
Errors
Errors follow the OpenAI shape: {"error": {message, type, param, code}}.
| Status | error.type | When |
|---|---|---|
| 401 | authentication_error | Missing or invalid API key. Create one at https://rok.rokteam.org/developers — a key that stopped working may have been revoked. |
| 400 | invalid_request_error | Malformed body, empty messages, invalid model name, or bad max_tokens usage. |
| 429 | rate_limit_error | Rate limit (100 requests/minute) or the shared daily cap (1,000 completions per UTC day across every key on your account) reached. Includes Retry-After and X-RateLimit-* headers. |
| 502 | server_error | The upstream model service returned an error. |
| 503 | server_error | The model service is not configured, unreachable, or temporarily rate limited. |
429s include Retry-After plus X-RateLimit-Limit, -Remaining, and -Reset headers.
Rate limits
- 100 requests/minute (rolling window, counted per client IP).
- 1,000 completions/day, shared by every key on your account, refilling at 00:00 UTC. Creating another key does not add capacity.
- Neither meters the IP — the daily cap follows youraccount, and the rate limit your connection — so rotating addresses, keys or both doesn't help.
- A 4,000 completions/day whole-endpoint ceiling protects shared capacity.
- Only successful completions count; streaming is one request;
GET /modelsis free.