Getting started
Quickstart: change your base_url
Prefill Systems speaks the OpenAI Chat Completions API. Point your SDK at the gateway, add an island field, and the island's corpus is already in the context. You send only your question.
The public base URL is shown in the console. Without a key you get 20 requests per 10 minutes; a free key from the console raises that to 120.
Python
from openai import OpenAI
client = OpenAI(base_url="https://<gateway>/v1", api_key="pf_...")
r = client.chat.completions.create(
model="qwen3-4b-instruct-2507",
messages=[{"role": "user", "content": "How does a hook declare its callbacks?"}],
extra_body={"island": "uniswap-v4"},
)
print(r.choices[0].message.content)
print(r.usage.prompt_tokens_details.cached_tokens) # e.g. 12955TypeScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://<gateway>/v1", apiKey: "pf_..." });
const r = await client.chat.completions.create({
model: "qwen3-4b-instruct-2507",
messages: [{ role: "user", content: "What does the initialize request contain?" }],
// @ts-expect-error island is a Prefill extension
island: "mcp-spec",
});curl
curl https://<gateway>/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"island":"ethereum-eips","stream":true,
"messages":[{"role":"user","content":"How is the blob base fee updated?"}]}'What comes back
A standard chat completion. usage.prompt_tokens_details.cached_tokens is the part of the prompt served from the island's KV cache. The extra prefill object carries the meter:
"prefill": {
"island": "mcp-spec", "mode": "warm", "resident": true,
"cached_tokens": 12955, "new_tokens": 9, "completion_tokens": 30,
"restore_ms": 0, "prompt_ms": 59, "ttft_ms": 78, "total_ms": 676,
"decode_tps": 48.6
}With stream: true the same object arrives on the last chunk, next to usage.
Prefill