Documentation
A protocol-compatible Chat Completions endpoint. Everything you know about the [OI] API applies — change the base URL and the key.
Base URL
text
https://api.roma.co.ke/v1Authentication
Send your key in the Authorization header as a bearer token, or in the x-api-key header. Keys are generated once at registration and can be rotated from the dashboard.
http
Authorization: Bearer sk-your-golin-key
# or
x-api-key: sk-your-golin-keyEndpoints
| Method | Path | Description |
|---|---|---|
| /v1/chat/completions | Proxied and billed chat completion. | |
| /v1/models | Models exposed by the upstream supplier. | |
| /balance | Current balance. Accepts an API key or session. | |
| /usage | Last 50 requests with token counts and cost. |
Billing
Requests are billed per token at 3× wholesale cost. Completion tokens already include reasoning tokens. Balances are held in microdollars (USD × 10,000), always rounded up so sub-cent requests are never free.
| Token type | Field | Price / 1M |
|---|---|---|
| Input | prompt_tokens | $0.016200 |
| Output | completion_tokens | $0.064800 |
| Cache read | cache_read_input_tokens | $0.000324 |
| Cache write | cache_creation_input_tokens | $0.016200 |
If a request would overdraw the balance, the balance floors at zero and the request is rejected next time — you are never taken negative.
Examples
cURL
bash
curl https://api.roma.co.ke/v1/chat/completions \
-H "Authorization: Bearer $GOLIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "Hello"}],
"stream": true,
"stream_options": {"include_usage": true}
}'Python
python
import os
from openai import [OI]
client = [OI](
api_key=os.environ["GOLIN_API_KEY"],
base_url="https://api.roma.co.ke/v1",
)
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Explain microdollars."}],
)
print(response.choices[0].message.content)Node.js
typescript
import [OI] from "openai"
const client = new [OI]({
apiKey: process.env.GOLIN_API_KEY,
baseURL: "https://api.roma.co.ke/v1",
})
const completion = await client.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Hello" }],
})
console.log(completion.choices[0].message.content)Errors
| Status | When | Body |
|---|---|---|
| 401 | Missing or invalid API key | {"error": "Unauthorized"} |
| 402 | Balance is zero | {"error": "Insufficient credits"} |
| 403 | Account disabled by an operator | {"error": "Account suspended"} |
| 502 | Supplier could not be reached | {"error": "Upstream error"} |
Top up
Prepaid credits in KES via M-Pesa or card. Settles to your balance instantly.
Track spend
Every request is itemised with tokens, model, cost, and resulting balance.