API reference

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/v1

Authentication

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-key

Endpoints

MethodPathDescription
POST/v1/chat/completionsProxied and billed chat completion.
GET/v1/modelsModels exposed by the upstream supplier.
GET/balanceCurrent balance. Accepts an API key or session.
GET/usageLast 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 typeFieldPrice / 1M
Inputprompt_tokens$0.016200
Outputcompletion_tokens$0.064800
Cache readcache_read_input_tokens$0.000324
Cache writecache_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

StatusWhenBody
401Missing or invalid API key{"error": "Unauthorized"}
402Balance is zero{"error": "Insufficient credits"}
403Account disabled by an operator{"error": "Account suspended"}
502Supplier 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.