relai docs
Start

Quickstart

From zero to your first metered request in four steps.

1 · Connect your wallet

Open the account page and connect Phantom. You'll sign a short message to prove ownership — no gas, no transaction.

2 · Buy a balance

On the marketplace, pick a model and amount, then send the shown USDC to the treasury. Your balance is credited once the transfer confirms.

3 · Create an API key

In your account, create a key. It looks like relai_sk_… and is shown once — store it safely.

4 · Route a request

# swap the base URL into any OpenAI-compatible client
curl https://api.tryrelai.xyz/api/v1/gateway/v1/chat/completions \
  -H "Authorization: Bearer relai_sk_..." \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek/deepseek-chat","messages":[{"role":"user","content":"hello"}]}'

Prefer an SDK? It's the same endpoint — just swap the base URL.

# Python · OpenAI SDK
from openai import OpenAI
client = OpenAI(
    base_url="https://api.tryrelai.xyz/api/v1/gateway/v1",
    api_key="relai_sk_...",
)
resp = client.chat.completions.create(
    model="deepseek/deepseek-chat",
    messages=[{"role": "user", "content": "hello"}],
)
print(resp.choices[0].message.content)
// JavaScript · OpenAI SDK
import OpenAI from "openai";
const client = new OpenAI({
  baseURL: "https://api.tryrelai.xyz/api/v1/gateway/v1",
  apiKey: "relai_sk_...",
});
const r = await client.chat.completions.create({
  model: "deepseek/deepseek-chat",
  messages: [{ role: "user", content: "hello" }],
});
console.log(r.choices[0].message.content);

That's it. Each request meters down your balance at the locked rate.