NgamiaNgamiaDocs

Get started

Introduction

Connect an OpenAI-compatible client to many model providers through one Ngamia API key, one endpoint, and TZS credits.

Ngamia lets you use many model providers through one OpenAI-compatible API. If your application already uses the OpenAI SDK, you usually only need to change the base_url, replace the API key, and choose a Ngamia model id.

For production integrations, use an API key that starts with ngm_.... Keep the key on your server, never in browser code or a mobile app bundle.

The platform at a glance

ComponentURL or valueWhat it is
Production APIhttps://api.ngamia.cc/v1OpenAI-compatible gateway for model requests.
Documentationhttps://docs.ngamia.ccGuides, endpoint details, examples, and troubleshooting.
Local developmenthttp://localhost:8080/v1Base URL when running the API locally.
API keyngm_...Server-side credential for model and gateway requests.
Model idA bare catalog id, e.g. openai/gpt-4o-miniThe value passed in the model field.

What Ngamia gives you

CapabilityHow it helps your integration
One OpenAI-compatible interfaceKeep the request and response model you already know while changing providers behind the gateway.
One model catalogDiscover enabled paid models, modalities, supported parameters, and live pricing from GET /v1/models instead of hardcoding a list.
Chat and multimodal requestsSend OpenAI-compatible text or supported multimodal requests through one gateway.
EmbeddingsCreate complete vectors for semantic search and retrieval workflows through POST /v1/embeddings.
Ongea na Ngamia voiceTranscribe Kiswahili voice notes, generate localized text, and optionally return audio.
TZS credit billingTop up and track usage in Tanzanian Shillings rather than maintaining separate provider billing accounts.
One API keyUse a single server-side credential across the enabled model catalog.
Usage visibilityRead token counts, audio duration, characters, cost, latency, and status from activity and billing endpoints.

Why use Ngamia instead of one provider directly?

ConcernDirect provider integrationNgamia
Provider coverageOne provider per integrationMany enabled providers behind one gateway
Client codeProvider-specific setupOpenAI-compatible SDK and request shape
Model selectionMaintain provider-specific idsDiscover the current catalog from the API
BillingProvider currency and accountTZS credits and one balance
Switching providersUpdate credentials and integration codeChange the model value when the model is enabled

How an integration fits together

  1. Create and verify an account. Use Register, login & sessions to obtain a JWT for account management.
  2. Create an API key. Use the JWT to create a key on the API keys page. The secret is shown once.
  3. Choose a model. Fetch Models from GET /v1/models and store the returned model id.
  4. Send a request. Call Chat completions, Embeddings, or Voice & Ongea na Ngamia with the API key and selected catalog model.
  5. Monitor usage. Use Activity & analytics and Billing to inspect usage and balance.

Request and response model

Most account, billing, activity, and operational endpoints return Ngamia’s standard JSON envelope:

{
  "status": "success",
  "code": 200,
  "data": {},
  "request_id": "req_..."
}

POST /v1/chat/completions is intentionally different: it mirrors OpenAI’s Chat Completions response and error shape so existing SDKs continue to work. The distinction is explained in Errors.

Next steps

  • Follow the Quickstart to make your first request.
  • Read Authentication to choose between JWT and API key credentials.
  • Check Models before hardcoding a model id or price.
  • Use Chat completions for the full request, response, error, and retry reference.