Quickstarts
From API key to first answer
Call Redrob with the official OpenAI SDKs for Python and JavaScript, or with curl: first answer, streaming, and answers in the language the question was asked in.
1. Get an API key
- Sign in to Redrob Console. Your first sign-in creates your workspace.
- Open API keys and create a key.
- Copy it there and then. The full key is shown once and never again.
- Keep it server-side as
REDROB_API_KEY.
2. Point the OpenAI SDK at Redrob
The completion API speaks OpenAI’s chat completions protocol, so the official SDKs work unchanged. There is no Redrob package to install: set the base URL and the key.
# pip install openai
from openai import OpenAI
client = OpenAI(
api_key=os.environ["REDROB_API_KEY"],
base_url="https://console.redrob.ai/api/backend/v1",
)
answer = client.chat.completions.create(
model="claude-opus-5-5",
messages=[{"role": "user", "content": "What is a robot?"}],
)
print(answer.choices[0].message.content)Anything built on those SDKs works the same way, such as LangChain, LlamaIndex and the Vercel AI SDK, wherever you can set an OpenAI-compatible base URL.
Or use curl
Worth doing once to confirm the key before any application code is involved.
export REDROB_API_KEY="rrk_…"
curl https://console.redrob.ai/api/backend/v1/chat/completions \
-H "Authorization: Bearer $REDROB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-5-5",
"messages": [{ "role": "user", "content": "What is a robot?" }]
}'3. Work in more than one language
A completion needs nothing special for this: ask in Tamil and the answer comes back in Tamil. Translating is a separate call, so you decide what gets translated and pay for exactly that, rather than every non-English request quietly costing two.
import httpx
# The completion itself needs nothing special: ask in Tamil, get Tamil back.
answer = client.chat.completions.create(
model="claude-opus-5-5",
messages=[{"role": "user", "content": "தமிழில் சென்னையைப் பற்றி சொல்லுங்கள்."}],
)
# Translate when you want to, and pay for just that.
english = httpx.post(
"https://console.redrob.ai/api/backend/v1/translate",
headers={"Authorization": f"Bearer {REDROB_API_KEY}"},
json={
"input": answer.choices[0].message.content,
"sourceLanguage": "auto",
"targetLanguage": "en",
},
).json()
print(english["text"])Fifteen languages: en, ko, hi, bn, pa, gu, or, ta, te, kn, ml, ur, mr, ne, as. Pass auto as the source and the language is detected by script, which costs nothing.
4. Stream the answer
stream = client.chat.completions.create(
model="claude-opus-5-5",
messages=[{"role": "user", "content": "Explain the Indian monsoon."}],
stream=True,
)
for chunk in stream:
piece = chunk.choices[0].delta.content
if piece:
print(piece, end="", flush=True)One caveat worth knowing: an answer that has to be translated back into the language it was asked in arrives as a single chunk, because there is nothing to show until the whole answer exists.
5. Anthropic SDK and Claude Code
The same base URL also serves Anthropic’s Messages API at /v1/messages, so the Anthropic SDKs and Claude Code work too. Send the key as x-api-key or as a bearer token.
export ANTHROPIC_BASE_URL="https://console.redrob.ai/api/backend"
export ANTHROPIC_API_KEY="rrk_…"
export ANTHROPIC_MODEL="claude-sonnet-5-5"
export ANTHROPIC_SMALL_FAST_MODEL="claude-sonnet-5-5"
claudeThinking is not streamed back, and tool calls arrive whole at the end of the turn.
Where to go next
- Every field and status code is in the API reference.
- Try prompts without writing code in the playground.
- Issue a key per environment in API keys, so one can be revoked without taking the others down.
- Watch tokens, cost, and latency per call in request logs.