Rynler API quickstart

Use the OpenAI Python SDK with your Rynler API key and a model from the current catalogue.

Create a workspace, verify your email, add credits, and create a key with an inference scope and spending limit. Keep the key on your server.

Install the openai Python package, set RYNLER_API_KEY in your environment, then send a chat completion:

import os
import uuid
from openai import OpenAI

client = OpenAI(
    base_url="https://api.rynler.com/v1",
    api_key=os.environ["RYNLER_API_KEY"]
)

response = client.chat.completions.create(
    model="xiaomi/mimo-v2.6-flash",
    messages=[{"role": "user", "content": "Hello, world."}],
    max_tokens=1024,
    extra_headers={"Idempotency-Key": str(uuid.uuid4())}
)
print(response.choices[0].message.content)

Choose a model ID from the current catalogue. Check service availability if a request cannot be served.