Skip to content

Developer documentation

Multilingual answers, through the API you already know

How the Redrob completion API works: OpenAI-compatible requests, API keys, multilingual answers across fifteen languages, what a call costs, and what to do with errors.

Start here

The completion API speaks OpenAI’s chat completions protocol. Point the official SDK at Redrob’s base URL with a Redrob API key and existing code works; the difference is that a question asked in Hindi, Tamil, or Bengali can be answered in that language.

Python
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["REDROB_API_KEY"],
    base_url="https://console.redrob.ai/api/backend/v1",
)

Ask in whatever language your users write in and the answer comes back in that language. Nothing has to be declared for that to happen.

Request
answer = client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "로봇이란 무엇인가요?"}],
)
Response
{
  "choices": [
    { "message": { "content": "로봇은 …" } }
  ],
  "usage": { "prompt_tokens": 24, "completion_tokens": 96 },
  "redrob": {
    "requestId": "req_…",
    "latencyMs": 812
  }
}

Base URL

https://console.redrob.ai/api/backend/v1

The API shares the console’s domain, which is deliberate: a preview deployment’s console talks to that same preview’s API, so there is no second host to keep in step. Include the /v1 - the SDKs append /chat/completions to whatever you give them.

API keys

One credential: an API key, sent as a bearer token, which is exactly where the OpenAI SDKs put theirs. Keys look like rrk_<prefix>_<secret>, are shown once when created, and are stored as hashes, so a lost key is replaced rather than recovered.

Issue one per environment and per service. The prefix identifies a key in the console and in the request log without revealing it, so you can see which key spent what, and revoking one leaves the others working.

Connecting a Redrob app

The Redrob apps use the same credential as anything else here: a workspace API key. Four of them, Work, Design, Browser and Code, need no key copied in by hand; Office is the exception and takes one you paste. Press Connect Redrob in the app and it opens console.redrob.ai/connect with a short code. Sign in, check the app named on that page is the one you pressed the button in, and approve it.

Approving creates one key in the workspace your session is in and hands it to the app. The secret is never shown on the confirm page, and the app collects it once, so there is nothing on screen to copy or leave in a screenshot. A code is live for ten minutes and can be approved once; declining, or letting it run out, issues nothing.

What arrives is an ordinary key. It appears in API keys named after the app and the day it was approved, its usage is billed to that workspace like any other, and revoking it there stops the app. Connecting does not add credit to the workspace.

Working in more than one language

Send the prompt as you received it. The models answer in the language they are asked in, and the gateway does not rewrite either side of that.

When you do want something translated, ask for it: POST /v1/translate takes a source and a target and translates exactly what you hand it. Passing auto as the source detects the language by script, which costs nothing and cannot drift, since Hangul, Devanagari, Tamil, Bengali and the rest each have their own Unicode range.

The gateway used to do this inside a completion, behind a flag called indicAssist: it detected the script, asked the model to reason in English and translated the answer back. That was two upstream calls and roughly double the cost for every non-English request, whether or not the translation was wanted. Deciding for yourself is cheaper and clearer, so the flag is gone and a request still sending it is refused with a message pointing here.

What a call costs

Requests are paid for out of prepaid credit, priced per million tokens in and out. Every answer carries its own token counts, so the figure you are charged is the figure you can see, and the same numbers appear in the request log and the usage charts in the console.

At zero balance requests are refused with a 402 rather than being queued or silently degraded. Billing can add credit automatically when the balance falls below a threshold you set.

Seeing what happened

Each call is logged with the key that made it, the model, token counts, latency, and and which model answered. Prompts and answers are not part of that record and are not stored, so your users’ content stays on your side of the call.

Read them in request logs and usage . The redrob.requestId on a response is the id of its log row, which is the quickest way to look up one specific call.

Errors

Errors are JSON with statusCode and message . A 401 means the key is missing, malformed, or revoked. A 402 means the workspace is out of credit. A 503 means no upstream provider could serve the request, which is worth retrying.

Retry 5xx with exponential backoff and jitter. Do not retry a 400 or a 402: neither will succeed until something changes at your end.