Docs

Quickstart

Siren is OpenAI-compatible. If your code already talks to the OpenAI API, you change two values: the base URL and the model.

1. Get an API key

  1. Sign in to the console with Google or an email link. New accounts get $5 of credit, once, with no card.
  2. Open API keys, click Create key, and give it a name.
  3. Copy the secret (it starts with sk-siren-). It is shown once; if you lose it, revoke the key and make another.

Keep keys server-side or in your frontend's key field. Never ship one inside a public web page or app bundle.

2. Make your first call

Install the official SDK (pip install openai or npm install openai) and set the base URL to https://api.siren-rp.com/v1.

from openai import OpenAI

client = OpenAI(base_url="https://api.siren-rp.com/v1", api_key="sk-siren-...")

reply = client.chat.completions.create(
    model="siren-rp",
    messages=[
        {"role": "system", "content": "You are Kaela, a wolf youkai roommate. Playful, loyal, dramatic."},
        {"role": "user", "content": "I'm home! Did you leave me any dumplings?"},
    ],
    temperature=0.9,
)
print(reply.choices[0].message.content)
Base URLhttps://api.siren-rp.com/v1
Modelsiren-rp
Auth headerAuthorization: Bearer sk-siren-…

3. Stream the reply

Set stream: true to receive tokens as they are written, as server-sent events in the OpenAI format. Ask for stream_options.include_usage and the last chunk carries the token counts for the whole request.

stream = client.chat.completions.create(
    model="siren-rp",
    messages=messages,
    stream=True,
    stream_options={"include_usage": True},
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
    if chunk.usage:  # the last chunk carries usage
        details = chunk.usage.prompt_tokens_details
        print("\ncached:", details.cached_tokens if details else 0, "of", chunk.usage.prompt_tokens)

4. Read the cached token count

Every response, streamed or not, ends with a usage object:

"usage": {
  "prompt_tokens": 8120,
  "completion_tokens": 312,
  "total_tokens": 8432,
  "prompt_tokens_details": { "cached_tokens": 7680 }
}

cached_tokens is the part of the prompt the GPU already held from a recent request. Those tokens bill at $0.05 per 1M instead of $0.20. In the example above, 7,680 of 8,120 prompt tokens were cached. See Prompt caching to keep that share high.

Next steps

  • API reference: every endpoint, parameter and error code.
  • Playground: try a character card and sampler settings in the browser.