Developers

One endpoint. Every model. OpenAI-compatible.

QueraIS speaks the OpenAI chat-completions protocol, so your existing code, SDKs, and tools just work. Point them at the gateway and your prompts run on an open market of GPU nodes — usually cheaper, with no single provider to depend on.

Migrate in one line

Already using the openai package? Swap the base URL — nothing else changes.

python · openai
from openai import OpenAI

# The only change from OpenAI: the base_url.
client = OpenAI(
    base_url="https://gateway.querais.xyz/v1",
    api_key="sk-...",
)

resp = client.chat.completions.create(
    model="gemma3:4b",
    messages=[{"role": "user", "content": "Explain Arbitrum in one sentence."}],
)
print(resp.choices[0].message.content)
typescript · openai
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://gateway.querais.xyz/v1', // <- the only change
  apiKey: 'sk-...',
});

const r = await client.chat.completions.create({
  model: 'gemma3:4b',
  messages: [{ role: 'user', content: 'Explain Arbitrum in one sentence.' }],
});
console.log(r.choices[0].message.content);
curl
curl https://gateway.querais.xyz/v1/chat/completions \
  -H "Authorization: Bearer $QUERAIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma3:4b",
    "messages": [{"role": "user", "content": "Explain Arbitrum in one sentence."}]
  }'

Or use the QueraIS SDK

Thin wrappers that add the marketplace surface on top of the OpenAI protocol — routing options, node/stats introspection, and batched-settlement sessions.

TypeScript · @querais/sdk

npm
npm install @querais/sdk
typescript
import { QueraisClient } from '@querais/sdk';

// baseUrl defaults to https://gateway.querais.xyz
const client = new QueraisClient({ apiKey: 'sk-querais-...' });

const r = await client.chat([{ role: 'user', content: 'Explain Arbitrum in one sentence.' }], {
  model: 'gemma3:4b',
  maxPricePer1kTokens: 0.5, // cap what you pay
  minReputation: 0.7, // floor node quality
});
console.log(r.content, r.usage);

Python · querais

pip
pip install querais
python
from querais import QueraisClient

client = QueraisClient("https://gateway.querais.xyz", api_key="sk-...")

result = client.chat(
    [{"role": "user", "content": "Explain Arbitrum in one sentence."}],
    model="llama3.2",
    max_price_per_1k_tokens=0.5,  # cap what you pay
    min_reputation=0.7,           # floor node quality
)
print(result.content)

Both SDKs also stream (chatStream / chat_stream) and expose models(), nodes(), and stats(). The Python package ships official LangChain and LlamaIndex adapters.

More than a clone — route the market

Price ceilings

maxPricePer1kTokens caps what any node can charge for your job.

Quality floors

minReputation routes only to nodes above a reputation threshold.

No lock-in

Open protocol, open contracts. Leave whenever — it's just the OpenAI API.

Estimate a request

Nodes set their own per-token price; you pay what the matched node quotes, plus the flat 5% protocol fee.

0.5 QAIS total
0.475 to the node (95%) · 0.025 protocol fee (5%)

API surface

MethodEndpointPurpose
POST/v1/chat/completionsInference — streaming & buffered (OpenAI-compatible)
GET/v1/modelsList models available across the network
GET/v1/nodesActive nodes: wallet, reputation, models, prices
GET/v1/statsNetwork totals — nodes, jobs, tokens, treasury
GET/v1/network/economicsSupply, burned, treasury, staker pool
GET/v1/credit/infoContract data needed to sign a spending cap
POST/v1/sessionsRegister an EIP-712 cap to enable batch settlement

Auth & billing

API key

Pass Authorization: Bearer sk-…. Keys are issued by the gateway operator during beta — ask in the project channel or open a GitHub issue.

Pre-funded credit

Deposit $QAIS into the CreditAccount contract once, sign one EIP-712 spending cap, then fire unlimited jobs — settled in batches, no wallet pop-up per call.

Capped exposure

The signed cap bounds the most the gateway can ever spend. Revoke in one tx.

95 / 5 settlement

95% of each job goes to the serving node, 5% to the protocol — enforced on-chain.