rfi

API quickstart

OpenAI-compatible. Point any SDK at https://api.rfi.dev/v1 with your RFI key.

curl

curl https://api.rfi.dev/v1/chat/completions \
  -H "Authorization: Bearer $RFI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.8-27b",
    "messages": [{"role": "user", "content": "hello"}],
    "reasoning_effort": "medium"
  }'

python (openai sdk)

import os

from openai import OpenAI

client = OpenAI(
    base_url="https://api.rfi.dev/v1",
    api_key=os.environ["RFI_API_KEY"],
)
resp = client.chat.completions.create(
    model="qwen3.8-27b",
    messages=[{"role": "user", "content": "hello"}],
    reasoning_effort="medium",   # low | medium | xhigh
)

reasoning effort

Three levels, low to high: low, medium, xhigh. Send it as the OpenAI-standard reasoning_effort or as an OpenRouter-style reasoning object — both work.

# top-level (OpenAI-standard)
{"model": "qwen3.8-27b", "reasoning_effort": "xhigh", ...}

# object form (OpenRouter-style) — equivalent
{"model": "qwen3.8-27b", "reasoning": {"effort": "xhigh"}, ...}

# turn thinking off entirely
{"model": "qwen3.8-27b", "reasoning": {"effort": "none"}, ...}

# a hard cap on think-block length is a SEPARATE, composable knob:
{"model": "qwen3.8-27b", "reasoning": {"effort": "xhigh",
                                       "max_tokens": 2048}, ...}

The keyword shapes how the model is asked to think; an explicit max_tokens inside the reasoning object caps how long the think block may run. They compose. Reasoning tokens are completion tokens and are billed as output.

long generations

Use stream: true for anything that may run long. A non-streaming request holds one connection open and sends nothing until the whole answer is ready, and our serving path cuts a silent request after about five minutes — that limit is infrastructure, not policy, and no setting on your side raises it. A streaming request is not affected: bytes keep flowing, so it can run as long as the generation takes. Streaming also survives a deploy better; a long non-streaming request that overlaps one can be dropped without an error your client can see. If you must use non-streaming for a long generation, cap it with max_tokens and retry on failure.

billing

Prepaid credits, exact token-level pricing: $0.4/M input, $0.05/M cached input, $3.2/M output. Usage appears in Activity within ~30 seconds.

API quickstart — RFI docs