API quickstart
OpenAI-compatible. Point any SDK at https://api.rfi.dev/v1 with your RFI key.
switch an existing project
Paste this into Claude Code, or any coding agent, from the root of the project you want to move over. It finds the clients and config that currently talk to another provider, repoints them here, and reports what it changed.
Migrate this repository to the rfi.dev inference API. rfi.dev is OpenAI-compatible: base URL https://api.rfi.dev/v1 model id qwen3.8-27b auth bearer token, an rfi API key from https://rfi.dev/keys Steps: 1. Find every place this repo talks to an LLM API. Check OpenAI SDK clients (Python and JavaScript/TypeScript), raw fetch/axios/requests/curl calls, LangChain / LlamaIndex / LiteLLM configuration, environment files and templates, CI configuration, and any README or docs page showing a snippet. 2. Repoint each one at https://api.rfi.dev/v1. In the OpenAI SDKs that is base_url (Python) or baseURL (JavaScript); in raw HTTP it is the request URL. 3. Set the model id to qwen3.8-27b everywhere a model is named, including defaults, fallbacks, config files, tests and docs. 4. Read the key from an environment variable named RFI_API_KEY. Never hardcode a key and never write a real key into a tracked file. Add RFI_API_KEY to .env.example (create it if absent) with a placeholder value, and update .env.example comments and README setup steps to match. 5. Prefer streaming. Where a call can produce a long answer, set stream: true (Python: stream=True) and consume the stream. A non-streaming request is cut by infrastructure after about five minutes; a streaming one is not. Never change a function's signature or return type to do this — if streaming would change what a caller receives, leave that call as it is. 6. Leave provider-agnostic abstractions intact. If calls already go through a wrapper, factory or settings object, change the configuration it reads, not its shape. Do not add a dependency and do not remove one that is still used. 7. Change nothing else. Leave prompts, business logic, tests and unrelated files alone except where step 3 or step 4 requires an edit. When you are finished, list every file you changed and what changed in each.
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.