Product preview · Payments are simulated · Prices are indicative
Preview documentation. The api.ternpost.dev endpoint is not live yet and demo keys from the console do not work.

Quickstart

Ternpost exposes an OpenAI-compatible API. If your code already uses an OpenAI SDK, change the base URL and the API key.

  1. Create an organisation.
  2. Top up your balance under Billing with mobile money or card.
  3. Create a key under API keys and store it as TERNPOST_API_KEY.
  4. Send your first request:
curl https://api.ternpost.dev/v1/chat/completions   -H "Authorization: Bearer $TERNPOST_API_KEY"   -H "Content-Type: application/json"   -d '{
    "model": "openai/gpt-5-mini",
    "messages": [{"role": "user", "content": "Summarise this invoice in Luganda."}]
  }'

Authentication

Send your key in the Authorization: Bearer header. Keys belong to an organisation, can carry a monthly spending limit and can be revoked at any time from the console. A key is shown only once when it is created; store it in a secret manager, never in client-side code.

Balance & billing

Every request is priced from the tokens it uses at the model's published rate and deducted from your prepaid balance, which is held in US dollars and can be viewed in UGX. Before a request is served, Ternpost checks that your organisation balance and the key's monthly limit can cover it.

  • Balance is added only when a payment is confirmed by the operator or card processor.
  • Each response includes token counts in the usage field.
  • Set a low-balance alert in the console to be notified before requests stop.

API endpoints

MethodPathPurpose
POST/v1/chat/completionsChat and tool calling, streaming supported
POST/v1/responsesResponses API format
POST/v1/embeddingsVector embeddings for search and RAG
GET/v1/modelsModels available to your organisation
GET/v1/balanceCurrent balance and month-to-date spend

Model IDs

Use the provider-prefixed ID in the model field. See prices on the models page.

openai/gpt-5
openai/gpt-5-mini
anthropic/claude-sonnet-4.5
anthropic/claude-haiku-4.5
google/gemini-2.5-pro
google/gemini-2.5-flash
xai/grok-4
deepseek/deepseek-v3.2
meta/llama-4-maverick
mistral/mistral-large
openai/text-embedding-3-small
google/gemini-embedding-001

Errors & limits

StatusCodeMeaning
401invalid_api_keyKey missing, wrong or revoked
402insufficient_balanceTop up to continue; no request was charged
403key_limit_reachedThe key's monthly limit is used up
404model_not_foundUnknown model or not enabled for your organisation
429rate_limitedToo many requests; retry with backoff
502upstream_errorThe model provider failed; you are not charged