From wallet to first token
- Open the console and sign in with your wallet — one signature, no gas.
- Top up your balance in native USDC on Base.
- Mint a relay key, set your base URL to
https://defai.gtio.work/v1, and call any model.
curl https://defai.gtio.work/v1/chat/completions \
-H "Authorization: Bearer sk-relay-…" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-opus-4.8",
"messages": [{"role":"user","content":"Settle this."}],
"stream": true
}'Relay keys
The relay authenticates with a bearer key (sk-relay-…) sent as Authorization: Bearer …. Mint and revoke keys in the console; the plaintext is shown exactly once and only its hash is stored. Your wallet session is for the console only — never send it to the relay.
One rule: which base URL
The whole integration hinges on the base URL your client points at.
https://defai.gtio.work/v1 — chat/completions, responses, embeddings, images.https://defai.gtio.work — no /v1; the client appends /v1/messages itself. This is how Claude Code connects.https://defai.gtio.work/vertex-ai — Imagen, Gemini image, and Veo video.Every surface — with full request/response parameters and a copy-paste example — is in the API Reference; jump straight in:
| POST | /v1/chat/completions | Chat — streaming, tools, vision → |
| POST | /v1/messages | Anthropic Messages — powers Claude Code → |
| POST | /v1/responses | OpenAI Responses — powers newer Codex → |
| POST | /v1/images/generations | Text-to-image — returns b64 PNG → |
| POST | /v1/images/edits | Image-to-image — edit / reference image → |
| POST | /v1/completions | Legacy text completion → |
| POST | /v1/embeddings | Embeddings → |
| GET | /v1/models | List callable models → |
| ANY | /vertex-ai/* | Google GenAI — imagen, gemini-image, veo video → |
Real token streaming
Set "stream": true and the response is Server-Sent Events, passed straight through with backpressure — tokens arrive the instant the model emits them, with no buffering at the edge. Omit it for a single JSON response.
Addressing a model
Models are addressed as provider/model — e.g. openai/gpt-5.5, anthropic/claude-opus-4.8, google/gemini-3.5-flash. Browse the full catalog with live prices, context windows, and modalities on the pricing page, or fetch GET /v1/models at runtime.
Beyond text, the same key reaches image models (gpt-image on the OpenAI Images API; Imagen and Gemini image on Vertex) and video (Veo, Seedance). Those endpoints live in the API Reference.
Paid per token, settled on-chain
- Each call is metered by prompt + completion tokens and charged
ceil((prompt×in + completion×out) × markup)in integer USDC base units (6 decimals). No floating-point drift, no rounding in anyone's favor. - A spend hold is reserved up front from your balance and reconciled to actual usage when the call settles.
- Prompt caching is priced through. Cached input tokens bill at the model's cache-read rate — far below fresh input — and cache writes at their own rate, so a cached call costs you what it costs us, not full price.
- A model with no published price is refused, never billed at a guess. Run out of balance and the request is rejected before it reaches the provider.
Use your existing SDK
Python:
from openai import OpenAI
client = OpenAI(
base_url="https://defai.gtio.work/v1",
api_key="sk-relay-…",
)
stream = client.chat.completions.create(
model="openai/gpt-5.5",
messages=[{"role": "user", "content": "Hello"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")TypeScript / JavaScript:
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://defai.gtio.work/v1",
apiKey: "sk-relay-…",
});
const res = await client.chat.completions.create({
model: "google/gemini-3.5-flash",
messages: [{ role: "user", content: "Hello" }],
});
console.log(res.choices[0].message.content);Keep going
- API Reference — every endpoint's parameters, response shapes, copy-paste examples, the error envelope, and a one-click AI-integration prompt.
- Integrations — no-code setups for Claude Code, Codex, OpenClaw, Kilo Code, OpenHands, Cursor and more.
- Pricing — the live, searchable model catalog with per-token, per-image, and per-second rates.
- FAQ — wallet login, USDC settlement, caching, and privacy.
One endpoint, every model, paid in USDC.