All docs / AI
AI Gateway
One OpenAI-compatible API key for many AI models, with usage logs and credits.
Open in the consoleThe AI Gateway gives you one key and one address for a catalog of AI models. It speaks the OpenAI API, so existing SDKs and tools work by changing the base URL. Usage is logged per request and paid for with RQ credits.
AI Gateway API keys are part of the paid plans; on the free plan the keys page explains this and existing keys answer 403 plan_required. Copilot and Build with AI use the same models on every plan.
Get a key
Open AI Gateway, create a key (it starts with rfa_ and is shown once), and pick a model from the catalog on the same page.
Call a model
from openai import OpenAI
client = OpenAI(api_key="rfa_…", base_url="https://ai.bigrandall.io/v1")
stream = client.chat.completions.create(
model="randall/fast",
messages=[{"role": "user", "content": "Hello"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")| Endpoint | Compatible with |
|---|---|
POST /v1/chat/completions | OpenAI Chat Completions, with streaming and tools |
POST /v1/responses | OpenAI Responses |
POST /v1/embeddings | OpenAI Embeddings |
POST /v1/messages | Anthropic Messages |
POST /v1beta/models/{model}:generateContent | Google Gemini |
GET /v1/models | The models your key can use |
Usage and limits
The AI Gateway page shows requests, tokens, credits spent and success rate for the last day, and a log of recent requests (sizes, model, timing and status; prompts and answers are not stored). Keys can have their own rate limits and expiry dates; revoke a key to stop it immediately.