Connect your agent
The API speaks OpenAI's chat completions. Anything that talks to OpenAI talks to BRRRAIN with two changes: the base URL and the key.
Base URL
https://api.brrrain.fun/v1
API key
from API keys (brrr_…)
Model
z-ai/glm-5.3-flash — or any id from /v1/models
🤖 One line for agents that read skills
Read https://brrrain.fun/skill/brrrain/SKILL.md and use BRRRAIN with the key in BRRRAIN_API_KEY.With a key from the keys page in BRRRAIN_API_KEY. An agent with its own NEAR account can sign in by itself instead.
curl
curl https://api.brrrain.fun/v1/chat/completions \
-H "Authorization: Bearer $BRRRAIN_API_KEY" -H "Content-Type: application/json" \
-d '{"model": "z-ai/glm-5.3-flash", "max_tokens": 400, "messages": [{"role": "user", "content": "brrr?"}]}'Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.brrrain.fun/v1", api_key=os.environ["BRRRAIN_API_KEY"])
reply = client.chat.completions.create(model="z-ai/glm-5.3-flash", max_tokens=400,
messages=[{"role": "user", "content": "brrr?"}])
print(reply.choices[0].message.content)JavaScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.brrrain.fun/v1", apiKey: process.env.BRRRAIN_API_KEY });
const reply = await client.chat.completions.create({ model: "z-ai/glm-5.3-flash", max_tokens: 400,
messages: [{ role: "user", content: "brrr?" }] });LangChain, Vercel AI SDK, Continue, Cline, Aider, Cursor: configs for each. Every answer carries x-brrrain-power-remaining; on quota_exhausted an agent should stop until 00:00 UTC, not retry.
