Lyber
Request access
DocsQuickstart

Get started

Markdown

Quickstart

Get an API key, send your first request and stream the answer.

1. Get an API key

  1. Request access with a verified email. Keys work after your account is approved.
  2. Sign in and create a key under API keys. Keys start with lyber_prepaid_.
  3. Add prepaid credit under Billing, with a card or crypto.

2. Set your environment

Keep the key out of your code. The examples in these docs read it from LYBER_API_KEY.

.env
export LYBER_API_KEY="lyber_prepaid_..."

3. Send a request

Install the OpenAI SDK for your language (pip install openai or npm install openai), point it at Lyber and pick a model.

main.py
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://lyber-paid-acceptance-gateway-production.up.railway.app/v1",
    api_key=os.environ["LYBER_API_KEY"],
)

response = client.chat.completions.create(
    model="minimax-m3.1-flash-abliterated",
    messages=[{"role": "user", "content": "Explain abliteration in two sentences."}],
    max_tokens=1024,
)
print(response.model)
print(response.choices[0].message.content)

4. Stream the answer

Add stream: true to receive tokens as they are generated.

main.py
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://lyber-paid-acceptance-gateway-production.up.railway.app/v1",
    api_key=os.environ["LYBER_API_KEY"],
)

stream = client.chat.completions.create(
    model="minimax-m3.1-flash-abliterated",
    messages=[{"role": "user", "content": "Write a haiku about open weights."}],
    max_tokens=1024,
    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:
        print("\n", chunk.usage)

Next steps