API reference
Chat completions
The request shape follows the OpenAI chat convention: a model and a messages array of system / user / assistant turns. Existing OpenAI client code usually ports by changing the base URL and the model id.
The API is stateless — send the conversation history you want the model to see on every call. Persona and scene state travel two ways: system turns inside messages (full control, replaces our preamble), and the top-level context field (appended after either), which keeps character sheets and world state out of your transcript management.
**Your users can send pictures.** A user turn's content can be an array of parts mixing { "type": "text", "text": … } and { "type": "image_url", "image_url": { "url": … } } (https URL or data URI, up to 2 images per request). The engine looks at the image and the character reacts to it in the reply — +2 credits per image, on top of the completion.
**Two conversation registers.** mode: "scene" (default) writes immersive roleplay prose; mode: "messaging" answers like texting — short, casual, fast, capped at 160 tokens. Messaging on RP mini is the economical setup for DM-style products: 1 credit, snappy latency.
RP+ and RP mini are uncensored: adult and NSFW roleplay between adult characters renders in character instead of refusing, within the acceptable-use policy (no minors, no real people, nothing illegal).
Set stream: true to receive the reply as server-sent events (data: chunks, terminated by data: [DONE]). Credits are charged per completion, not per token; max_tokens is capped at 1200.
Request body
| Field | Type | Description |
|---|---|---|
| modelrequired | string | eroq-rp-plus or eroq-rp-mini. |
| messagesrequired | array | Conversation turns { role, content } — roles system, user, assistant. content is a string, or an array of text / image_url parts on user turns. |
| context | string | Persona, scene or lore block, folded into the engine-side prompt after your system turns (or after the default preamble). Ideal for character sheets and world state you manage separately from the transcript. |
| mode | string | scene (default, immersive prose) or messaging (texting register, short and fast). |
| stream | boolean | Stream the reply as SSE chunks. Default false. |
| temperature | number | Sampling temperature, 0–1.5. Default 0.8 — tuned where roleplay lives. |
| max_tokens | integer | Completion budget. Default 500, max 1200 (160 in messaging mode). |
Example
curl https://eroq.ai/v1/chat/completions \
-H "Authorization: Bearer $EROQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "eroq-rp-plus",
"context": "Mira: sardonic starship mechanic, dry humor, hates small talk. Scene: engine bay, mid-shift.",
"messages": [
{
"role": "user",
"content": "The reactor is making that noise again."
}
]
}'Response
{
"id": "cmpl_9f2e17ab",
"object": "chat.completion",
"model": "eroq-rp-plus",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "*slides out from under the manifold, wiping grease on her overalls* That noise is the reactor's way of saying you skipped the coolant flush. Again."
},
"finish_reason": "stop"
}],
"usage": { "credits_spent": 3, "credits_remaining": 997 }
}